@nelsonlaidev/oxlint-config 0.3.2 → 1.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 +91 -47
- package/dist/index.d.mts +15 -137
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +843 -1134
- package/dist/index.mjs.map +1 -1
- package/package.json +44 -32
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @nelsonlaidev/oxlint-config
|
|
2
2
|
|
|
3
|
+
[](https://npmx.dev/package/@nelsonlaidev/oxlint-config)
|
|
4
|
+
[](https://npmx.dev/package/@nelsonlaidev/oxlint-config)
|
|
5
|
+
[](https://github.com/nelsonlaidev/config/blob/main/LICENSE)
|
|
6
|
+
|
|
3
7
|
Personal Oxlint configurations for Nelson Lai projects.
|
|
4
8
|
|
|
5
9
|
This package is synced from `eslint-config` and aims to enable every supported Oxlint rule that is also enabled in `eslint-config`.
|
|
@@ -23,13 +27,53 @@ Create an `oxlint.config.ts` file with the following content:
|
|
|
23
27
|
```ts
|
|
24
28
|
import { defineConfig } from '@nelsonlaidev/oxlint-config'
|
|
25
29
|
|
|
30
|
+
export default defineConfig()
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Optional presets are explicit Oxlint overrides. Add only the presets your project uses:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { defineConfig, nextjs, playwright, react, tailwindcss, vitest } from '@nelsonlaidev/oxlint-config'
|
|
37
|
+
|
|
26
38
|
export default defineConfig({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
react: true,
|
|
39
|
+
settings: {
|
|
40
|
+
'better-tailwindcss': {
|
|
41
|
+
entryPoint: './src/globals.css',
|
|
42
|
+
},
|
|
32
43
|
},
|
|
44
|
+
overrides: [
|
|
45
|
+
react(),
|
|
46
|
+
nextjs(),
|
|
47
|
+
tailwindcss(),
|
|
48
|
+
vitest({
|
|
49
|
+
files: ['**/*.test.ts'],
|
|
50
|
+
}),
|
|
51
|
+
playwright({
|
|
52
|
+
files: ['e2e/**/*.spec.ts'],
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
})
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Each preset accepts a native Oxlint override object. Use it to replace `files`, add plugins, or override rules:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
export default defineConfig({
|
|
62
|
+
ignorePatterns: ['generated/**'],
|
|
63
|
+
overrides: [
|
|
64
|
+
react({
|
|
65
|
+
files: ['src/**/*.{js,jsx,ts,tsx}'],
|
|
66
|
+
rules: {
|
|
67
|
+
'@eslint-react/no-array-index-key': 'off',
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
{
|
|
71
|
+
files: ['scripts/**/*.ts'],
|
|
72
|
+
rules: {
|
|
73
|
+
'eslint/no-console': 'off',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
33
77
|
})
|
|
34
78
|
```
|
|
35
79
|
|
|
@@ -37,8 +81,6 @@ export default defineConfig({
|
|
|
37
81
|
|
|
38
82
|
This package follows `eslint-config` as the source of truth. When a rule is enabled there, we enable the corresponding Oxlint rule here when Oxlint supports it.
|
|
39
83
|
|
|
40
|
-
`unused-imports` is intentionally not included. Oxlint's built-in `no-unused-vars` rule with `fix.imports: "safe-fix"` accomplishes the same goal natively.
|
|
41
|
-
|
|
42
84
|
### What's Included
|
|
43
85
|
|
|
44
86
|
This config includes opinionated rules from the following plugins:
|
|
@@ -47,71 +89,73 @@ This config includes opinionated rules from the following plugins:
|
|
|
47
89
|
|
|
48
90
|
- `oxc`
|
|
49
91
|
- `eslint`
|
|
92
|
+
- `command`
|
|
50
93
|
- `typescript`
|
|
51
94
|
- `unicorn`
|
|
52
95
|
- `promise`
|
|
53
96
|
- `node`
|
|
54
97
|
- `jsx-a11y`
|
|
55
|
-
- `import`
|
|
98
|
+
- `import`
|
|
56
99
|
- `jsdoc`
|
|
100
|
+
- `nelsonlaidev`
|
|
57
101
|
- `stylistic`
|
|
58
102
|
- `de-morgan`
|
|
59
103
|
- `zod`
|
|
60
104
|
- `regexp`
|
|
61
105
|
- `sonarjs`
|
|
106
|
+
- `import-sort`
|
|
62
107
|
|
|
63
|
-
####
|
|
108
|
+
#### Optional presets
|
|
64
109
|
|
|
65
|
-
- `react`
|
|
66
|
-
- `nextjs`
|
|
67
|
-
- `vitest`
|
|
68
|
-
- `playwright`
|
|
69
|
-
- `tailwindcss`
|
|
110
|
+
- `react`
|
|
111
|
+
- `nextjs`
|
|
112
|
+
- `vitest`
|
|
113
|
+
- `playwright`
|
|
114
|
+
- `tailwindcss`
|
|
70
115
|
|
|
71
116
|
## Migration Status
|
|
72
117
|
|
|
73
118
|
<!-- sync:report-start -->
|
|
74
119
|
|
|
75
|
-
###
|
|
76
|
-
|
|
77
|
-
| Preset
|
|
78
|
-
|
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `jsdoc/jsdoc/rules` |
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `nextjs/nextjs/rules` |
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
|
|
91
|
-
|
|
120
|
+
### Sync Summary
|
|
121
|
+
|
|
122
|
+
| Preset | Synced | Dropped | Classified | Unclassified | Coverage |
|
|
123
|
+
| ------------------------------------------------- | -----: | ------: | ---------: | -----------: | -------: |
|
|
124
|
+
| `command/nelsonlaidev/command/rules` | 1 | 0 | 0 | 0 | 100.0% |
|
|
125
|
+
| `de-morgan/nelsonlaidev/de-morgan/rules` | 2 | 0 | 0 | 0 | 100.0% |
|
|
126
|
+
| `eslint/nelsonlaidev/javascript/rules` | 93 | 2 | 2 | 0 | 100.0% |
|
|
127
|
+
| `import-sort/nelsonlaidev/import-sort/rules` | 2 | 0 | 0 | 0 | 100.0% |
|
|
128
|
+
| `imports/nelsonlaidev/import-x/rules` | 20 | 6 | 6 | 0 | 84.6% |
|
|
129
|
+
| `jsdoc/nelsonlaidev/jsdoc/rules` | 2 | 0 | 0 | 0 | 100.0% |
|
|
130
|
+
| `jsx-a11y/nelsonlaidev/jsx-a11y/rules` | 35 | 1 | 1 | 0 | 100.0% |
|
|
131
|
+
| `nelsonlaidev/nelsonlaidev/nelsonlaidev/rules` | 5 | 0 | 0 | 0 | 100.0% |
|
|
132
|
+
| `nextjs/nelsonlaidev/nextjs/rules` | 21 | 0 | 0 | 0 | 100.0% |
|
|
133
|
+
| `node/nelsonlaidev/node/rules` | 2 | 4 | 4 | 0 | 50.0% |
|
|
134
|
+
| `playwright/nelsonlaidev/playwright/rules` | 36 | 0 | 0 | 0 | 100.0% |
|
|
135
|
+
| `promise/nelsonlaidev/promise/rules` | 16 | 1 | 1 | 0 | 100.0% |
|
|
136
|
+
| `react/nelsonlaidev/react/rules` | 99 | 2 | 2 | 0 | 100.0% |
|
|
137
|
+
| `regexp/nelsonlaidev/regexp/rules` | 67 | 0 | 0 | 0 | 100.0% |
|
|
138
|
+
| `sonarjs/nelsonlaidev/sonarjs/rules` | 268 | 0 | 0 | 0 | 100.0% |
|
|
139
|
+
| `stylistic/nelsonlaidev/stylistic/rules` | 1 | 0 | 0 | 0 | 100.0% |
|
|
140
|
+
| `tailwindcss/nelsonlaidev/tailwindcss/rules` | 9 | 0 | 0 | 0 | 100.0% |
|
|
141
|
+
| `typescript/nelsonlaidev/typescript/rules` | 117 | 21 | 21 | 0 | 100.0% |
|
|
142
|
+
| `typescript/nelsonlaidev/typescript/declarations` | 2 | 0 | 0 | 0 | 100.0% |
|
|
143
|
+
| `unicorn/nelsonlaidev/unicorn/rules` | 134 | 195 | 195 | 0 | 41.0% |
|
|
144
|
+
| `vitest/nelsonlaidev/vitest/rules` | 20 | 0 | 0 | 0 | 100.0% |
|
|
145
|
+
| `zod/nelsonlaidev/zod/rules` | 1 | 0 | 0 | 0 | 100.0% |
|
|
146
|
+
|
|
147
|
+
### Unclassified Dropped Rules
|
|
148
|
+
|
|
149
|
+
No unclassified dropped rules.
|
|
92
150
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- `regexp`
|
|
96
|
-
- `playwright`
|
|
97
|
-
- `sonarjs`
|
|
98
|
-
- `zod`
|
|
99
|
-
- `command`
|
|
100
|
-
- `stylistic`
|
|
101
|
-
- `de-morgan`
|
|
102
|
-
- `tailwindcss`
|
|
103
|
-
- `react`
|
|
104
|
-
- `nelsonlaidev`
|
|
151
|
+
<!-- sync:report-end -->
|
|
105
152
|
|
|
106
|
-
###
|
|
153
|
+
### Configs Not Migrated
|
|
107
154
|
|
|
108
155
|
| Config | Reason |
|
|
109
156
|
| ------------------- | --------------------------------------------------------------- |
|
|
110
157
|
| `comments.ts` | Plugin that comments out eslint-disable directives |
|
|
111
158
|
| `gitignore.ts` | File-based ignores, handled by Oxlint config |
|
|
112
159
|
| `ignores.ts` | File ignore patterns |
|
|
113
|
-
| `import-sort.ts` | Replaced by Oxlint built-in `import/sort` |
|
|
114
160
|
| `prettier.ts` | Formatting concern, handled by oxfmt |
|
|
115
161
|
| `unused-imports.ts` | Replaced by Oxlint built-in `no-unused-vars` with `fix.imports` |
|
|
116
|
-
|
|
117
|
-
<!-- sync:report-end -->
|
package/dist/index.d.mts
CHANGED
|
@@ -1,144 +1,22 @@
|
|
|
1
|
-
import { OxlintConfig, OxlintConfig as OxlintConfig$1, OxlintOverride } from "oxlint";
|
|
2
|
-
import { Selectors } from "eslint-plugin-better-tailwindcss/types";
|
|
1
|
+
import { OxlintConfig, OxlintConfig as OxlintConfig$1, OxlintOverride, OxlintOverride as OxlintOverride$1 } from "oxlint";
|
|
3
2
|
|
|
4
|
-
//#region src/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A list of glob patterns for your Playwright test files.
|
|
8
|
-
*/
|
|
9
|
-
files: OxlintOverride['files'];
|
|
10
|
-
/**
|
|
11
|
-
* See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md#assertfunctionnames) for more details.
|
|
12
|
-
* @default []
|
|
13
|
-
*/
|
|
14
|
-
assertFunctionNames?: string[];
|
|
15
|
-
/**
|
|
16
|
-
* See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md#assertfunctionpatterns) for more details.
|
|
17
|
-
* @default []
|
|
18
|
-
*/
|
|
19
|
-
assertFunctionPatterns?: string[];
|
|
20
|
-
};
|
|
3
|
+
//#region src/base.d.ts
|
|
4
|
+
declare const defineConfig: (config?: OxlintConfig$1) => OxlintConfig$1;
|
|
21
5
|
//#endregion
|
|
22
|
-
//#region src/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#entrypoint) for more details.
|
|
26
|
-
*/
|
|
27
|
-
entryPoint?: string;
|
|
28
|
-
/**
|
|
29
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tailwindconfig) for more details.
|
|
30
|
-
*/
|
|
31
|
-
tailwindConfig?: string;
|
|
32
|
-
/**
|
|
33
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tsconfig) for more details.
|
|
34
|
-
*/
|
|
35
|
-
tsconfig?: string;
|
|
36
|
-
/**
|
|
37
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#detectcomponentclasses) for more details.
|
|
38
|
-
* @default false
|
|
39
|
-
*/
|
|
40
|
-
detectComponentClasses?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#rootfontsize) for more details.
|
|
43
|
-
* @default 16
|
|
44
|
-
*/
|
|
45
|
-
rootFontSize?: number;
|
|
46
|
-
/**
|
|
47
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#messagestyle) for more details.
|
|
48
|
-
*/
|
|
49
|
-
messageStyle?: 'visual' | 'compact' | 'raw';
|
|
50
|
-
/**
|
|
51
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#selectors) for more details.
|
|
52
|
-
*/
|
|
53
|
-
selectors?: Selectors;
|
|
54
|
-
canonical?: {
|
|
55
|
-
/**
|
|
56
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#collapse) for more details.
|
|
57
|
-
* @default true
|
|
58
|
-
*/
|
|
59
|
-
collapse?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#logical) for more details.
|
|
62
|
-
* @default true
|
|
63
|
-
*/
|
|
64
|
-
logical?: boolean;
|
|
65
|
-
};
|
|
66
|
-
classOrder?: {
|
|
67
|
-
/**
|
|
68
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#order) for more details.
|
|
69
|
-
* @default 'official'
|
|
70
|
-
*/
|
|
71
|
-
order?: 'asc' | 'desc' | 'official' | 'strict';
|
|
72
|
-
/**
|
|
73
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassOrder) for more details.
|
|
74
|
-
* @default 'preserve'
|
|
75
|
-
*/
|
|
76
|
-
componentOrder?: 'asc' | 'desc' | 'preserve';
|
|
77
|
-
/**
|
|
78
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassPosition) for more details.
|
|
79
|
-
* @default 'start'
|
|
80
|
-
*/
|
|
81
|
-
componentPosition?: 'start' | 'end';
|
|
82
|
-
/**
|
|
83
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassOrder) for more details.
|
|
84
|
-
* @default 'preserve'
|
|
85
|
-
*/
|
|
86
|
-
unknownOrder?: 'asc' | 'desc' | 'preserve';
|
|
87
|
-
/**
|
|
88
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassPosition) for more details.
|
|
89
|
-
* @default 'start'
|
|
90
|
-
*/
|
|
91
|
-
unknownPosition?: 'start' | 'end';
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md#restrict) for more details.
|
|
95
|
-
* @default []
|
|
96
|
-
*/
|
|
97
|
-
restrict?: string[] | Array<{
|
|
98
|
-
pattern: string;
|
|
99
|
-
message?: string;
|
|
100
|
-
fix?: string;
|
|
101
|
-
}>;
|
|
102
|
-
/**
|
|
103
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unknown-classes.md#ignore) for more details.
|
|
104
|
-
* @default []
|
|
105
|
-
*/
|
|
106
|
-
ignore?: string[];
|
|
107
|
-
whitespace?: {
|
|
108
|
-
/**
|
|
109
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md#allowMultiline) for more details.
|
|
110
|
-
* @default true
|
|
111
|
-
*/
|
|
112
|
-
allowMultiline?: boolean;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
6
|
+
//#region src/configs/nextjs.d.ts
|
|
7
|
+
declare const nextjs: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
115
8
|
//#endregion
|
|
116
|
-
//#region src/
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* A list of glob patterns for your Vitest test files.
|
|
120
|
-
*/
|
|
121
|
-
files: OxlintOverride['files'];
|
|
122
|
-
};
|
|
9
|
+
//#region src/configs/playwright.d.ts
|
|
10
|
+
declare const playwright: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
123
11
|
//#endregion
|
|
124
|
-
//#region src/
|
|
125
|
-
|
|
126
|
-
nextjs?: boolean;
|
|
127
|
-
react?: boolean;
|
|
128
|
-
tailwindcss?: TailwindCSSConfig;
|
|
129
|
-
vitest?: VitestConfig;
|
|
130
|
-
playwright?: PlaywrightConfig;
|
|
131
|
-
};
|
|
132
|
-
type DefineConfigOptions = {
|
|
133
|
-
config?: OxlintConfig$1;
|
|
134
|
-
custom?: CustomConfig;
|
|
135
|
-
};
|
|
12
|
+
//#region src/configs/react.d.ts
|
|
13
|
+
declare const react: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
136
14
|
//#endregion
|
|
137
|
-
//#region src/
|
|
138
|
-
declare const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
15
|
+
//#region src/configs/tailwindcss.d.ts
|
|
16
|
+
declare const tailwindcss: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/configs/vitest.d.ts
|
|
19
|
+
declare const vitest: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
142
20
|
//#endregion
|
|
143
21
|
//#region src/globs.d.ts
|
|
144
22
|
declare const GLOB_SRC_EXT = "{js,jsx,ts,tsx,cjs,cts,mjs,mts}";
|
|
@@ -148,5 +26,5 @@ declare const GLOB_JSX = "**/*.{jsx,cjsx,mjsx}";
|
|
|
148
26
|
declare const GLOB_TS = "**/*.{ts,cts,mts}";
|
|
149
27
|
declare const GLOB_TSX = "**/*.{tsx,ctsx,mtsx}";
|
|
150
28
|
//#endregion
|
|
151
|
-
export {
|
|
29
|
+
export { GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, type OxlintConfig, type OxlintOverride, defineConfig, nextjs, playwright, react, tailwindcss, vitest };
|
|
152
30
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/base.ts","../src/configs/nextjs.ts","../src/configs/playwright.ts","../src/configs/react.ts","../src/configs/tailwindcss.ts","../src/configs/vitest.ts","../src/globs.ts"],"mappings":";;;cAsBa,YAAA,GAAgB,MAAA,GAAQ,cAAA,KAAoB,cAAA;;;cCd5C,MAAA,GAAU,OAAA,GAAS,OAAA,CAAQ,gBAAA,MAAuB,gBAAA;;;cCAlD,UAAA,GAAc,OAAA,GAAS,OAAA,CAAQ,gBAAA,MAAuB,gBAAA;;;cCAtD,KAAA,GAAS,OAAA,GAAS,OAAA,CAAQ,gBAAA,MAAuB,gBAAA;;;cCAjD,WAAA,GAAe,OAAA,GAAS,OAAA,CAAQ,gBAAA,MAAuB,gBAAA;;;cCAvD,MAAA,GAAU,OAAA,GAAS,OAAA,CAAQ,gBAAA,MAAuB,gBAAA;;;cCRlD,YAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA"}
|