@st1ggy/linter-config 7.4.0 → 8.0.0

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
@@ -1,6 +1,6 @@
1
1
  # st1ggy/linter-config
2
2
 
3
- Single npm package **`@st1ggy/linter-config`** with **subpath exports**. Config sources live under [`src/`](src/) (ESLint, Oxlint, Prettier, Stylelint).
3
+ Single npm package **`@st1ggy/linter-config`** with **subpath exports**. Config sources live under [`src/`](src/) (ESLint, Oxlint, Oxfmt, Prettier, Stylelint).
4
4
 
5
5
  Install once:
6
6
 
@@ -8,11 +8,11 @@ Install once:
8
8
  npm i -D @st1ggy/linter-config
9
9
  ```
10
10
 
11
- Oxlint engines and framework-specific plugins are optional peers. The wizard installs the selected stack's engines and integration plugins as dev dependencies.
11
+ Oxlint/Oxfmt engines and framework-specific plugins are optional peers. The wizard installs the selected stack's engines and integration plugins as dev dependencies.
12
12
 
13
13
  ### Generate local wrapper configs
14
14
 
15
- The published CLI is invoked as **`@st1ggy/linter-config`** (see [`package.json`](package.json) `bin`). Each run writes **`eslint.config.js`** for an ESLint stack or **`oxlint.config.ts`** for an Oxlint stack, plus **`prettier.config.js`** and **`stylelint.config.js`** as re-exports for the selected stack.
15
+ The published CLI is invoked as **`@st1ggy/linter-config`** (see [`package.json`](package.json) `bin`). Each run writes a linter config, a formatter config and **`stylelint.config.js`** as re-exports for the selected stack. ESLint stacks use **`eslint.config.js`** and **`prettier.config.js`**. Common/React/Solid/Next Oxlint stacks use **`oxlint.config.ts`** and **`oxfmt.config.ts`**; Svelte/Astro Oxlint stacks use **`oxlint.config.ts`** and **`prettier.config.js`**.
16
16
 
17
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
 
@@ -51,7 +51,7 @@ Older **`--eslint`** on the command line is still accepted for compatibility; **
51
51
  - **`init` / `create`** — create only missing files (skip existing).
52
52
  - **`migrate` / `reinit`** — optionally remove selected legacy configs, then overwrite the selected stack's three wrapper configs.
53
53
 
54
- **Legacy filenames** (`.eslintrc.*`, `.oxlintrc.*`, `prettier.config.cjs`, extra copies, …) are presented one by one by `migrate`; no file is deleted without confirmation. Changing engines offers the other engine's config for removal during migration. [`scripts/remove-current.sh`](scripts/remove-current.sh) remains available as a standalone cleanup helper.
54
+ **Legacy filenames** (`.eslintrc.*`, `.oxlintrc.*`, `.oxfmtrc.*`, `prettier.config.cjs`, extra copies, …) are presented one by one by `migrate`; no file is deleted without confirmation. Changing engines offers the other linter and formatter configs for removal during migration. [`scripts/remove-current.sh`](scripts/remove-current.sh) remains available as a standalone cleanup helper.
55
55
 
56
56
  Your project should use **`"type": "module"`** (or `.mjs` config filenames) so the generated ESM re-exports load.
57
57
 
@@ -95,18 +95,18 @@ If you previously used Stylelint 16 with this preset, upgrade the consumer to **
95
95
 
96
96
  Each existing stack has an Oxlint counterpart. The new configs are objects typed as `OxlintConfig`; the existing ESLint configs remain flat-config arrays.
97
97
 
98
- | Stack flag | Config import | Prettier | Stylelint |
98
+ | Stack flag | Config import | Formatter | Stylelint |
99
99
  | ------------- | --------------------------------- | ----------------- | ---------------- |
100
- | `--common-ox` | `@st1ggy/linter-config/common-ox` | `prettier-common` | `stylelint-scss` |
101
- | `--react-ox` | `@st1ggy/linter-config/react-ox` | `prettier-common` | `stylelint-scss` |
102
- | `--solid-ox` | `@st1ggy/linter-config/solid-ox` | `prettier-common` | `stylelint-scss` |
103
- | `--next-ox` | `@st1ggy/linter-config/next-ox` | `prettier-common` | `stylelint-scss` |
100
+ | `--common-ox` | `@st1ggy/linter-config/common-ox` | `oxfmt-common` | `stylelint-scss` |
101
+ | `--react-ox` | `@st1ggy/linter-config/react-ox` | `oxfmt-common` | `stylelint-scss` |
102
+ | `--solid-ox` | `@st1ggy/linter-config/solid-ox` | `oxfmt-common` | `stylelint-scss` |
103
+ | `--next-ox` | `@st1ggy/linter-config/next-ox` | `oxfmt-common` | `stylelint-scss` |
104
104
  | `--svelte-ox` | `@st1ggy/linter-config/svelte-ox` | `prettier-svelte` | `stylelint-scss` |
105
105
  | `--astro-ox` | `@st1ggy/linter-config/astro-ox` | `prettier-astro` | `stylelint-scss` |
106
106
 
107
107
  ### Install and run
108
108
 
109
- The checked engine versions are **Oxlint 1.86.0** and **oxlint-tsgolint 7.0.2003**, with native TypeScript 7 typed analysis. Use **Node.js 24.16.0+**. JS-plugin compatibility and the rule inventory are checked against these versions; the CLI installs the engines with exact versions.
109
+ The checked engine versions are **Oxlint 1.86.0**, **oxlint-tsgolint 7.0.2003**, and **Oxfmt 0.71.0**, with native TypeScript 7 typed analysis. Use **Node.js 24.16.0+**. JS-plugin compatibility and the rule inventory are checked against these versions; the CLI installs the selected engines with exact versions.
110
110
 
111
111
  ```bash
112
112
  npx @st1ggy/linter-config init --solid-ox
@@ -116,7 +116,7 @@ For manual Solid installation:
116
116
 
117
117
  ```bash
118
118
  npm i -D @st1ggy/linter-config eslint-plugin-solid
119
- npm i -D --save-exact oxlint@1.86.0 oxlint-tsgolint@7.0.2003
119
+ npm i -D --save-exact oxlint@1.86.0 oxlint-tsgolint@7.0.2003 oxfmt@0.71.0
120
120
  ```
121
121
 
122
122
  ```ts
@@ -124,12 +124,19 @@ npm i -D --save-exact oxlint@1.86.0 oxlint-tsgolint@7.0.2003
124
124
  export { default } from '@st1ggy/linter-config/solid-ox'
125
125
  ```
126
126
 
127
+ ```ts
128
+ // oxfmt.config.ts
129
+ export { default } from '@st1ggy/linter-config/oxfmt-common'
130
+ ```
131
+
127
132
  ```bash
128
133
  npx oxlint .
134
+ npx oxfmt --check .
129
135
  # Also report TypeScript errors:
130
136
  npx oxlint --type-aware --type-check .
131
- # Fix supported lint violations:
137
+ # Fix supported lint violations, then format:
132
138
  npx oxlint --fix .
139
+ npx oxfmt --write .
133
140
  ```
134
141
 
135
142
  Oxlint auto-discovers `oxlint.config.ts` and the applicable `tsconfig.json`. Remove options deleted in TypeScript 7, including `baseUrl`; make `paths` relative to the config instead. For Solid JSX, use `"jsx": "preserve"` and `"jsxImportSource": "solid-js"`. The wizard writes wrappers and installs integrations; it does not edit your tsconfig or package scripts.
@@ -147,7 +154,27 @@ export default defineConfig({
147
154
  })
148
155
  ```
149
156
 
150
- Prettier and Stylelint remain the format/style tools, with the existing framework plugins for Svelte and Astro. Oxlint also executes the compatible Prettier JS rule for ordinary JS/TS files. Re-run formatting if overlapping lint fixes leave formatting diagnostics.
157
+ ### Oxfmt formatting
158
+
159
+ `common-ox`, `react-ox`, `solid-ox` and `next-ox` use Oxfmt for formatting. Their lint configs do not load `eslint-plugin-prettier` or execute `prettier/prettier`; run the formatter check alongside linting in CI. The generated `oxfmt.config.ts` imports `@st1ggy/linter-config/oxfmt-common` and is discovered automatically.
160
+
161
+ The shared config preserves the common style: 120-column width, two-space indentation, single quotes, no semicolons, trailing commas, LF and a final newline. **Import sorting and package.json sorting are explicitly disabled**; the current import lint rules retain control of import order. `.gitignore` and `.prettierignore` are respected during directory traversal. Oxfmt can format an explicitly named gitignored file; for deliberate exclusions, use `.prettierignore` or `ignorePatterns`.
162
+
163
+ Override options by spreading the shared object:
164
+
165
+ ```ts
166
+ import config from '@st1ggy/linter-config/oxfmt-common'
167
+ import { defineConfig } from 'oxfmt'
168
+
169
+ export default defineConfig({
170
+ ...config,
171
+ ignorePatterns: [...(config.ignorePatterns ?? []), 'dist/**'],
172
+ })
173
+ ```
174
+
175
+ `init` keeps an existing `prettier.config.js`; use `migrate` to offer it for removal when switching to Oxfmt. The wizard does not update consumer package scripts. A typical script pair is `"lint": "oxlint ."` and `"format:check": "oxfmt --check ."`.
176
+
177
+ Svelte/Astro and the original ESLint stacks keep their existing Prettier configs and plugins. Stylelint remains the style-rule tool for every stack. Prettier also remains a dependency for those integrations and this repository's generation/legacy checks.
151
178
 
152
179
  ### Rule coverage
153
180
 
@@ -161,7 +188,17 @@ These are **maximum-feasible migrations, with documented gaps**, rather than ful
161
188
  - Compiler configuration-dependent guards are kept, but default-configuration control fixtures do not count as positive violation evidence.
162
189
  - Existing `eslint-disable` directives do not automatically retain their meaning after rule namespaces change. Use Oxlint directives with the migrated IDs and check `--report-unused-disable-directives` when migrating.
163
190
 
164
- See [the generated rule mapping](docs/OXLINT_RULE_MAPPING.md) for counts and every partial/unsupported mapping. The full source scopes, rule options and evidence references are in `data/oxlint-*.json`; development tests keep paired source/target fixtures outside the published tarball.
191
+ See [the generated rule mapping](docs/OXLINT_RULE_MAPPING.md) for counts and every partial/unsupported mapping. The migrated formatting check is accounted for with status `formatter`, not silently disabled. The full source scopes, rule options and evidence references are in `data/oxlint-*.json`; development tests keep paired source/target fixtures outside the published tarball.
192
+
193
+ ### Migration (v8: native formatter)
194
+
195
+ `common-ox`, `react-ox`, `solid-ox` and `next-ox` use Oxfmt instead of Prettier. Their Oxlint command no longer checks formatting. To upgrade a consumer from v7:
196
+
197
+ 1. Run the wizard with `migrate --<stack>-ox` and select the old formatter config for removal, or install `oxfmt@0.71.0` and create `oxfmt.config.ts` importing `@st1ggy/linter-config/oxfmt-common` manually.
198
+ 2. Add `oxfmt --check .` alongside `oxlint .` in CI; replace the old `prettier --check .` command for that stack.
199
+ 3. Run `oxlint --fix .` followed by `oxfmt --write .` when applying fixes, and review consumer-specific formatter overrides.
200
+
201
+ Svelte/Astro Oxlint stacks and the original ESLint stacks retain their Prettier workflow.
165
202
 
166
203
  ### Migration (v7)
167
204
 
@@ -187,7 +224,7 @@ Releases are started manually from `Actions` → `Release` → `Run workflow`. I
187
224
 
188
225
  ## Toolchain (this repo)
189
226
 
190
- The `CI` GitHub Actions workflow runs linting, the original Solid tests, Oxlint tests, explicit TS6 and native TS7 checks, inventory/generated-config checks, and packed-package smoke tests on pushes to `main` and pull requests. It checks Node.js `24.16.0` and `latest`, and installs tarballs with npm and isolated pnpm. The `Release` workflow runs these checks before publishing as well.
227
+ The `CI` GitHub Actions workflow runs linting, the original Solid tests, Oxlint/Oxfmt tests, explicit TS6 and native TS7 checks, inventory/generated-config checks, and packed-package smoke tests on pushes to `main` and pull requests. It checks Node.js `24.16.0` and `latest`, and installs tarballs with npm and isolated pnpm. A separate `format:ox:check` validates formatting with Oxfmt. The `Release` workflow runs these checks before publishing as well.
191
228
 
192
229
  There is **one** published package at the **repository root** (no `packages/` workspace layout).
193
230
 
@@ -204,6 +241,8 @@ npm run lint
204
241
  | `npm run lint:eslint` | ESLint only |
205
242
  | `npm run lint:stylelint` | Stylelint only |
206
243
  | `npm run lint:prettier` | Prettier `--check` only |
244
+ | `npm run format:ox:check` | Check repository formatting with the shared Oxfmt options |
245
+ | `npm run format:ox:compare` | Compare Oxfmt and Prettier on sources and rule fixtures without rewriting files |
207
246
  | `npm run lint:fix` | Auto-fix ESLint, Stylelint, Prettier |
208
247
  | `npm run inventory` | Regenerate [`data/linter-config-inventory.json`](data/linter-config-inventory.json) |
209
248
  | `node --test scripts/solid-config.test.mjs` | Check Solid JSX/TSX linting and wrapper generation |