@nelsonlaidev/oxlint-config 0.4.0 → 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 +55 -15
- package/dist/index.d.mts +15 -141
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +327 -336
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @nelsonlaidev/oxlint-config
|
|
2
2
|
|
|
3
|
-
[](https://npmx.dev/package/@nelsonlaidev/oxlint-config)
|
|
4
|
+
[](https://npmx.dev/package/@nelsonlaidev/oxlint-config)
|
|
5
5
|
[](https://github.com/nelsonlaidev/config/blob/main/LICENSE)
|
|
6
6
|
|
|
7
7
|
Personal Oxlint configurations for Nelson Lai projects.
|
|
@@ -27,13 +27,53 @@ Create an `oxlint.config.ts` file with the following content:
|
|
|
27
27
|
```ts
|
|
28
28
|
import { defineConfig } from '@nelsonlaidev/oxlint-config'
|
|
29
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
|
+
|
|
30
38
|
export default defineConfig({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
react: true,
|
|
39
|
+
settings: {
|
|
40
|
+
'better-tailwindcss': {
|
|
41
|
+
entryPoint: './src/globals.css',
|
|
42
|
+
},
|
|
36
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
|
+
],
|
|
37
77
|
})
|
|
38
78
|
```
|
|
39
79
|
|
|
@@ -65,13 +105,13 @@ This config includes opinionated rules from the following plugins:
|
|
|
65
105
|
- `sonarjs`
|
|
66
106
|
- `import-sort`
|
|
67
107
|
|
|
68
|
-
####
|
|
108
|
+
#### Optional presets
|
|
69
109
|
|
|
70
|
-
- `react`
|
|
71
|
-
- `nextjs`
|
|
72
|
-
- `vitest`
|
|
73
|
-
- `playwright`
|
|
74
|
-
- `tailwindcss`
|
|
110
|
+
- `react`
|
|
111
|
+
- `nextjs`
|
|
112
|
+
- `vitest`
|
|
113
|
+
- `playwright`
|
|
114
|
+
- `tailwindcss`
|
|
75
115
|
|
|
76
116
|
## Migration Status
|
|
77
117
|
|
|
@@ -93,11 +133,11 @@ This config includes opinionated rules from the following plugins:
|
|
|
93
133
|
| `node/nelsonlaidev/node/rules` | 2 | 4 | 4 | 0 | 50.0% |
|
|
94
134
|
| `playwright/nelsonlaidev/playwright/rules` | 36 | 0 | 0 | 0 | 100.0% |
|
|
95
135
|
| `promise/nelsonlaidev/promise/rules` | 16 | 1 | 1 | 0 | 100.0% |
|
|
96
|
-
| `react/nelsonlaidev/react/rules` | 99 |
|
|
136
|
+
| `react/nelsonlaidev/react/rules` | 99 | 2 | 2 | 0 | 100.0% |
|
|
97
137
|
| `regexp/nelsonlaidev/regexp/rules` | 67 | 0 | 0 | 0 | 100.0% |
|
|
98
138
|
| `sonarjs/nelsonlaidev/sonarjs/rules` | 268 | 0 | 0 | 0 | 100.0% |
|
|
99
139
|
| `stylistic/nelsonlaidev/stylistic/rules` | 1 | 0 | 0 | 0 | 100.0% |
|
|
100
|
-
| `tailwindcss/nelsonlaidev/tailwindcss/rules` |
|
|
140
|
+
| `tailwindcss/nelsonlaidev/tailwindcss/rules` | 9 | 0 | 0 | 0 | 100.0% |
|
|
101
141
|
| `typescript/nelsonlaidev/typescript/rules` | 117 | 21 | 21 | 0 | 100.0% |
|
|
102
142
|
| `typescript/nelsonlaidev/typescript/declarations` | 2 | 0 | 0 | 0 | 100.0% |
|
|
103
143
|
| `unicorn/nelsonlaidev/unicorn/rules` | 134 | 195 | 195 | 0 | 41.0% |
|
package/dist/index.d.mts
CHANGED
|
@@ -1,148 +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#cwd) for more details.
|
|
38
|
-
*/
|
|
39
|
-
cwd?: string;
|
|
40
|
-
/**
|
|
41
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#detectcomponentclasses) for more details.
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
detectComponentClasses?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#rootfontsize) for more details.
|
|
47
|
-
* @default 16
|
|
48
|
-
*/
|
|
49
|
-
rootFontSize?: number;
|
|
50
|
-
/**
|
|
51
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#messagestyle) for more details.
|
|
52
|
-
*/
|
|
53
|
-
messageStyle?: 'visual' | 'compact' | 'raw';
|
|
54
|
-
/**
|
|
55
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#selectors) for more details.
|
|
56
|
-
*/
|
|
57
|
-
selectors?: Selectors;
|
|
58
|
-
canonical?: {
|
|
59
|
-
/**
|
|
60
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#collapse) for more details.
|
|
61
|
-
* @default true
|
|
62
|
-
*/
|
|
63
|
-
collapse?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#logical) for more details.
|
|
66
|
-
* @default true
|
|
67
|
-
*/
|
|
68
|
-
logical?: boolean;
|
|
69
|
-
};
|
|
70
|
-
classOrder?: {
|
|
71
|
-
/**
|
|
72
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#order) for more details.
|
|
73
|
-
* @default 'official'
|
|
74
|
-
*/
|
|
75
|
-
order?: 'asc' | 'desc' | 'official' | 'strict';
|
|
76
|
-
/**
|
|
77
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassOrder) for more details.
|
|
78
|
-
* @default 'preserve'
|
|
79
|
-
*/
|
|
80
|
-
componentOrder?: 'asc' | 'desc' | 'preserve';
|
|
81
|
-
/**
|
|
82
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassPosition) for more details.
|
|
83
|
-
* @default 'start'
|
|
84
|
-
*/
|
|
85
|
-
componentPosition?: 'start' | 'end';
|
|
86
|
-
/**
|
|
87
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassOrder) for more details.
|
|
88
|
-
* @default 'preserve'
|
|
89
|
-
*/
|
|
90
|
-
unknownOrder?: 'asc' | 'desc' | 'preserve';
|
|
91
|
-
/**
|
|
92
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassPosition) for more details.
|
|
93
|
-
* @default 'start'
|
|
94
|
-
*/
|
|
95
|
-
unknownPosition?: 'start' | 'end';
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md#restrict) for more details.
|
|
99
|
-
* @default []
|
|
100
|
-
*/
|
|
101
|
-
restrict?: string[] | Array<{
|
|
102
|
-
pattern: string;
|
|
103
|
-
message?: string;
|
|
104
|
-
fix?: string;
|
|
105
|
-
}>;
|
|
106
|
-
/**
|
|
107
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unknown-classes.md#ignore) for more details.
|
|
108
|
-
* @default []
|
|
109
|
-
*/
|
|
110
|
-
ignore?: string[];
|
|
111
|
-
whitespace?: {
|
|
112
|
-
/**
|
|
113
|
-
* See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md#allowMultiline) for more details.
|
|
114
|
-
* @default true
|
|
115
|
-
*/
|
|
116
|
-
allowMultiline?: boolean;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
6
|
+
//#region src/configs/nextjs.d.ts
|
|
7
|
+
declare const nextjs: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
119
8
|
//#endregion
|
|
120
|
-
//#region src/
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* A list of glob patterns for your Vitest test files.
|
|
124
|
-
*/
|
|
125
|
-
files: OxlintOverride['files'];
|
|
126
|
-
};
|
|
9
|
+
//#region src/configs/playwright.d.ts
|
|
10
|
+
declare const playwright: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
127
11
|
//#endregion
|
|
128
|
-
//#region src/
|
|
129
|
-
|
|
130
|
-
nextjs?: boolean;
|
|
131
|
-
react?: boolean;
|
|
132
|
-
tailwindcss?: TailwindCSSConfig;
|
|
133
|
-
vitest?: VitestConfig;
|
|
134
|
-
playwright?: PlaywrightConfig;
|
|
135
|
-
};
|
|
136
|
-
type DefineConfigOptions = {
|
|
137
|
-
config?: OxlintConfig$1;
|
|
138
|
-
custom?: CustomConfig;
|
|
139
|
-
};
|
|
12
|
+
//#region src/configs/react.d.ts
|
|
13
|
+
declare const react: (options?: Partial<OxlintOverride$1>) => OxlintOverride$1;
|
|
140
14
|
//#endregion
|
|
141
|
-
//#region src/
|
|
142
|
-
declare const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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;
|
|
146
20
|
//#endregion
|
|
147
21
|
//#region src/globs.d.ts
|
|
148
22
|
declare const GLOB_SRC_EXT = "{js,jsx,ts,tsx,cjs,cts,mjs,mts}";
|
|
@@ -152,5 +26,5 @@ declare const GLOB_JSX = "**/*.{jsx,cjsx,mjsx}";
|
|
|
152
26
|
declare const GLOB_TS = "**/*.{ts,cts,mts}";
|
|
153
27
|
declare const GLOB_TSX = "**/*.{tsx,ctsx,mtsx}";
|
|
154
28
|
//#endregion
|
|
155
|
-
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 };
|
|
156
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"}
|