react-eslint-standard 9.0.0 → 9.0.3
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/dist/index.d.ts +5 -2
- package/dist/index.js +69 -68
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
|
-
declare
|
|
3
|
+
declare function defineConfig(options?: {
|
|
4
|
+
extends?: TSESLint.FlatConfig.Config[];
|
|
5
|
+
config?: TSESLint.FlatConfig.Config;
|
|
6
|
+
}): TSESLint.FlatConfig.ConfigArray;
|
|
4
7
|
|
|
5
|
-
export {
|
|
8
|
+
export { defineConfig };
|
package/dist/index.js
CHANGED
|
@@ -5,83 +5,84 @@ import react from 'eslint-plugin-react';
|
|
|
5
5
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
6
6
|
import vitest from 'eslint-plugin-vitest';
|
|
7
7
|
import tseslint from 'typescript-eslint';
|
|
8
|
-
import {
|
|
8
|
+
import { tseslintRules } from 'typescript-eslint-standard';
|
|
9
9
|
|
|
10
10
|
const reactRules = {
|
|
11
11
|
'react/jsx-uses-react': 'error',
|
|
12
12
|
'react/jsx-uses-vars': 'error',
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
function defineConfig(options) {
|
|
15
|
+
const { extends: inherit, config } = options ?? {};
|
|
16
|
+
const { files, ignores, languageOptions, plugins, rules } = config ?? {};
|
|
17
|
+
const inherits = inherit ?? [];
|
|
18
|
+
return tseslint.config(
|
|
19
|
+
eslint.configs.recommended,
|
|
20
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
21
|
+
...tseslint.configs.strictTypeChecked,
|
|
22
|
+
prettierConfig,
|
|
23
|
+
prettierRecommended,
|
|
24
|
+
...inherits,
|
|
25
|
+
{
|
|
26
|
+
name: 'react-eslint-standard',
|
|
27
|
+
files: files ?? ['**/*.{j,t}s', '**/*.{j,t}sx'],
|
|
28
|
+
languageOptions: languageOptions ?? {
|
|
29
|
+
parser: tseslint.parser,
|
|
30
|
+
parserOptions: {
|
|
31
|
+
project: true,
|
|
32
|
+
ecmaVersion: 'latest',
|
|
33
|
+
sourceType: 'module',
|
|
34
|
+
ecmaFeatures: {
|
|
35
|
+
jsx: true,
|
|
36
|
+
},
|
|
32
37
|
},
|
|
33
38
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'simple-import-sort/imports': 'error',
|
|
44
|
-
'simple-import-sort/exports': 'error',
|
|
45
|
-
},
|
|
46
|
-
ignores: [
|
|
47
|
-
'node_modules',
|
|
48
|
-
'dist',
|
|
49
|
-
'build',
|
|
50
|
-
'package.json',
|
|
51
|
-
'**/*.md',
|
|
52
|
-
' **/*.svg',
|
|
53
|
-
'**/*.ejs',
|
|
54
|
-
'**/*.html',
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
files: ['**/*.{test,spec}.{j,t}s'],
|
|
59
|
-
plugins: {
|
|
60
|
-
vitest,
|
|
61
|
-
'simple-import-sort': simpleImportSort,
|
|
62
|
-
},
|
|
63
|
-
rules: {
|
|
64
|
-
...eslintRules,
|
|
65
|
-
...typescriptRules,
|
|
66
|
-
...vitest.configs.recommended.rules,
|
|
67
|
-
'simple-import-sort/imports': 'error',
|
|
68
|
-
'simple-import-sort/exports': 'error',
|
|
69
|
-
},
|
|
70
|
-
settings: {
|
|
71
|
-
vitest: {
|
|
72
|
-
typecheck: true,
|
|
39
|
+
plugins: {
|
|
40
|
+
react,
|
|
41
|
+
'simple-import-sort': simpleImportSort,
|
|
42
|
+
...plugins,
|
|
43
|
+
},
|
|
44
|
+
rules: {
|
|
45
|
+
...tseslintRules,
|
|
46
|
+
...reactRules,
|
|
47
|
+
...rules,
|
|
73
48
|
},
|
|
49
|
+
ignores: ignores ?? [
|
|
50
|
+
'node_modules',
|
|
51
|
+
'dist',
|
|
52
|
+
'build',
|
|
53
|
+
'package.json',
|
|
54
|
+
'**/*.md',
|
|
55
|
+
' **/*.svg',
|
|
56
|
+
'**/*.ejs',
|
|
57
|
+
'**/*.html',
|
|
58
|
+
],
|
|
74
59
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
{
|
|
61
|
+
name: 'vitest-eslint-standard',
|
|
62
|
+
files: ['**/*.{test,spec}.{j,t}s', '**/*.{test,spec}.{j,t}sx'],
|
|
63
|
+
plugins: {
|
|
64
|
+
vitest,
|
|
78
65
|
},
|
|
66
|
+
rules: {
|
|
67
|
+
...vitest.configs.recommended.rules,
|
|
68
|
+
...rules,
|
|
69
|
+
},
|
|
70
|
+
settings: {
|
|
71
|
+
vitest: {
|
|
72
|
+
typecheck: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
languageOptions: {
|
|
76
|
+
globals: {
|
|
77
|
+
...vitest.environments.env.globals,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
files: ['**/*.js', '**/*.jsx'],
|
|
83
|
+
...tseslint.configs.disableTypeChecked,
|
|
79
84
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
files: ['**/*.js'],
|
|
83
|
-
...tseslint.configs.disableTypeChecked,
|
|
84
|
-
},
|
|
85
|
-
);
|
|
85
|
+
);
|
|
86
|
+
}
|
|
86
87
|
|
|
87
|
-
export {
|
|
88
|
+
export { defineConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-eslint-standard",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.3",
|
|
4
4
|
"description": "quickly start eslint in react",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"node": "^18.0.0 || >=20.0.0"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"eslint": "eslint --fix
|
|
21
|
+
"eslint": "eslint --fix **/*.{ts,js}",
|
|
22
22
|
"build": "rollup -c rollup.config.js",
|
|
23
23
|
"test": "vitest"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"eslint-plugin-react": "^7.35.0",
|
|
27
|
-
"typescript-eslint-standard": "^9.0.
|
|
27
|
+
"typescript-eslint-standard": "^9.0.8"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"author": "mivui",
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"keywords": [
|
|
47
|
-
"
|
|
47
|
+
"react",
|
|
48
48
|
"eslint",
|
|
49
49
|
"prettier",
|
|
50
50
|
"typescript"
|