@darksheep/eslint 6.6.0 → 6.6.2
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 +30 -0
- package/package.json +5 -5
- package/src/plugins/react.js +101 -84
- package/src/plugins/typescript.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [6.6.2](https://github.com/DarkSheepSoftware/eslint/compare/v6.6.1...v6.6.2) (2024-10-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🩹 Fixes
|
|
7
|
+
|
|
8
|
+
* **jsx:** jsx marks variables as used ([#685](https://github.com/DarkSheepSoftware/eslint/issues/685)) ([e0e461d](https://github.com/DarkSheepSoftware/eslint/commit/e0e461d07c3517922bf3c6e9ace3665554763062))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### 📦 Dependencies
|
|
12
|
+
|
|
13
|
+
* **pkg:** update dependency eslint-plugin-perfectionist to v3.9.0 ([#684](https://github.com/DarkSheepSoftware/eslint/issues/684)) ([9196a9c](https://github.com/DarkSheepSoftware/eslint/commit/9196a9c8a5227990d5939d66d8ca11a17c149c8d))
|
|
14
|
+
* **pkg:** update typescript-eslint monorepo to v8.9.0 ([#682](https://github.com/DarkSheepSoftware/eslint/issues/682)) ([0924d77](https://github.com/DarkSheepSoftware/eslint/commit/0924d774c7f4dca11462ac7db1baa124501387ac))
|
|
15
|
+
|
|
16
|
+
## [6.6.1](https://github.com/DarkSheepSoftware/eslint/compare/v6.6.0...v6.6.1) (2024-10-14)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 🩹 Fixes
|
|
20
|
+
|
|
21
|
+
* Only run react checks if react is installed ([b204942](https://github.com/DarkSheepSoftware/eslint/commit/b204942a0e5898a588c7c127dd543fb544ffb1fd))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### 📦 Dependencies
|
|
25
|
+
|
|
26
|
+
* **pkg:** update dependency eslint-plugin-jsdoc to v50.4.1 ([#681](https://github.com/DarkSheepSoftware/eslint/issues/681)) ([e824396](https://github.com/DarkSheepSoftware/eslint/commit/e824396c22589b4d3519bdd66916cbe3868477f7))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### 🧹 Chores
|
|
30
|
+
|
|
31
|
+
* Still parse jsx without react ([88df905](https://github.com/DarkSheepSoftware/eslint/commit/88df90560c759b724566e5d0364339edd17b30ff))
|
|
32
|
+
|
|
3
33
|
## [6.6.0](https://github.com/DarkSheepSoftware/eslint/compare/v6.5.4...v6.6.0) (2024-10-14)
|
|
4
34
|
|
|
5
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darksheep/eslint",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/DarkSheepSoftware/eslint"
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"@eslint-community/eslint-plugin-eslint-comments": "4.4.0",
|
|
27
27
|
"@eslint/js": "9.12.0",
|
|
28
28
|
"@stylistic/eslint-plugin": "2.9.0",
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
30
|
-
"@typescript-eslint/parser": "8.
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "8.9.0",
|
|
30
|
+
"@typescript-eslint/parser": "8.9.0",
|
|
31
31
|
"editorconfig": "2.0.0",
|
|
32
|
-
"eslint-plugin-jsdoc": "50.4.
|
|
32
|
+
"eslint-plugin-jsdoc": "50.4.1",
|
|
33
33
|
"eslint-plugin-jsonc": "2.16.0",
|
|
34
34
|
"eslint-plugin-n": "17.11.1",
|
|
35
35
|
"eslint-plugin-package-json": "0.15.3",
|
|
36
|
-
"eslint-plugin-perfectionist": "3.
|
|
36
|
+
"eslint-plugin-perfectionist": "3.9.0",
|
|
37
37
|
"eslint-plugin-promise": "7.1.0",
|
|
38
38
|
"eslint-plugin-react": "7.37.1",
|
|
39
39
|
"eslint-plugin-regexp": "2.6.0",
|
package/src/plugins/react.js
CHANGED
|
@@ -4,88 +4,87 @@ import { getPackageJson } from '../utilities/package.js';
|
|
|
4
4
|
|
|
5
5
|
/** @type {import('eslint').Linter.RulesRecord} */
|
|
6
6
|
const rules = {
|
|
7
|
-
'react/
|
|
8
|
-
'react/
|
|
9
|
-
'react/
|
|
10
|
-
'react/
|
|
11
|
-
'react/
|
|
12
|
-
'react/
|
|
13
|
-
'react/
|
|
14
|
-
'react/
|
|
15
|
-
'react/
|
|
16
|
-
'react/
|
|
17
|
-
'react/
|
|
18
|
-
'react/
|
|
19
|
-
'react/
|
|
20
|
-
'react/
|
|
21
|
-
'react/
|
|
22
|
-
'react/
|
|
23
|
-
'react/
|
|
24
|
-
'react/
|
|
25
|
-
'react/
|
|
26
|
-
'react/
|
|
27
|
-
'react/
|
|
28
|
-
'react/
|
|
29
|
-
|
|
30
|
-
'react/
|
|
31
|
-
'react/
|
|
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/no-
|
|
56
|
-
'react/no-
|
|
57
|
-
'react/no-
|
|
58
|
-
'react/no-
|
|
59
|
-
'react/no-
|
|
60
|
-
'react/no-
|
|
61
|
-
'react/no-
|
|
62
|
-
'react/no-
|
|
63
|
-
'react/no-
|
|
64
|
-
'react/no-
|
|
65
|
-
'react/no-
|
|
66
|
-
'react/no-
|
|
67
|
-
'react/no-
|
|
68
|
-
'react/no-
|
|
69
|
-
'react/no-
|
|
70
|
-
'react/no-
|
|
71
|
-
'react/
|
|
72
|
-
'react/
|
|
73
|
-
'react/
|
|
74
|
-
'react/
|
|
75
|
-
'react/
|
|
76
|
-
'react/
|
|
77
|
-
'react/
|
|
78
|
-
'react/
|
|
79
|
-
'react/require-
|
|
80
|
-
'react/
|
|
81
|
-
'react/
|
|
82
|
-
'react/sort-
|
|
83
|
-
'react/sort-
|
|
84
|
-
'react/
|
|
85
|
-
'react/
|
|
86
|
-
'react/
|
|
87
|
-
'react/
|
|
88
|
-
'react/void-dom-elements-no-children': 0,
|
|
7
|
+
'react/boolean-prop-naming': 'off',
|
|
8
|
+
'react/button-has-type': 'off',
|
|
9
|
+
'react/default-props-match-prop-types': 'off',
|
|
10
|
+
'react/destructuring-assignment': 'off',
|
|
11
|
+
'react/display-name': 'error',
|
|
12
|
+
'react/forbid-component-props': 'off',
|
|
13
|
+
'react/forbid-dom-props': 'off',
|
|
14
|
+
'react/forbid-elements': 'off',
|
|
15
|
+
'react/forbid-foreign-prop-types': 'off',
|
|
16
|
+
'react/forbid-prop-types': 'off',
|
|
17
|
+
'react/function-component-definition': 'off',
|
|
18
|
+
'react/hook-use-state': 'off',
|
|
19
|
+
'react/iframe-missing-sandbox': 'off',
|
|
20
|
+
'react/jsx-boolean-value': 'off',
|
|
21
|
+
'react/jsx-filename-extension': 'off',
|
|
22
|
+
'react/jsx-fragments': 'off',
|
|
23
|
+
'react/jsx-handler-names': 'off',
|
|
24
|
+
'react/jsx-key': 'error',
|
|
25
|
+
'react/jsx-max-depth': 'off',
|
|
26
|
+
'react/jsx-no-bind': 'error',
|
|
27
|
+
'react/jsx-no-comment-textnodes': 'error',
|
|
28
|
+
'react/jsx-no-constructed-context-values': 'off',
|
|
29
|
+
'react/jsx-no-duplicate-props': 'error',
|
|
30
|
+
'react/jsx-no-leaked-render': 'off',
|
|
31
|
+
'react/jsx-no-literals': 'off',
|
|
32
|
+
'react/jsx-no-script-url': 'off',
|
|
33
|
+
'react/jsx-no-target-blank': 'error',
|
|
34
|
+
'react/jsx-no-undef': 'error',
|
|
35
|
+
'react/jsx-no-useless-fragment': 'off',
|
|
36
|
+
'react/jsx-pascal-case': 'off',
|
|
37
|
+
'react/jsx-props-no-spreading': 'off',
|
|
38
|
+
'react/jsx-uses-react': 'error',
|
|
39
|
+
'react/jsx-uses-vars': 'error',
|
|
40
|
+
'react/no-access-state-in-setstate': 'off',
|
|
41
|
+
'react/no-adjacent-inline-elements': 'off',
|
|
42
|
+
'react/no-array-index-key': 'off',
|
|
43
|
+
'react/no-arrow-function-lifecycle': 'off',
|
|
44
|
+
'react/no-children-prop': 'error',
|
|
45
|
+
'react/no-danger-with-children': 'error',
|
|
46
|
+
'react/no-danger': 'off',
|
|
47
|
+
'react/no-deprecated': 'error',
|
|
48
|
+
'react/no-did-mount-set-state': 'off',
|
|
49
|
+
'react/no-did-update-set-state': 'off',
|
|
50
|
+
'react/no-direct-mutation-state': 'error',
|
|
51
|
+
'react/no-find-dom-node': 'error',
|
|
52
|
+
'react/no-invalid-html-attribute': 'off',
|
|
53
|
+
'react/no-is-mounted': 'error',
|
|
54
|
+
'react/no-multi-comp': 'off',
|
|
55
|
+
'react/no-namespace': 'off',
|
|
56
|
+
'react/no-object-type-as-default-prop': 'off',
|
|
57
|
+
'react/no-redundant-should-component-update': 'off',
|
|
58
|
+
'react/no-render-return-value': 'error',
|
|
59
|
+
'react/no-set-state': 'off',
|
|
60
|
+
'react/no-string-refs': 'error',
|
|
61
|
+
'react/no-this-in-sfc': 'off',
|
|
62
|
+
'react/no-typos': 'off',
|
|
63
|
+
'react/no-unescaped-entities': 'error',
|
|
64
|
+
'react/no-unknown-property': 'error',
|
|
65
|
+
'react/no-unsafe': 'off',
|
|
66
|
+
'react/no-unstable-nested-components': 'off',
|
|
67
|
+
'react/no-unused-class-component-methods': 'off',
|
|
68
|
+
'react/no-unused-prop-types': 'off',
|
|
69
|
+
'react/no-unused-state': 'off',
|
|
70
|
+
'react/no-will-update-set-state': 'off',
|
|
71
|
+
'react/prefer-es6-class': 'off',
|
|
72
|
+
'react/prefer-exact-props': 'off',
|
|
73
|
+
'react/prefer-read-only-props': 'off',
|
|
74
|
+
'react/prefer-stateless-function': 'off',
|
|
75
|
+
'react/prop-types': 'error',
|
|
76
|
+
'react/react-in-jsx-scope': 'error',
|
|
77
|
+
'react/require-default-props': 'off',
|
|
78
|
+
'react/require-optimization': 'off',
|
|
79
|
+
'react/require-render-return': 'error',
|
|
80
|
+
'react/self-closing-comp': 'off',
|
|
81
|
+
'react/sort-comp': 'off',
|
|
82
|
+
'react/sort-default-props': 'off',
|
|
83
|
+
'react/sort-prop-types': 'off',
|
|
84
|
+
'react/state-in-constructor': 'off',
|
|
85
|
+
'react/static-property-placement': 'off',
|
|
86
|
+
'react/style-prop-object': 'off',
|
|
87
|
+
'react/void-dom-elements-no-children': 'off',
|
|
89
88
|
};
|
|
90
89
|
|
|
91
90
|
/**
|
|
@@ -95,6 +94,24 @@ const rules = {
|
|
|
95
94
|
*/
|
|
96
95
|
export async function createEslintReactConfig(root) {
|
|
97
96
|
const packageJson = await getPackageJson(root, 'react');
|
|
97
|
+
if (packageJson == null) {
|
|
98
|
+
return [
|
|
99
|
+
{
|
|
100
|
+
name: 'common/jsx',
|
|
101
|
+
files: [ '**/*.jsx', '**/*.tsx' ],
|
|
102
|
+
languageOptions: {
|
|
103
|
+
parserOptions: {
|
|
104
|
+
ecmaFeatures: { jsx: true },
|
|
105
|
+
jsxPragma: null,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
plugins: { react },
|
|
109
|
+
rules: {
|
|
110
|
+
'react/jsx-uses-vars': 'error',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
}
|
|
98
115
|
|
|
99
116
|
return [
|
|
100
117
|
{
|
|
@@ -106,7 +123,7 @@ export async function createEslintReactConfig(root) {
|
|
|
106
123
|
},
|
|
107
124
|
},
|
|
108
125
|
settings: {
|
|
109
|
-
react: { version: packageJson
|
|
126
|
+
react: { version: packageJson.version },
|
|
110
127
|
},
|
|
111
128
|
plugins: { react },
|
|
112
129
|
rules: rules,
|
|
@@ -121,7 +138,7 @@ export async function createEslintReactConfig(root) {
|
|
|
121
138
|
},
|
|
122
139
|
},
|
|
123
140
|
settings: {
|
|
124
|
-
react: { version: packageJson
|
|
141
|
+
react: { version: packageJson.version },
|
|
125
142
|
},
|
|
126
143
|
plugins: { react },
|
|
127
144
|
rules: rules,
|