@2digits/oxlint-config 2.2.0 → 3.0.1
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 +22 -2
- package/dist/index.d.mts +43 -2105
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
- package/dist/base-CUaU9L_u.mjs +0 -2
- package/dist/base-CUaU9L_u.mjs.map +0 -1
- package/dist/base.d.mts +0 -640
- package/dist/base.d.mts.map +0 -1
- package/dist/base.mjs +0 -1
- package/dist/preset-B73MT85O.mjs +0 -2
- package/dist/preset-B73MT85O.mjs.map +0 -1
- package/dist/typescript-DX_e9mbo.mjs +0 -2
- package/dist/typescript-DX_e9mbo.mjs.map +0 -1
- package/dist/typescript.d.mts +0 -421
- package/dist/typescript.d.mts.map +0 -1
- package/dist/typescript.mjs +0 -1
package/README.md
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
# @2digits/oxlint-config
|
|
2
2
|
|
|
3
|
+
Like `@2digits/eslint-config`, the default export `twoDigits(options, ...userConfigs)` builds the config from named
|
|
4
|
+
[oxlint-flat-config](https://github.com/liangmiQwQ/oxlint-flat-config) objects (`2digits:javascript`,
|
|
5
|
+
`2digits:typescript/rules`, ...). The `ts`, `react`, `vitest` and `zod` configs are enabled when their package is
|
|
6
|
+
installed, and accept `overrides` for their rules. Your flat config objects apply after the built-in ones; later objects
|
|
7
|
+
win, like ESLint:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { twoDigits } from '@2digits/oxlint-config';
|
|
11
|
+
|
|
12
|
+
export default twoDigits(
|
|
13
|
+
{
|
|
14
|
+
ignores: { ignores: ['generated/**'] },
|
|
15
|
+
react: true,
|
|
16
|
+
vitest: { files: ['**/*.check.ts'] },
|
|
17
|
+
},
|
|
18
|
+
{ options: { reportUnusedDisableDirectives: 'allow' } },
|
|
19
|
+
{ files: ['scripts/**'], rules: { 'no-console': 'off' } },
|
|
20
|
+
);
|
|
21
|
+
```
|
|
22
|
+
|
|
3
23
|
The default preset enables `2digits/padding-line-between-statements`: statements require a blank line between them,
|
|
4
24
|
including variable declarations, control flow, and returns. Consecutive imports may stay grouped; existing import
|
|
5
25
|
group spacing is preserved. Run Oxlint with `--fix` to insert missing blank lines.
|
|
6
26
|
|
|
7
|
-
Override the rule through `
|
|
27
|
+
Override the rule through `twoDigits({}, { rules: { '2digits/padding-line-between-statements': 'off' } })`, or supply your own
|
|
8
28
|
spacing policies in its rule options.
|
|
9
29
|
|
|
10
30
|
The shared preset keeps `capitalized-comments` enabled for ordinary prose, but preserves case-sensitive
|
|
11
31
|
`fallow-ignore` suppression directives, including `fallow-ignore-next-line` and `fallow-ignore-file`.
|
|
12
32
|
The exception matches the directive family at the start of a comment; prose mentioning a directive remains checked.
|
|
13
33
|
|
|
14
|
-
The native autofix regression loads the built default export (`
|
|
34
|
+
The native autofix regression loads the built default export (`twoDigits()`) without consumer overrides and checks both
|
|
15
35
|
directive spellings byte-for-byte after two autofix passes. It also verifies lowercase prose is reported and fixed,
|
|
16
36
|
already capitalized prose is unchanged, and similarly named prose is still fixed.
|
|
17
37
|
|