@st1ggy/linter-config 6.3.2 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -10
- package/data/linter-config-inventory.json +4376 -493
- package/docs/RULE_MAPPING.md +2 -0
- package/index.d.ts +18 -0
- package/package.json +79 -28
- package/scripts/README.md +14 -11
- package/scripts/init-astro.sh +5 -0
- package/scripts/inventory.mjs +9 -2
- package/scripts/linter-init-core.mjs +93 -32
- package/scripts/linter-init.mjs +118 -93
- package/src/eslint/configs/astro-stack.js +3 -0
- package/src/eslint/configs/config.common.js +1 -1
- package/src/eslint/configs/config.gitignore.js +3 -4
- package/src/eslint/configs/config.unicorn.js +1 -1
- package/src/eslint/configs/constants.js +4 -2
- package/src/eslint/eslint.config.astro.js +4 -0
- package/src/examples/example.astro +7 -0
- package/src/examples/example.ts +1 -1
- package/src/index.js +2 -0
- package/src/prettier/prettier-astro.config.js +7 -0
package/README.md
CHANGED
|
@@ -8,24 +8,25 @@ Install once:
|
|
|
8
8
|
npm i -D @st1ggy/linter-config
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Framework-specific ESLint and Prettier plugins are optional peers, so installing this package does not install integrations for unused frameworks. The wizard installs only the selected stack's plugins as dev dependencies.
|
|
12
12
|
|
|
13
13
|
### Generate local wrapper configs
|
|
14
14
|
|
|
15
15
|
The published CLI is invoked as **`@st1ggy/linter-config`** (see [`package.json`](package.json) `bin`). Each run writes **`eslint.config.js`**, **`prettier.config.js`**, and **`stylelint.config.js`** as ESM re-exports for one stack.
|
|
16
16
|
|
|
17
|
-
Unless **`--skip-install`** is passed: if **`package.json`** exists in the target directory
|
|
17
|
+
Unless **`--skip-install`** is passed: if **`package.json`** exists in the target directory, the CLI runs the detected package manager (**npm** / **pnpm** / **yarn** / **bun** from the nearest lockfile) to install **`@st1ggy/linter-config`** and only the selected stack's integration plugins. When all selected packages are already declared but missing from `node_modules`, it runs a regular install instead.
|
|
18
18
|
|
|
19
|
-
Pick **at most one** stack flag (default **`--common`** if you omit all
|
|
19
|
+
Pick **at most one** stack flag (default **`--common`** if you omit all five):
|
|
20
20
|
|
|
21
|
-
**`--common` · `--react` · `--next` · `--svelte`**
|
|
21
|
+
**`--common` · `--react` · `--next` · `--svelte` · `--astro`**
|
|
22
22
|
|
|
23
23
|
**After** `npm i -D @st1ggy/linter-config`:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npx @st1ggy/linter-config init
|
|
27
27
|
npx @st1ggy/linter-config init --react
|
|
28
|
-
npx @st1ggy/linter-config
|
|
28
|
+
npx @st1ggy/linter-config migrate --svelte --dir ./apps/web
|
|
29
|
+
npx @st1ggy/linter-config init --astro
|
|
29
30
|
npm exec @st1ggy/linter-config -- init --common
|
|
30
31
|
```
|
|
31
32
|
|
|
@@ -34,25 +35,30 @@ npm exec @st1ggy/linter-config -- init --common
|
|
|
34
35
|
```bash
|
|
35
36
|
npx --yes @st1ggy/linter-config init
|
|
36
37
|
npx --yes @st1ggy/linter-config init --react
|
|
37
|
-
npx --yes @st1ggy/linter-config
|
|
38
|
+
npx --yes @st1ggy/linter-config migrate --svelte --dir ./apps/web
|
|
39
|
+
npx --yes @st1ggy/linter-config init --astro
|
|
38
40
|
```
|
|
39
41
|
|
|
42
|
+
The CLI is interactive in a terminal. Command and stack flags preselect their values, then the wizard confirms the target directory, dependency installation, affected wrapper files, and (for migration) each legacy config file. Pass **`--skip-install`** only when `@st1ggy/linter-config` is already available or will be installed manually.
|
|
43
|
+
|
|
40
44
|
Older **`--eslint`** on the command line is still accepted for compatibility; **`--eslint`** is optional.
|
|
41
45
|
|
|
42
46
|
- **`init` / `create`** — create only missing files (skip existing).
|
|
43
|
-
- **`reinit`** —
|
|
47
|
+
- **`migrate` / `reinit`** — optionally remove selected legacy configs, then overwrite the three wrapper configs.
|
|
44
48
|
|
|
45
|
-
**Legacy filenames** (`.eslintrc.*`, `prettier.config.cjs`, extra copies, …) are
|
|
49
|
+
**Legacy filenames** (`.eslintrc.*`, `prettier.config.cjs`, extra copies, …) are presented one by one by `migrate`; no file is deleted without confirmation. [`scripts/remove-current.sh`](scripts/remove-current.sh) remains available as a standalone cleanup helper.
|
|
46
50
|
|
|
47
51
|
Your project should use **`"type": "module"`** (or `.mjs` config filenames) so the generated ESM re-exports load.
|
|
48
52
|
|
|
49
|
-
In this monorepo, `npm run config:init` / `config:reinit` / `config:create` run **`node ./scripts/linter-init.mjs … --dir ./examples/init-smoke`** (see [`scripts/README.md`](scripts/README.md)). The CLI **refuses** to write consumer stubs in the package root (`package.json` name `@st1ggy/linter-config`) so this repository’s dev configs are not overwritten.
|
|
53
|
+
In this monorepo, `npm run config:init` / `config:migrate` / `config:reinit` / `config:create` run **`node ./scripts/linter-init.mjs … --dir ./examples/init-smoke`** (see [`scripts/README.md`](scripts/README.md)). The CLI **refuses** to write consumer stubs in the package root (`package.json` name `@st1ggy/linter-config`) so this repository’s dev configs are not overwritten.
|
|
50
54
|
|
|
51
55
|
## Subpath imports
|
|
52
56
|
|
|
53
57
|
```js
|
|
54
58
|
import eslintReact from '@st1ggy/linter-config/eslint-react'
|
|
59
|
+
import eslintAstro from '@st1ggy/linter-config/eslint-astro'
|
|
55
60
|
import prettierCommon from '@st1ggy/linter-config/prettier-common'
|
|
61
|
+
import prettierAstro from '@st1ggy/linter-config/prettier-astro'
|
|
56
62
|
import stylelintScss from '@st1ggy/linter-config/stylelint-scss'
|
|
57
63
|
```
|
|
58
64
|
|
|
@@ -62,6 +68,10 @@ The barrel export `@st1ggy/linter-config` re-exports ESLint/Prettier/Stylelint p
|
|
|
62
68
|
|
|
63
69
|
If you previously used Stylelint 16 with this preset, upgrade the consumer to **Stylelint 17** before depending on the latest release.
|
|
64
70
|
|
|
71
|
+
### Migration (v7)
|
|
72
|
+
|
|
73
|
+
**v7** requires **ESLint 10.8+**. Framework integration plugins are optional peers and are installed by the interactive CLI only for the selected stack.
|
|
74
|
+
|
|
65
75
|
### Migration from Biome presets
|
|
66
76
|
|
|
67
77
|
**v6** removes all **`@st1ggy/linter-config/biome`** and **`biome-*`** subpath exports. Use [Biome](https://biomejs.dev/) in your project directly with its own `biome.json`, or stay on ESLint + Prettier + Stylelint via this package.
|
|
@@ -78,6 +88,8 @@ npm run publish:npm
|
|
|
78
88
|
|
|
79
89
|
(`npm publish --access public` — do not use a nested `package.json` for publishing.)
|
|
80
90
|
|
|
91
|
+
Releases are started manually from `Actions` → `Release` → `Run workflow`. It opens or updates a [Release Please](https://github.com/googleapis/release-please) PR with the version bump and generated changelog. Closing that PR without merging ends the release. Merging it triggers a separate workflow run that creates the tag and GitHub Release, checks the package, and publishes it. Release Please automatically creates a PR only for user-facing Conventional Commits (`feat`, `fix`, `perf`, or breaking changes); use the optional `release_as` input with an exact version to force a release for other changes. Configure npm Trusted Publishing for GitHub Actions with repository `St1ggy/linter-config` and workflow `release.yml` before enabling publication.
|
|
92
|
+
|
|
81
93
|
## Toolchain (this repo)
|
|
82
94
|
|
|
83
95
|
There is **one** published package at the **repository root** (no `packages/` workspace layout).
|
|
@@ -98,7 +110,8 @@ npm run lint
|
|
|
98
110
|
| `npm run lint:fix` | Auto-fix ESLint, Stylelint, Prettier |
|
|
99
111
|
| `npm run inventory` | Regenerate [`data/linter-config-inventory.json`](data/linter-config-inventory.json) |
|
|
100
112
|
| `npm run config:init` | `node ./scripts/linter-init.mjs init --common --dir ./examples/init-smoke` (skip existing); see [`scripts/README.md`](scripts/README.md) |
|
|
101
|
-
| `npm run config:
|
|
113
|
+
| `npm run config:migrate` | `migrate` selected legacy configs and overwrite wrappers |
|
|
114
|
+
| `npm run config:reinit` | alias for `config:migrate` |
|
|
102
115
|
| `npm run config:create` | same as `config:init` |
|
|
103
116
|
| `npm run config:remove-current` | interactive: offer to delete `*eslint*` / `*stylelint*` / `*prettier*` files in cwd (see [scripts/remove-current.sh](scripts/remove-current.sh)) |
|
|
104
117
|
|