Skip to content

Commit

Permalink
chore: fix..stuff?
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Jul 25, 2024
1 parent 9e2163e commit bf2c0c7
Show file tree
Hide file tree
Showing 11 changed files with 6,603 additions and 3,981 deletions.
15 changes: 0 additions & 15 deletions .all-contributorsrc

This file was deleted.

26 changes: 13 additions & 13 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Development

After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):
After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing npm](https://npm.io/installation):

```shell
git clone https://github.com/ < your-name-here > /impvol
cd impvol
pnpm install
npm install
```

> This repository includes a list of suggested VS Code extensions.
Expand All @@ -16,13 +16,13 @@ pnpm install
Run [**tsup**](https://tsup.egoist.dev) locally to build source files from `src/` into output files in `lib/`:

```shell
pnpm build
npm run build
```

Add `--watch` to run the builder in a watch mode that continuously cleans and recreates `lib/` as you save files:

```shell
pnpm build --watch
npm run build --watch
```

## Formatting
Expand All @@ -33,28 +33,28 @@ It should be applied automatically when you save files in VS Code or make a Git
To manually reformat all files, you can run:

```shell
pnpm format --write
npm run format --write
```

## Linting

This package includes several forms of linting to enforce consistent code quality and styling.
Each should be shown in VS Code, and can be run manually on the command-line:

- `pnpm lint` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files
- `pnpm lint:knip` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports
- `pnpm lint:md` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files
- `pnpm lint:spelling` ([cspell](https://cspell.org)): Spell checks across all source files
- `npm run lint` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files
- `npm run lint:knip` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports
- `npm run lint:md` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files
- `npm run lint:spelling` ([cspell](https://cspell.org)): Spell checks across all source files

Read the individual documentation for each linter to understand how it can be configured and used best.

For example, ESLint can be run with `--fix` to auto-fix some lint rule complaints:

```shell
pnpm run lint --fix
npm run lint --fix
```

Note that you'll likely need to run `pnpm build` before `pnpm lint` so that lint rules which check the file system can pick up on any built files.
Note that you'll likely need to run `npm run build` before `npm run lint` so that lint rules which check the file system can pick up on any built files.

## Type Checking

Expand All @@ -63,11 +63,11 @@ You should be able to see suggestions from [TypeScript](https://typescriptlang.o
However, it can be useful to run the TypeScript command-line (`tsc`) to type check all files in `src/`:

```shell
pnpm tsc
npm run tsc
```

Add `--watch` to keep the type checker running in a watch mode that updates the display as you save files:

```shell
pnpm tsc --watch
npm run tsc --watch
```
3 changes: 1 addition & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"ignoreDeps": ["codecov/codecov-action"],
"internalChecksFilter": "strict",
"labels": ["dependencies"],
"minimumReleaseAge": "3 days",
"postUpdateOptions": ["pnpmDedupe"]
"minimumReleaseAge": "3 days"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
lib/
node_modules/
.tshy
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ greet("Hello, world! 💖");

<!-- You can remove this notice if you don't want it 🙂 no worries! -->

> 💙 This package was templated with [`create-typescript-app`](https://github.com/JoshuaKGoldberg/create-typescript-app).
> 💙 This package was templated with [`impvol`](https://github.com/JoshuaKGoldberg/impvol).
4 changes: 2 additions & 2 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"CHANGELOG.md",
"lib",
"node_modules",
"pnpm-lock.yaml"
"package-lock.json"
],
"words": ["impvol", "knip", "packagejson", "tseslint", "tsup"]
"words": ["impvol", "knip", "packagejson", "tseslint", "tshy"]
}
69 changes: 2 additions & 67 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,20 @@
import eslint from "@eslint/js";
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import jsdoc from "eslint-plugin-jsdoc";
import jsonc from "eslint-plugin-jsonc";
import markdown from "eslint-plugin-markdown";
import n from "eslint-plugin-n";
import packageJson from "eslint-plugin-package-json/configs/recommended";
import perfectionistNatural from "eslint-plugin-perfectionist/configs/recommended-natural";
import * as regexp from "eslint-plugin-regexp";
import yml from "eslint-plugin-yml";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: ["lib", "node_modules", "pnpm-lock.yaml", "**/*.snap"],
ignores: ["lib", "node_modules", "package-lock.json", "**/*.snap"],
},
{
linterOptions: {
reportUnusedDisableDirectives: "error",
},
},
eslint.configs.recommended,
...jsonc.configs["flat/recommended-with-json"],
...markdown.configs.recommended,
...yml.configs["flat/recommended"],
...yml.configs["flat/prettier"],
comments.recommended,
jsdoc.configs["flat/recommended-typescript-error"],
n.configs["flat/recommended"],
packageJson,
perfectionistNatural,
regexp.configs["flat/recommended"],
...tseslint.config({
extends: [
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
extends: tseslint.configs.recommendedTypeChecked,
files: ["**/*.js", "**/*.ts"],
languageOptions: {
parserOptions: {
Expand All @@ -45,36 +25,11 @@ export default tseslint.config(
},
},
rules: {
// These off-by-default rules work well for this repo and we like them on.
"jsdoc/informative-docs": "error",
"logical-assignment-operators": [
"error",
"always",
{ enforceForIfStatements: true },
],
"operator-assignment": "error",

// These on-by-default rules don't work well for this repo and we like them off.
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param": "off",
"jsdoc/require-property": "off",
"jsdoc/require-returns": "off",
"no-constant-condition": "off",

// These on-by-default rules work well for this repo if configured
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
"perfectionist/sort-objects": [
"error",
{
order: "asc",
"partition-by-comment": true,
type: "natural",
},
],

// Stylistic concerns that don't interfere with Prettier
"no-useless-rename": "error",
"object-shorthand": "error",
},
}),
{
Expand All @@ -92,24 +47,4 @@ export default tseslint.config(
"n/no-missing-import": ["error", { allowModules: ["impvol"] }],
},
},
{
files: ["**/*.{yml,yaml}"],
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/sort-keys": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
"yml/sort-sequence-values": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
},
},
);
Loading

0 comments on commit bf2c0c7

Please sign in to comment.