@4mbl/lint 0.0.0-alpha.b43b96d → 0.0.0-alpha.b4b5886
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/CHANGELOG.md +106 -0
- package/bin/cli.js +31 -3
- package/dist/base.d.ts +38 -8
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +17 -2
- package/dist/base.js.map +1 -1
- package/dist/next.d.ts +542 -2
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +49 -37
- package/dist/next.js.map +1 -1
- package/dist/node.d.ts +53 -9
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +12 -2
- package/dist/node.js.map +1 -1
- package/dist/react.d.ts +63 -19
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +21 -7
- package/dist/react.js.map +1 -1
- package/package.json +6 -9
package/dist/next.js
CHANGED
|
@@ -2,50 +2,62 @@ import path from 'node:path';
|
|
|
2
2
|
import process from 'node:process';
|
|
3
3
|
import { defineConfig } from 'oxlint';
|
|
4
4
|
import { reactConfig } from './react.js';
|
|
5
|
-
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
6
5
|
const DEFAULT_OPTIONS = { uiPath: 'src/components/ui/' };
|
|
7
6
|
function nextConfig(options) {
|
|
8
7
|
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
8
|
+
const react = reactConfig(options);
|
|
9
9
|
return defineConfig({
|
|
10
|
-
extends: [
|
|
11
|
-
plugins: ['nextjs'],
|
|
10
|
+
extends: [react],
|
|
11
|
+
plugins: [...react.plugins, 'nextjs'],
|
|
12
12
|
rules: {
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
},
|
|
34
|
-
ignorePatterns: ['.next/**', 'out/**', 'build/**', 'next-env.d.ts'],
|
|
35
|
-
overrides: [
|
|
13
|
+
'nextjs/google-font-display': 'warn',
|
|
14
|
+
'nextjs/google-font-preconnect': 'warn',
|
|
15
|
+
'nextjs/next-script-for-ga': 'warn',
|
|
16
|
+
'nextjs/no-async-client-component': 'warn',
|
|
17
|
+
'nextjs/no-before-interactive-script-outside-document': 'warn',
|
|
18
|
+
'nextjs/no-css-tags': 'warn',
|
|
19
|
+
'nextjs/no-head-element': 'warn',
|
|
20
|
+
'nextjs/no-html-link-for-pages': 'error',
|
|
21
|
+
'nextjs/no-page-custom-font': 'warn',
|
|
22
|
+
'nextjs/no-styled-jsx-in-document': 'warn',
|
|
23
|
+
'nextjs/no-sync-scripts': 'error',
|
|
24
|
+
'nextjs/no-title-in-document-head': 'warn',
|
|
25
|
+
'nextjs/no-typos': 'warn',
|
|
26
|
+
'nextjs/no-unwanted-polyfillio': 'warn',
|
|
27
|
+
'nextjs/inline-script-id': 'error',
|
|
28
|
+
'nextjs/no-assign-module-variable': 'error',
|
|
29
|
+
'nextjs/no-document-import-in-page': 'error',
|
|
30
|
+
'nextjs/no-duplicate-head': 'error',
|
|
31
|
+
'nextjs/no-head-import-in-document': 'error',
|
|
32
|
+
'nextjs/no-script-component-in-head': 'error',
|
|
36
33
|
// ignores warnings for special exports in page and layout files
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
'react/only-export-components': [
|
|
35
|
+
'warn',
|
|
36
|
+
{
|
|
37
|
+
// https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/main/src/index.ts
|
|
38
|
+
allowExportNames: [
|
|
39
|
+
// removed in next@16.0.0: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#version-history
|
|
40
|
+
// 'experimental_ppr',
|
|
41
|
+
'dynamic',
|
|
42
|
+
'dynamicParams',
|
|
43
|
+
'revalidate',
|
|
44
|
+
'fetchCache',
|
|
45
|
+
'runtime',
|
|
46
|
+
'preferredRegion',
|
|
47
|
+
'maxDuration',
|
|
48
|
+
'metadata',
|
|
49
|
+
'generateMetadata',
|
|
50
|
+
'viewport',
|
|
51
|
+
'generateViewport',
|
|
52
|
+
'generateImageMetadata',
|
|
53
|
+
'generateSitemaps',
|
|
54
|
+
'generateStaticParams',
|
|
46
55
|
],
|
|
47
56
|
},
|
|
48
|
-
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
ignorePatterns: ['.next/**', 'out/**', 'build/**', 'next-env.d.ts'],
|
|
60
|
+
overrides: [
|
|
49
61
|
opts.uiPath === null
|
|
50
62
|
? { files: [], rules: {} }
|
|
51
63
|
: {
|
|
@@ -53,7 +65,7 @@ function nextConfig(options) {
|
|
|
53
65
|
`${path.resolve(process.cwd(), opts.uiPath)}/**/*.{js,jsx,mjs,ts,tsx,mts,cts}`.replaceAll('//', '/'),
|
|
54
66
|
],
|
|
55
67
|
rules: {
|
|
56
|
-
'react
|
|
68
|
+
'react/only-export-components': 'off',
|
|
57
69
|
},
|
|
58
70
|
},
|
|
59
71
|
],
|
package/dist/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAqB,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM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B,aAAa;wBACb,UAAU;wBACV,kBAAkB;wBAClB,UAAU;wBACV,kBAAkB;wBAClB,uBAAuB;wBACvB,kBAAkB;wBAClB,sBAAsB;qBACvB;iBACF;aACF;SACF;QACD,cAAc,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,CAAC;QACnE,SAAS,EAAE;YACT,IAAI,CAAC,MAAM,KAAK,IAAI;gBAClB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;gBAC1B,CAAC,CAAC;oBACE,KAAK,EAAE;wBACL,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,mCAAmC,CAAC,UAAU,CACvF,IAAI,EACJ,GAAG,CACJ;qBACF;oBACD,KAAK,EAAE;wBACL,8BAA8B,EAAE,KAAK;qBACtC;iBACF;SACN;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAqB,YAAY,EAAE,UAAU,EAAE,CAAC;AAEvD,eAAe,UAAU,EAAE,CAAC"}
|
package/dist/node.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineConfig, type OxlintConfig } from 'oxlint';
|
|
2
2
|
type NodeOptions = {};
|
|
3
|
-
declare function nodeConfig(
|
|
3
|
+
declare function nodeConfig(options?: Partial<NodeOptions>): {
|
|
4
4
|
extends: {
|
|
5
|
-
plugins: ("
|
|
5
|
+
plugins: ("import" | "typescript" | "unicorn")[];
|
|
6
6
|
jsPlugins: never[];
|
|
7
7
|
categories: {
|
|
8
8
|
correctness: "error";
|
|
@@ -18,6 +18,7 @@ declare function nodeConfig(_options?: Partial<NodeOptions>): {
|
|
|
18
18
|
};
|
|
19
19
|
options: {
|
|
20
20
|
typeAware: true;
|
|
21
|
+
typeCheck: true;
|
|
21
22
|
};
|
|
22
23
|
rules: {
|
|
23
24
|
'eslint/no-var': "warn";
|
|
@@ -92,7 +93,7 @@ declare function nodeConfig(_options?: Partial<NodeOptions>): {
|
|
|
92
93
|
'typescript/prefer-as-const': "error";
|
|
93
94
|
'typescript/triple-slash-reference': "error";
|
|
94
95
|
'typescript/explicit-member-accessibility': ["warn", {
|
|
95
|
-
accessibility:
|
|
96
|
+
accessibility: "no-public";
|
|
96
97
|
}];
|
|
97
98
|
'eslint/id-length': "off";
|
|
98
99
|
'eslint/sort-keys': "off";
|
|
@@ -102,13 +103,13 @@ declare function nodeConfig(_options?: Partial<NodeOptions>): {
|
|
|
102
103
|
'eslint/max-params': "off";
|
|
103
104
|
'eslint/no-ternary': "off";
|
|
104
105
|
'eslint/curly': "warn";
|
|
105
|
-
'typescript/consistent-type-definitions': ["warn",
|
|
106
|
+
'typescript/consistent-type-definitions': ["warn", "type"];
|
|
106
107
|
'eslint/max-statements': "off";
|
|
107
108
|
'typescript/consistent-return': "off";
|
|
108
109
|
'unicorn/switch-case-braces': "warn";
|
|
109
110
|
'typescript/prefer-regexp-exec': "warn";
|
|
110
111
|
'eslint/init-declarations': "off";
|
|
111
|
-
'unicorn/no-null': "
|
|
112
|
+
'unicorn/no-null': "off";
|
|
112
113
|
'eslint/no-undefined': "off";
|
|
113
114
|
'eslint/no-console': "off";
|
|
114
115
|
'eslint/no-continue': "off";
|
|
@@ -121,15 +122,29 @@ declare function nodeConfig(_options?: Partial<NodeOptions>): {
|
|
|
121
122
|
'eslint/no-empty-function': ["warn", {
|
|
122
123
|
allow: string[];
|
|
123
124
|
}];
|
|
125
|
+
'unicorn/no-instanceof-builtins': "off";
|
|
126
|
+
'unicorn/prefer-spread': "off";
|
|
127
|
+
'eslint/new-cap': "off";
|
|
128
|
+
'unicorn/no-await-expression-member': "off";
|
|
124
129
|
'eslint/no-duplicate-imports': ["warn", {
|
|
125
130
|
allowSeparateTypeImports: boolean;
|
|
126
131
|
}];
|
|
132
|
+
'import/no-named-export': "off";
|
|
133
|
+
'import/no-default-export': "off";
|
|
134
|
+
'import/prefer-default-export': "off";
|
|
135
|
+
'import/no-namespace': "off";
|
|
136
|
+
'import/exports-last': "off";
|
|
137
|
+
'import/no-unassigned-import': "off";
|
|
138
|
+
'import/group-exports': "off";
|
|
139
|
+
'import/consistent-type-specifier-style': "off";
|
|
127
140
|
'unicorn/no-new-array': "off";
|
|
128
141
|
'eslint/no-array-constructor': "warn";
|
|
129
142
|
'typescript/explicit-function-return-type': "off";
|
|
130
143
|
'typescript/explicit-module-boundary-types': "off";
|
|
131
144
|
'unicorn/no-anonymous-default-export': "off";
|
|
132
145
|
'eslint/sort-imports': "off";
|
|
146
|
+
'import/no-relative-parent-imports': "off";
|
|
147
|
+
'unicorn/max-nested-calls': "off";
|
|
133
148
|
'eslint/no-magic-numbers': "off";
|
|
134
149
|
'unicorn/prefer-modern-math-apis': "off";
|
|
135
150
|
'eslint/no-use-before-define': "off";
|
|
@@ -149,14 +164,21 @@ declare function nodeConfig(_options?: Partial<NodeOptions>): {
|
|
|
149
164
|
'oxc/no-async-await': "off";
|
|
150
165
|
};
|
|
151
166
|
}[];
|
|
167
|
+
plugins: ("import" | "typescript" | "unicorn")[];
|
|
152
168
|
env: {
|
|
153
169
|
node: true;
|
|
154
170
|
};
|
|
171
|
+
rules: {
|
|
172
|
+
'eslint/no-underscore-dangle': ["warn", {
|
|
173
|
+
allow: string[];
|
|
174
|
+
}];
|
|
175
|
+
'no-nodejs-modules': "off";
|
|
176
|
+
};
|
|
155
177
|
};
|
|
156
178
|
export { type OxlintConfig, defineConfig, nodeConfig };
|
|
157
179
|
declare const _default: {
|
|
158
180
|
extends: {
|
|
159
|
-
plugins: ("
|
|
181
|
+
plugins: ("import" | "typescript" | "unicorn")[];
|
|
160
182
|
jsPlugins: never[];
|
|
161
183
|
categories: {
|
|
162
184
|
correctness: "error";
|
|
@@ -172,6 +194,7 @@ declare const _default: {
|
|
|
172
194
|
};
|
|
173
195
|
options: {
|
|
174
196
|
typeAware: true;
|
|
197
|
+
typeCheck: true;
|
|
175
198
|
};
|
|
176
199
|
rules: {
|
|
177
200
|
'eslint/no-var': "warn";
|
|
@@ -246,7 +269,7 @@ declare const _default: {
|
|
|
246
269
|
'typescript/prefer-as-const': "error";
|
|
247
270
|
'typescript/triple-slash-reference': "error";
|
|
248
271
|
'typescript/explicit-member-accessibility': ["warn", {
|
|
249
|
-
accessibility:
|
|
272
|
+
accessibility: "no-public";
|
|
250
273
|
}];
|
|
251
274
|
'eslint/id-length': "off";
|
|
252
275
|
'eslint/sort-keys': "off";
|
|
@@ -256,13 +279,13 @@ declare const _default: {
|
|
|
256
279
|
'eslint/max-params': "off";
|
|
257
280
|
'eslint/no-ternary': "off";
|
|
258
281
|
'eslint/curly': "warn";
|
|
259
|
-
'typescript/consistent-type-definitions': ["warn",
|
|
282
|
+
'typescript/consistent-type-definitions': ["warn", "type"];
|
|
260
283
|
'eslint/max-statements': "off";
|
|
261
284
|
'typescript/consistent-return': "off";
|
|
262
285
|
'unicorn/switch-case-braces': "warn";
|
|
263
286
|
'typescript/prefer-regexp-exec': "warn";
|
|
264
287
|
'eslint/init-declarations': "off";
|
|
265
|
-
'unicorn/no-null': "
|
|
288
|
+
'unicorn/no-null': "off";
|
|
266
289
|
'eslint/no-undefined': "off";
|
|
267
290
|
'eslint/no-console': "off";
|
|
268
291
|
'eslint/no-continue': "off";
|
|
@@ -275,15 +298,29 @@ declare const _default: {
|
|
|
275
298
|
'eslint/no-empty-function': ["warn", {
|
|
276
299
|
allow: string[];
|
|
277
300
|
}];
|
|
301
|
+
'unicorn/no-instanceof-builtins': "off";
|
|
302
|
+
'unicorn/prefer-spread': "off";
|
|
303
|
+
'eslint/new-cap': "off";
|
|
304
|
+
'unicorn/no-await-expression-member': "off";
|
|
278
305
|
'eslint/no-duplicate-imports': ["warn", {
|
|
279
306
|
allowSeparateTypeImports: boolean;
|
|
280
307
|
}];
|
|
308
|
+
'import/no-named-export': "off";
|
|
309
|
+
'import/no-default-export': "off";
|
|
310
|
+
'import/prefer-default-export': "off";
|
|
311
|
+
'import/no-namespace': "off";
|
|
312
|
+
'import/exports-last': "off";
|
|
313
|
+
'import/no-unassigned-import': "off";
|
|
314
|
+
'import/group-exports': "off";
|
|
315
|
+
'import/consistent-type-specifier-style': "off";
|
|
281
316
|
'unicorn/no-new-array': "off";
|
|
282
317
|
'eslint/no-array-constructor': "warn";
|
|
283
318
|
'typescript/explicit-function-return-type': "off";
|
|
284
319
|
'typescript/explicit-module-boundary-types': "off";
|
|
285
320
|
'unicorn/no-anonymous-default-export': "off";
|
|
286
321
|
'eslint/sort-imports': "off";
|
|
322
|
+
'import/no-relative-parent-imports': "off";
|
|
323
|
+
'unicorn/max-nested-calls': "off";
|
|
287
324
|
'eslint/no-magic-numbers': "off";
|
|
288
325
|
'unicorn/prefer-modern-math-apis': "off";
|
|
289
326
|
'eslint/no-use-before-define': "off";
|
|
@@ -303,9 +340,16 @@ declare const _default: {
|
|
|
303
340
|
'oxc/no-async-await': "off";
|
|
304
341
|
};
|
|
305
342
|
}[];
|
|
343
|
+
plugins: ("import" | "typescript" | "unicorn")[];
|
|
306
344
|
env: {
|
|
307
345
|
node: true;
|
|
308
346
|
};
|
|
347
|
+
rules: {
|
|
348
|
+
'eslint/no-underscore-dangle': ["warn", {
|
|
349
|
+
allow: string[];
|
|
350
|
+
}];
|
|
351
|
+
'no-nodejs-modules': "off";
|
|
352
|
+
};
|
|
309
353
|
};
|
|
310
354
|
export default _default;
|
|
311
355
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,KAAK,WAAW,GAAG,EAAE,CAAC;AAItB,iBAAS,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,KAAK,WAAW,GAAG,EAAE,CAAC;AAItB,iBAAS,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBjD;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/node.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { defineConfig } from 'oxlint';
|
|
2
2
|
import { baseConfig } from './base.js';
|
|
3
3
|
// const DEFAULT_OPTIONS: NodeOptions = {};
|
|
4
|
-
function nodeConfig(
|
|
4
|
+
function nodeConfig(options) {
|
|
5
5
|
// const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
6
|
+
const base = baseConfig(options);
|
|
6
7
|
return defineConfig({
|
|
7
|
-
extends: [
|
|
8
|
+
extends: [base],
|
|
9
|
+
// when changing plugins the parent plugins need to be extended, otherwise they are overridden
|
|
10
|
+
plugins: base.plugins,
|
|
8
11
|
env: {
|
|
9
12
|
node: true,
|
|
10
13
|
},
|
|
14
|
+
rules: {
|
|
15
|
+
'eslint/no-underscore-dangle': [
|
|
16
|
+
'warn',
|
|
17
|
+
{ allow: ['__dirname', '__filename'] },
|
|
18
|
+
],
|
|
19
|
+
'no-nodejs-modules': 'off',
|
|
20
|
+
},
|
|
11
21
|
});
|
|
12
22
|
}
|
|
13
23
|
export { defineConfig, nodeConfig };
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIvC,2CAA2C;AAE3C,SAAS,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIvC,2CAA2C;AAE3C,SAAS,UAAU,CAAC,OAA8B;IAChD,mDAAmD;IAEnD,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEjC,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,IAAI,CAAC;QACf,8FAA8F;QAC9F,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,EAAE;YACH,IAAI,EAAE,IAAI;SACX;QAED,KAAK,EAAE;YACL,6BAA6B,EAAE;gBAC7B,MAAM;gBACN,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE;aACvC;YACD,mBAAmB,EAAE,KAAK;SAC3B;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAqB,YAAY,EAAE,UAAU,EAAE,CAAC;AAEvD,eAAe,UAAU,EAAE,CAAC"}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineConfig, type OxlintConfig } from 'oxlint';
|
|
2
2
|
export type ReactOptions = {};
|
|
3
|
-
declare function reactConfig(
|
|
3
|
+
declare function reactConfig(options?: Partial<ReactOptions>): {
|
|
4
4
|
extends: {
|
|
5
|
-
plugins: ("
|
|
5
|
+
plugins: ("import" | "typescript" | "unicorn")[];
|
|
6
6
|
jsPlugins: never[];
|
|
7
7
|
categories: {
|
|
8
8
|
correctness: "error";
|
|
@@ -18,6 +18,7 @@ declare function reactConfig(_options?: Partial<ReactOptions>): {
|
|
|
18
18
|
};
|
|
19
19
|
options: {
|
|
20
20
|
typeAware: true;
|
|
21
|
+
typeCheck: true;
|
|
21
22
|
};
|
|
22
23
|
rules: {
|
|
23
24
|
'eslint/no-var': "warn";
|
|
@@ -92,7 +93,7 @@ declare function reactConfig(_options?: Partial<ReactOptions>): {
|
|
|
92
93
|
'typescript/prefer-as-const': "error";
|
|
93
94
|
'typescript/triple-slash-reference': "error";
|
|
94
95
|
'typescript/explicit-member-accessibility': ["warn", {
|
|
95
|
-
accessibility:
|
|
96
|
+
accessibility: "no-public";
|
|
96
97
|
}];
|
|
97
98
|
'eslint/id-length': "off";
|
|
98
99
|
'eslint/sort-keys': "off";
|
|
@@ -102,13 +103,13 @@ declare function reactConfig(_options?: Partial<ReactOptions>): {
|
|
|
102
103
|
'eslint/max-params': "off";
|
|
103
104
|
'eslint/no-ternary': "off";
|
|
104
105
|
'eslint/curly': "warn";
|
|
105
|
-
'typescript/consistent-type-definitions': ["warn",
|
|
106
|
+
'typescript/consistent-type-definitions': ["warn", "type"];
|
|
106
107
|
'eslint/max-statements': "off";
|
|
107
108
|
'typescript/consistent-return': "off";
|
|
108
109
|
'unicorn/switch-case-braces': "warn";
|
|
109
110
|
'typescript/prefer-regexp-exec': "warn";
|
|
110
111
|
'eslint/init-declarations': "off";
|
|
111
|
-
'unicorn/no-null': "
|
|
112
|
+
'unicorn/no-null': "off";
|
|
112
113
|
'eslint/no-undefined': "off";
|
|
113
114
|
'eslint/no-console': "off";
|
|
114
115
|
'eslint/no-continue': "off";
|
|
@@ -121,15 +122,29 @@ declare function reactConfig(_options?: Partial<ReactOptions>): {
|
|
|
121
122
|
'eslint/no-empty-function': ["warn", {
|
|
122
123
|
allow: string[];
|
|
123
124
|
}];
|
|
125
|
+
'unicorn/no-instanceof-builtins': "off";
|
|
126
|
+
'unicorn/prefer-spread': "off";
|
|
127
|
+
'eslint/new-cap': "off";
|
|
128
|
+
'unicorn/no-await-expression-member': "off";
|
|
124
129
|
'eslint/no-duplicate-imports': ["warn", {
|
|
125
130
|
allowSeparateTypeImports: boolean;
|
|
126
131
|
}];
|
|
132
|
+
'import/no-named-export': "off";
|
|
133
|
+
'import/no-default-export': "off";
|
|
134
|
+
'import/prefer-default-export': "off";
|
|
135
|
+
'import/no-namespace': "off";
|
|
136
|
+
'import/exports-last': "off";
|
|
137
|
+
'import/no-unassigned-import': "off";
|
|
138
|
+
'import/group-exports': "off";
|
|
139
|
+
'import/consistent-type-specifier-style': "off";
|
|
127
140
|
'unicorn/no-new-array': "off";
|
|
128
141
|
'eslint/no-array-constructor': "warn";
|
|
129
142
|
'typescript/explicit-function-return-type': "off";
|
|
130
143
|
'typescript/explicit-module-boundary-types': "off";
|
|
131
144
|
'unicorn/no-anonymous-default-export': "off";
|
|
132
145
|
'eslint/sort-imports': "off";
|
|
146
|
+
'import/no-relative-parent-imports': "off";
|
|
147
|
+
'unicorn/max-nested-calls': "off";
|
|
133
148
|
'eslint/no-magic-numbers': "off";
|
|
134
149
|
'unicorn/prefer-modern-math-apis': "off";
|
|
135
150
|
'eslint/no-use-before-define': "off";
|
|
@@ -149,17 +164,24 @@ declare function reactConfig(_options?: Partial<ReactOptions>): {
|
|
|
149
164
|
'oxc/no-async-await': "off";
|
|
150
165
|
};
|
|
151
166
|
}[];
|
|
152
|
-
plugins: "react"[];
|
|
167
|
+
plugins: ("import" | "react" | "typescript" | "unicorn")[];
|
|
153
168
|
jsPlugins: {
|
|
154
169
|
name: string;
|
|
155
170
|
specifier: string;
|
|
156
171
|
}[];
|
|
157
172
|
rules: {
|
|
158
|
-
'react
|
|
159
|
-
'react
|
|
173
|
+
'react/rules-of-hooks': "error";
|
|
174
|
+
'react/exhaustive-deps': "warn";
|
|
160
175
|
'react-hooks-js/set-state-in-effect': "warn";
|
|
161
|
-
'react
|
|
176
|
+
'react/only-export-components': "error";
|
|
162
177
|
'react-compiler-js/react-compiler': "error";
|
|
178
|
+
'react/jsx-filename-extension': "off";
|
|
179
|
+
'react/jsx-max-depth': "off";
|
|
180
|
+
'react/no-multi-comp': "off";
|
|
181
|
+
'react/jsx-props-no-spreading': "off";
|
|
182
|
+
'react/jsx-no-literals': "off";
|
|
183
|
+
'react/forbid-component-props': "off";
|
|
184
|
+
'react/forbid-dom-props': "off";
|
|
163
185
|
};
|
|
164
186
|
overrides: {
|
|
165
187
|
files: string[];
|
|
@@ -184,7 +206,7 @@ declare function reactConfig(_options?: Partial<ReactOptions>): {
|
|
|
184
206
|
'react/require-render-return': "error";
|
|
185
207
|
'import/no-anonymous-default-export': "warn";
|
|
186
208
|
'jsx-a11y/alt-text': ["warn", {
|
|
187
|
-
elements:
|
|
209
|
+
elements: "img"[];
|
|
188
210
|
img: string[];
|
|
189
211
|
}];
|
|
190
212
|
'jsx-a11y/aria-props': "warn";
|
|
@@ -212,7 +234,7 @@ declare function reactConfig(_options?: Partial<ReactOptions>): {
|
|
|
212
234
|
export { type OxlintConfig, defineConfig, reactConfig };
|
|
213
235
|
declare const _default: {
|
|
214
236
|
extends: {
|
|
215
|
-
plugins: ("
|
|
237
|
+
plugins: ("import" | "typescript" | "unicorn")[];
|
|
216
238
|
jsPlugins: never[];
|
|
217
239
|
categories: {
|
|
218
240
|
correctness: "error";
|
|
@@ -228,6 +250,7 @@ declare const _default: {
|
|
|
228
250
|
};
|
|
229
251
|
options: {
|
|
230
252
|
typeAware: true;
|
|
253
|
+
typeCheck: true;
|
|
231
254
|
};
|
|
232
255
|
rules: {
|
|
233
256
|
'eslint/no-var': "warn";
|
|
@@ -302,7 +325,7 @@ declare const _default: {
|
|
|
302
325
|
'typescript/prefer-as-const': "error";
|
|
303
326
|
'typescript/triple-slash-reference': "error";
|
|
304
327
|
'typescript/explicit-member-accessibility': ["warn", {
|
|
305
|
-
accessibility:
|
|
328
|
+
accessibility: "no-public";
|
|
306
329
|
}];
|
|
307
330
|
'eslint/id-length': "off";
|
|
308
331
|
'eslint/sort-keys': "off";
|
|
@@ -312,13 +335,13 @@ declare const _default: {
|
|
|
312
335
|
'eslint/max-params': "off";
|
|
313
336
|
'eslint/no-ternary': "off";
|
|
314
337
|
'eslint/curly': "warn";
|
|
315
|
-
'typescript/consistent-type-definitions': ["warn",
|
|
338
|
+
'typescript/consistent-type-definitions': ["warn", "type"];
|
|
316
339
|
'eslint/max-statements': "off";
|
|
317
340
|
'typescript/consistent-return': "off";
|
|
318
341
|
'unicorn/switch-case-braces': "warn";
|
|
319
342
|
'typescript/prefer-regexp-exec': "warn";
|
|
320
343
|
'eslint/init-declarations': "off";
|
|
321
|
-
'unicorn/no-null': "
|
|
344
|
+
'unicorn/no-null': "off";
|
|
322
345
|
'eslint/no-undefined': "off";
|
|
323
346
|
'eslint/no-console': "off";
|
|
324
347
|
'eslint/no-continue': "off";
|
|
@@ -331,15 +354,29 @@ declare const _default: {
|
|
|
331
354
|
'eslint/no-empty-function': ["warn", {
|
|
332
355
|
allow: string[];
|
|
333
356
|
}];
|
|
357
|
+
'unicorn/no-instanceof-builtins': "off";
|
|
358
|
+
'unicorn/prefer-spread': "off";
|
|
359
|
+
'eslint/new-cap': "off";
|
|
360
|
+
'unicorn/no-await-expression-member': "off";
|
|
334
361
|
'eslint/no-duplicate-imports': ["warn", {
|
|
335
362
|
allowSeparateTypeImports: boolean;
|
|
336
363
|
}];
|
|
364
|
+
'import/no-named-export': "off";
|
|
365
|
+
'import/no-default-export': "off";
|
|
366
|
+
'import/prefer-default-export': "off";
|
|
367
|
+
'import/no-namespace': "off";
|
|
368
|
+
'import/exports-last': "off";
|
|
369
|
+
'import/no-unassigned-import': "off";
|
|
370
|
+
'import/group-exports': "off";
|
|
371
|
+
'import/consistent-type-specifier-style': "off";
|
|
337
372
|
'unicorn/no-new-array': "off";
|
|
338
373
|
'eslint/no-array-constructor': "warn";
|
|
339
374
|
'typescript/explicit-function-return-type': "off";
|
|
340
375
|
'typescript/explicit-module-boundary-types': "off";
|
|
341
376
|
'unicorn/no-anonymous-default-export': "off";
|
|
342
377
|
'eslint/sort-imports': "off";
|
|
378
|
+
'import/no-relative-parent-imports': "off";
|
|
379
|
+
'unicorn/max-nested-calls': "off";
|
|
343
380
|
'eslint/no-magic-numbers': "off";
|
|
344
381
|
'unicorn/prefer-modern-math-apis': "off";
|
|
345
382
|
'eslint/no-use-before-define': "off";
|
|
@@ -359,17 +396,24 @@ declare const _default: {
|
|
|
359
396
|
'oxc/no-async-await': "off";
|
|
360
397
|
};
|
|
361
398
|
}[];
|
|
362
|
-
plugins: "react"[];
|
|
399
|
+
plugins: ("import" | "react" | "typescript" | "unicorn")[];
|
|
363
400
|
jsPlugins: {
|
|
364
401
|
name: string;
|
|
365
402
|
specifier: string;
|
|
366
403
|
}[];
|
|
367
404
|
rules: {
|
|
368
|
-
'react
|
|
369
|
-
'react
|
|
405
|
+
'react/rules-of-hooks': "error";
|
|
406
|
+
'react/exhaustive-deps': "warn";
|
|
370
407
|
'react-hooks-js/set-state-in-effect': "warn";
|
|
371
|
-
'react
|
|
408
|
+
'react/only-export-components': "error";
|
|
372
409
|
'react-compiler-js/react-compiler': "error";
|
|
410
|
+
'react/jsx-filename-extension': "off";
|
|
411
|
+
'react/jsx-max-depth': "off";
|
|
412
|
+
'react/no-multi-comp': "off";
|
|
413
|
+
'react/jsx-props-no-spreading': "off";
|
|
414
|
+
'react/jsx-no-literals': "off";
|
|
415
|
+
'react/forbid-component-props': "off";
|
|
416
|
+
'react/forbid-dom-props': "off";
|
|
373
417
|
};
|
|
374
418
|
overrides: {
|
|
375
419
|
files: string[];
|
|
@@ -394,7 +438,7 @@ declare const _default: {
|
|
|
394
438
|
'react/require-render-return': "error";
|
|
395
439
|
'import/no-anonymous-default-export': "warn";
|
|
396
440
|
'jsx-a11y/alt-text': ["warn", {
|
|
397
|
-
elements:
|
|
441
|
+
elements: "img"[];
|
|
398
442
|
img: string[];
|
|
399
443
|
}];
|
|
400
444
|
'jsx-a11y/aria-props': "warn";
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAI9B,iBAAS,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAI9B,iBAAS,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmFnD;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/react.js
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
import { defineConfig } from 'oxlint';
|
|
2
2
|
import { baseConfig } from './base.js';
|
|
3
3
|
// const DEFAULT_OPTIONS: ReactOptions = {};
|
|
4
|
-
function reactConfig(
|
|
4
|
+
function reactConfig(options) {
|
|
5
5
|
// const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
6
|
+
const base = baseConfig(options);
|
|
6
7
|
return defineConfig({
|
|
7
|
-
extends: [
|
|
8
|
-
plugins: ['react'],
|
|
8
|
+
extends: [base],
|
|
9
|
+
plugins: [...base.plugins, 'react'],
|
|
9
10
|
jsPlugins: [
|
|
11
|
+
// react compiler is not yet supported by oxc
|
|
12
|
+
// https://github.com/oxc-project/oxc/issues/10048
|
|
13
|
+
// this means compiler related rules are not yet supported
|
|
14
|
+
// https://github.com/oxc-project/oxc/issues/1022
|
|
15
|
+
// react compiler port to rust may enable compiler related rules
|
|
16
|
+
// https://github.com/facebook/react/pull/36173
|
|
10
17
|
{ name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' },
|
|
11
|
-
{ name: 'react-refresh-js', specifier: 'eslint-plugin-react-refresh' },
|
|
12
18
|
{ name: 'react-compiler-js', specifier: 'eslint-plugin-react-compiler' },
|
|
13
19
|
],
|
|
14
20
|
rules: {
|
|
15
|
-
'react
|
|
16
|
-
'react
|
|
21
|
+
'react/rules-of-hooks': 'error',
|
|
22
|
+
'react/exhaustive-deps': 'warn',
|
|
17
23
|
'react-hooks-js/set-state-in-effect': 'warn',
|
|
18
|
-
'react
|
|
24
|
+
'react/only-export-components': 'error',
|
|
19
25
|
'react-compiler-js/react-compiler': 'error',
|
|
26
|
+
'react/jsx-filename-extension': 'off',
|
|
27
|
+
'react/jsx-max-depth': 'off',
|
|
28
|
+
'react/no-multi-comp': 'off',
|
|
29
|
+
'react/jsx-props-no-spreading': 'off',
|
|
30
|
+
'react/jsx-no-literals': 'off',
|
|
31
|
+
// conflicts with tailwind
|
|
32
|
+
'react/forbid-component-props': 'off',
|
|
33
|
+
'react/forbid-dom-props': 'off',
|
|
20
34
|
},
|
|
21
35
|
overrides: [
|
|
22
36
|
{
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIvC,4CAA4C;AAE5C,SAAS,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YA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