@ocavue/eslint-config 3.0.0 → 3.1.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 +2 -1
- package/dist/options.d.ts +7 -1
- package/dist/options.js +2 -2
- package/dist/react.js +10 -1
- package/dist/typescript.js +0 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -189,8 +189,9 @@ export default defineESLintConfig(
|
|
|
189
189
|
},
|
|
190
190
|
// More configs here:
|
|
191
191
|
{
|
|
192
|
+
files: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
192
193
|
rules: {
|
|
193
|
-
'@typescript-eslint/no-explicit-any': '
|
|
194
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
194
195
|
},
|
|
195
196
|
},
|
|
196
197
|
{
|
package/dist/options.d.ts
CHANGED
|
@@ -96,8 +96,14 @@ export interface ReactOptions {
|
|
|
96
96
|
* @see {@link Config.files}
|
|
97
97
|
*/
|
|
98
98
|
files?: Config['files'];
|
|
99
|
+
/**
|
|
100
|
+
* Whether to enable [eslint-plugin-react-compiler](https://www.npmjs.com/package/eslint-plugin-react-compiler) configuration.
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
reactCompiler?: boolean;
|
|
99
105
|
}
|
|
100
|
-
export declare function resolveReactOptions({ files, }?: ReactOptions): Required<ReactOptions>;
|
|
106
|
+
export declare function resolveReactOptions({ files, reactCompiler, }?: ReactOptions): Required<ReactOptions>;
|
|
101
107
|
export interface VueOptions {
|
|
102
108
|
/**
|
|
103
109
|
* The default files to lint.
|
package/dist/options.js
CHANGED
|
@@ -17,8 +17,8 @@ export function resolveOptions({ typescript = true, unicorn = true, packageJson
|
|
|
17
17
|
prettier,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export function resolveReactOptions({ files = [GLOB_TS, GLOB_TSX], } = {}) {
|
|
21
|
-
return { files };
|
|
20
|
+
export function resolveReactOptions({ files = [GLOB_TS, GLOB_TSX], reactCompiler = false, } = {}) {
|
|
21
|
+
return { files, reactCompiler };
|
|
22
22
|
}
|
|
23
23
|
export function resolveVueOptions({ files = [GLOB_VUE], } = {}) {
|
|
24
24
|
return { files };
|
package/dist/react.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import reactPlugin from 'eslint-plugin-react';
|
|
2
|
+
import reactCompiler from "eslint-plugin-react-compiler";
|
|
2
3
|
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
3
4
|
import { resolveReactOptions } from './options.js';
|
|
4
5
|
export function react(options) {
|
|
5
6
|
const { files } = resolveReactOptions(options);
|
|
6
7
|
const reactRecommended = reactPlugin.configs.flat.recommended;
|
|
7
|
-
|
|
8
|
+
const configs = [
|
|
8
9
|
{
|
|
9
10
|
...reactRecommended,
|
|
10
11
|
name: 'react',
|
|
@@ -32,4 +33,12 @@ export function react(options) {
|
|
|
32
33
|
},
|
|
33
34
|
},
|
|
34
35
|
];
|
|
36
|
+
if (options?.reactCompiler) {
|
|
37
|
+
configs.push({
|
|
38
|
+
...reactCompiler.configs.recommended,
|
|
39
|
+
name: 'react-compiler',
|
|
40
|
+
files: files,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return configs;
|
|
35
44
|
}
|
package/dist/typescript.js
CHANGED
|
@@ -94,7 +94,6 @@ function tsOnlyRules() {
|
|
|
94
94
|
],
|
|
95
95
|
'@typescript-eslint/no-import-type-side-effects': 'warn',
|
|
96
96
|
'@typescript-eslint/no-mixed-enums': 'error',
|
|
97
|
-
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
98
97
|
'@typescript-eslint/no-unnecessary-parameter-property-assignment': 'warn',
|
|
99
98
|
'@typescript-eslint/return-await': ['error', 'always'],
|
|
100
99
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocavue/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "ocavue <ocavue@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
41
41
|
"eslint-plugin-package-json": "^0.31.0",
|
|
42
42
|
"eslint-plugin-react": "^7.37.5",
|
|
43
|
+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
43
44
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
44
45
|
"eslint-plugin-unicorn": "^59.0.1",
|
|
45
46
|
"eslint-plugin-vue": "^10.1.0",
|