@fullstacksjs/eslint-config 11.1.6 → 11.1.8
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/package.json +3 -3
- package/src/init.d.ts +1 -1
- package/src/modules/jest.js +1 -4
- package/src/modules/playwright.js +0 -1
- package/src/modules/react.js +65 -89
- package/src/modules/strict.js +1 -4
- package/src/modules/tailwind.js +2 -2
- package/src/modules/tests.js +2 -2
- package/src/modules/typescript.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "fullstacks <fullstacksjs@gmail.com>",
|
|
6
6
|
"description": "fullstacks eslint config",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"main": "src/index.js",
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@eslint-react/eslint-plugin": "1.5.15",
|
|
27
28
|
"@graphql-eslint/eslint-plugin": "3.20.1",
|
|
28
29
|
"deepmerge": "4.3.1",
|
|
29
30
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
@@ -37,12 +38,12 @@
|
|
|
37
38
|
"eslint-plugin-playwright": "1.6.2",
|
|
38
39
|
"eslint-plugin-prettier": "5.1.3",
|
|
39
40
|
"eslint-plugin-promise": "6.2.0",
|
|
40
|
-
"eslint-plugin-react": "7.34.2",
|
|
41
41
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
42
42
|
"eslint-plugin-storybook": "0.8.0",
|
|
43
43
|
"eslint-plugin-tailwindcss": "3.17.3",
|
|
44
44
|
"eslint-plugin-vitest": "0.5.4",
|
|
45
45
|
"globals": "15.4.0",
|
|
46
|
+
"local-pkg": "0.5.0",
|
|
46
47
|
"typescript-eslint": "rc-v8"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
@@ -58,7 +59,6 @@
|
|
|
58
59
|
"husky": "9.0.11",
|
|
59
60
|
"jest": "29.7.0",
|
|
60
61
|
"lint-staged": "15.2.5",
|
|
61
|
-
"local-pkg": "0.5.0",
|
|
62
62
|
"np": "10.0.0",
|
|
63
63
|
"npm-run-all": "4.1.5",
|
|
64
64
|
"pinst": "3.0.0",
|
package/src/init.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface Options {
|
|
|
15
15
|
storybook?: boolean;
|
|
16
16
|
prettier?: boolean;
|
|
17
17
|
playwright?: boolean;
|
|
18
|
-
typescript?: { projects: string[] |
|
|
18
|
+
typescript?: { projects: string[] | boolean | string; tsconfigRootDir?: string };
|
|
19
19
|
disableExpensiveRules?: boolean;
|
|
20
20
|
ignores?: string[];
|
|
21
21
|
}
|
package/src/modules/jest.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
const globals = require('globals');
|
|
2
1
|
const plugin = require('eslint-plugin-jest');
|
|
3
|
-
const { predicate } = require('../utils/conditions');
|
|
4
2
|
const { globs } = require('../utils/globs');
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* @param { import('./init.d.ts').Options } options
|
|
8
6
|
* @return { import('eslint').Linter.FlatConfig } */
|
|
9
|
-
function jest(
|
|
7
|
+
function jest() {
|
|
10
8
|
return {
|
|
11
9
|
files: globs.test,
|
|
12
10
|
plugins: { jest: plugin },
|
|
13
|
-
languageOptions: { globals: globals.jest },
|
|
14
11
|
rules: {
|
|
15
12
|
'jest/consistent-test-it': 'off',
|
|
16
13
|
'jest/expect-expect': 'off',
|
package/src/modules/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const reactPlugin = require('eslint-plugin
|
|
1
|
+
const reactPlugin = require('@eslint-react/eslint-plugin');
|
|
2
2
|
const hooksPlugin = require('eslint-plugin-react-hooks');
|
|
3
3
|
const a11yPlugin = require('eslint-plugin-jsx-a11y');
|
|
4
4
|
|
|
@@ -6,10 +6,15 @@ const a11yPlugin = require('eslint-plugin-jsx-a11y');
|
|
|
6
6
|
function react() {
|
|
7
7
|
return {
|
|
8
8
|
plugins: {
|
|
9
|
-
|
|
9
|
+
...reactPlugin.configs.all.plugins,
|
|
10
10
|
'react-hooks': hooksPlugin,
|
|
11
11
|
'jsx-a11y': a11yPlugin,
|
|
12
12
|
},
|
|
13
|
+
languageOptions: {
|
|
14
|
+
globals: {
|
|
15
|
+
React: 'readonly',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
13
18
|
settings: {
|
|
14
19
|
react: {
|
|
15
20
|
pragma: 'React',
|
|
@@ -17,93 +22,64 @@ function react() {
|
|
|
17
22
|
},
|
|
18
23
|
},
|
|
19
24
|
rules: {
|
|
20
|
-
'react/
|
|
21
|
-
'react/
|
|
22
|
-
'react/
|
|
23
|
-
'react/
|
|
24
|
-
'react/
|
|
25
|
-
'react/
|
|
26
|
-
'react/
|
|
27
|
-
'react/
|
|
28
|
-
'react/
|
|
29
|
-
'react/
|
|
30
|
-
'react/
|
|
31
|
-
|
|
32
|
-
'react/
|
|
33
|
-
'react/
|
|
34
|
-
'react/
|
|
35
|
-
'react/
|
|
36
|
-
'react/
|
|
37
|
-
'react/
|
|
38
|
-
'react/
|
|
39
|
-
'react/
|
|
40
|
-
'react/
|
|
41
|
-
'react/
|
|
42
|
-
'react/
|
|
43
|
-
'react/
|
|
44
|
-
'react/
|
|
45
|
-
'react/
|
|
46
|
-
'react/
|
|
47
|
-
'react/
|
|
48
|
-
'react/
|
|
49
|
-
'react/
|
|
50
|
-
'react/
|
|
51
|
-
'react/
|
|
52
|
-
'react/
|
|
53
|
-
'react/
|
|
54
|
-
'react/
|
|
55
|
-
'react/
|
|
56
|
-
'react/
|
|
57
|
-
'react/
|
|
58
|
-
'react/
|
|
59
|
-
'react/no-
|
|
60
|
-
'react/no-
|
|
61
|
-
'react/no-
|
|
62
|
-
'react/no-
|
|
63
|
-
'react/no-
|
|
64
|
-
'react/no-
|
|
65
|
-
'react/
|
|
66
|
-
'react/
|
|
67
|
-
'react/
|
|
68
|
-
|
|
69
|
-
'react/
|
|
70
|
-
'react/
|
|
71
|
-
'react/
|
|
72
|
-
'react/
|
|
73
|
-
|
|
74
|
-
'react/
|
|
75
|
-
'react/
|
|
76
|
-
'react/
|
|
77
|
-
'react/
|
|
78
|
-
'react/no-set-state': 'off',
|
|
79
|
-
'react/no-string-refs': 'error',
|
|
80
|
-
'react/no-this-in-sfc': 'error',
|
|
81
|
-
'react/no-typos': 'error',
|
|
82
|
-
'react/no-unescaped-entities': 'warn',
|
|
83
|
-
'react/no-unknown-property': 'error',
|
|
84
|
-
'react/no-unsafe': 'warn',
|
|
85
|
-
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
|
|
86
|
-
'react/no-unused-class-component-methods': 'warn',
|
|
87
|
-
'react/no-unused-prop-types': 'error',
|
|
88
|
-
'react/no-unused-state': 'error',
|
|
89
|
-
'react/no-will-update-set-state': 'error',
|
|
90
|
-
'react/prefer-es6-class': 'off',
|
|
91
|
-
'react/prefer-exact-props': 'off',
|
|
92
|
-
'react/prefer-read-only-props': 'off',
|
|
93
|
-
'react/prefer-stateless-function': 'off',
|
|
94
|
-
'react/prop-types': 'off',
|
|
95
|
-
'react/react-in-jsx-scope': 'off', // JSX automatic runtime
|
|
96
|
-
'react/require-default-props': 'off',
|
|
97
|
-
'react/require-optimization': 'off',
|
|
98
|
-
'react/require-render-return': 'error',
|
|
99
|
-
'react/self-closing-comp': 'error',
|
|
100
|
-
'react/sort-comp': 'off',
|
|
101
|
-
'react/sort-default-props': 'warn',
|
|
102
|
-
'react/sort-prop-types': 'off',
|
|
103
|
-
'react/state-in-constructor': 'off',
|
|
104
|
-
'react/static-property-placement': 'off',
|
|
105
|
-
'react/style-prop-object': 'error',
|
|
106
|
-
'react/void-dom-elements-no-children': 'error',
|
|
25
|
+
'@eslint-react/dom/no-children-in-void-dom-elements': 'warn',
|
|
26
|
+
'@eslint-react/dom/no-dangerously-set-innerhtml': 'warn',
|
|
27
|
+
'@eslint-react/dom/no-dangerously-set-innerhtml-with-children': 'error',
|
|
28
|
+
'@eslint-react/dom/no-find-dom-node': 'error',
|
|
29
|
+
'@eslint-react/dom/no-missing-button-type': 'warn',
|
|
30
|
+
'@eslint-react/dom/no-missing-iframe-sandbox': 'warn',
|
|
31
|
+
'@eslint-react/dom/no-namespace': 'error',
|
|
32
|
+
'@eslint-react/dom/no-render-return-value': 'error',
|
|
33
|
+
'@eslint-react/dom/no-script-url': 'warn',
|
|
34
|
+
'@eslint-react/dom/no-unsafe-iframe-sandbox': 'warn',
|
|
35
|
+
'@eslint-react/dom/no-unsafe-target-blank': 'warn',
|
|
36
|
+
|
|
37
|
+
'@eslint-react/ensure-forward-ref-using-ref': 'warn',
|
|
38
|
+
'@eslint-react/no-access-state-in-setstate': 'error',
|
|
39
|
+
'@eslint-react/no-array-index-key': 'warn',
|
|
40
|
+
'@eslint-react/no-children-count': 'warn',
|
|
41
|
+
'@eslint-react/no-children-for-each': 'warn',
|
|
42
|
+
'@eslint-react/no-children-map': 'warn',
|
|
43
|
+
'@eslint-react/no-children-only': 'warn',
|
|
44
|
+
'@eslint-react/no-children-prop': 'warn',
|
|
45
|
+
'@eslint-react/no-children-to-array': 'warn',
|
|
46
|
+
'@eslint-react/no-clone-element': 'warn',
|
|
47
|
+
'@eslint-react/no-comment-textnodes': 'warn',
|
|
48
|
+
'@eslint-react/no-component-will-mount': 'error',
|
|
49
|
+
'@eslint-react/no-component-will-receive-props': 'error',
|
|
50
|
+
'@eslint-react/no-component-will-update': 'error',
|
|
51
|
+
'@eslint-react/no-create-ref': 'error',
|
|
52
|
+
'@eslint-react/no-direct-mutation-state': 'error',
|
|
53
|
+
'@eslint-react/no-duplicate-key': 'error',
|
|
54
|
+
'@eslint-react/no-implicit-key': 'error',
|
|
55
|
+
'@eslint-react/no-missing-key': 'error',
|
|
56
|
+
'@eslint-react/no-nested-components': 'warn',
|
|
57
|
+
'@eslint-react/no-redundant-should-component-update': 'error',
|
|
58
|
+
'@eslint-react/no-set-state-in-component-did-mount': 'warn',
|
|
59
|
+
'@eslint-react/no-set-state-in-component-did-update': 'warn',
|
|
60
|
+
'@eslint-react/no-set-state-in-component-will-update': 'warn',
|
|
61
|
+
'@eslint-react/no-string-refs': 'error',
|
|
62
|
+
'@eslint-react/no-unsafe-component-will-mount': 'warn',
|
|
63
|
+
'@eslint-react/no-unsafe-component-will-receive-props': 'warn',
|
|
64
|
+
'@eslint-react/no-unsafe-component-will-update': 'warn',
|
|
65
|
+
'@eslint-react/no-unstable-context-value': 'error',
|
|
66
|
+
'@eslint-react/no-unstable-default-props': 'error',
|
|
67
|
+
'@eslint-react/no-unused-class-component-members': 'warn',
|
|
68
|
+
'@eslint-react/no-unused-state': 'warn',
|
|
69
|
+
'@eslint-react/no-useless-fragment': 'warn',
|
|
70
|
+
'@eslint-react/prefer-destructuring-assignment': 'warn',
|
|
71
|
+
'@eslint-react/prefer-shorthand-boolean': 'warn',
|
|
72
|
+
'@eslint-react/prefer-shorthand-fragment': 'warn',
|
|
73
|
+
|
|
74
|
+
'@eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks': 'warn',
|
|
75
|
+
'@eslint-react/hooks-extra/ensure-use-callback-has-non-empty-deps': 'warn',
|
|
76
|
+
'@eslint-react/hooks-extra/ensure-use-memo-has-non-empty-deps': 'warn',
|
|
77
|
+
'@eslint-react/hooks-extra/prefer-use-state-lazy-initialization': 'warn',
|
|
78
|
+
|
|
79
|
+
'@eslint-react/naming-convention/component-name': 'warn',
|
|
80
|
+
'@eslint-react/naming-convention/filename': 'warn',
|
|
81
|
+
'@eslint-react/naming-convention/filename-extension': 'warn',
|
|
82
|
+
'@eslint-react/naming-convention/use-state': 'warn',
|
|
107
83
|
|
|
108
84
|
'react-hooks/exhaustive-deps': 'warn',
|
|
109
85
|
'react-hooks/rules-of-hooks': 'error',
|
package/src/modules/strict.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
const { predicate } = require('../utils/conditions');
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* @param {import('../init.d.ts').Options} options
|
|
5
3
|
* @return { import('eslint').Linter.FlatConfig }
|
|
6
4
|
*/
|
|
7
|
-
function strict(
|
|
5
|
+
function strict() {
|
|
8
6
|
return {
|
|
9
7
|
rules: {
|
|
10
8
|
'no-console': 'warn',
|
|
11
|
-
// ...predicate(options.typescript, { '@typescript-eslint/no-non-null-assertion': 'warn' }),
|
|
12
9
|
},
|
|
13
10
|
};
|
|
14
11
|
}
|
package/src/modules/tailwind.js
CHANGED
package/src/modules/tests.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const plugin = require('eslint-plugin-jest-formatting');
|
|
2
|
+
const globals = require('globals');
|
|
2
3
|
const { globs } = require('../utils/globs');
|
|
3
4
|
const { predicate } = require('../utils/conditions');
|
|
4
|
-
const globals = require('globals');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {import('../init').Options} options
|
|
@@ -12,7 +12,7 @@ function tests(options = {}) {
|
|
|
12
12
|
plugins: { 'jest-formatting': plugin },
|
|
13
13
|
files: [...globs.test, ...globs.e2e],
|
|
14
14
|
languageOptions: {
|
|
15
|
-
globals: globals['shared-node-browser'],
|
|
15
|
+
globals: { ...globals['shared-node-browser'], ...globals.jest },
|
|
16
16
|
},
|
|
17
17
|
rules: {
|
|
18
18
|
'jest-formatting/padding-around-after-all-blocks': 'warn',
|
|
@@ -93,6 +93,7 @@ function typescript(options = {}) {
|
|
|
93
93
|
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
94
94
|
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
95
95
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
96
|
+
...predicate(options.strict, { '@typescript-eslint/no-non-null-assertion': 'warn' }),
|
|
96
97
|
'@typescript-eslint/no-redeclare': ['off', { ignoreDeclarationMerge: true }], // useful in FP.
|
|
97
98
|
'@typescript-eslint/no-require-imports': 'error',
|
|
98
99
|
'@typescript-eslint/no-restricted-imports': 'off',
|