@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 CHANGED
@@ -8,24 +8,25 @@ Install once:
8
8
  npm i -D @st1ggy/linter-config
9
9
  ```
10
10
 
11
- Add **`eslint`**, **`prettier`**, **`stylelint`**, and framework peers only for the stacks you use (see `peerDependencies` in [`package.json`](package.json)).
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 and **`@st1ggy/linter-config`** is not yet resolvable from **`node_modules`** (search walks up to the filesystem root, for hoisted monorepos), the CLI runs the detected package manager (**npm** / **pnpm** / **yarn** / **bun** from the nearest lockfile) to **`add -D @st1ggy/linter-config`** or **`install`** when the dependency is already listed but `node_modules` is missing.
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 four):
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 reinit --svelte --dir ./apps/web
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 reinit --svelte --dir ./apps/web
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`** — overwrite the three wrapper configs (same names; nothing to delete first).
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 **not** removed by `init` / `reinit`. For an **interactive** cleanup in the project root, use [`scripts/remove-current.sh`](scripts/remove-current.sh) (published inside the package under `scripts/`). In this repo: `npm run config:remove-current`. Run it **before** `init` / `reinit` if you need to drop stray configs; it is intentionally **not** wired into `reinit` so CI stays non-interactive.
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:reinit` | same target, overwrite |
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