@darksheep/eslint 6.5.4 โ†’ 6.6.1

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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.6.1](https://github.com/DarkSheepSoftware/eslint/compare/v6.6.0...v6.6.1) (2024-10-14)
4
+
5
+
6
+ ### ๐Ÿฉน Fixes
7
+
8
+ * Only run react checks if react is installed ([b204942](https://github.com/DarkSheepSoftware/eslint/commit/b204942a0e5898a588c7c127dd543fb544ffb1fd))
9
+
10
+
11
+ ### ๐Ÿ“ฆ Dependencies
12
+
13
+ * **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))
14
+
15
+
16
+ ### ๐Ÿงน Chores
17
+
18
+ * Still parse jsx without react ([88df905](https://github.com/DarkSheepSoftware/eslint/commit/88df90560c759b724566e5d0364339edd17b30ff))
19
+
20
+ ## [6.6.0](https://github.com/DarkSheepSoftware/eslint/compare/v6.5.4...v6.6.0) (2024-10-14)
21
+
22
+
23
+ ### ๐ŸŒŸ Features
24
+
25
+ * **prefer-const:** Allow let when destructuring ([050bdb4](https://github.com/DarkSheepSoftware/eslint/commit/050bdb4cb34647a2f482b364f23bb045cde045c9))
26
+
3
27
  ## [6.5.4](https://github.com/DarkSheepSoftware/eslint/compare/v6.5.3...v6.5.4) (2024-10-14)
4
28
 
5
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darksheep/eslint",
3
- "version": "6.5.4",
3
+ "version": "6.6.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/DarkSheepSoftware/eslint"
@@ -29,7 +29,7 @@
29
29
  "@typescript-eslint/eslint-plugin": "8.8.1",
30
30
  "@typescript-eslint/parser": "8.8.1",
31
31
  "editorconfig": "2.0.0",
32
- "eslint-plugin-jsdoc": "50.4.0",
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",
@@ -50,7 +50,7 @@ const rules = {
50
50
  allowUnboundThis: true,
51
51
  },
52
52
  ],
53
- 'prefer-const': 'error',
53
+ 'prefer-const': [ 'error', { destructuring: 'all' } ],
54
54
  'prefer-destructuring': [
55
55
  'error',
56
56
  { array: false, object: true },
@@ -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/display-name': 2,
8
- 'react/jsx-key': 2,
9
- 'react/jsx-no-comment-textnodes': 2,
10
- 'react/jsx-no-duplicate-props': 2,
11
- 'react/jsx-no-target-blank': 2,
12
- 'react/jsx-no-undef': 2,
13
- 'react/jsx-uses-react': 2,
14
- 'react/jsx-uses-vars': 2,
15
- 'react/no-children-prop': 2,
16
- 'react/no-danger-with-children': 2,
17
- 'react/no-deprecated': 2,
18
- 'react/no-direct-mutation-state': 2,
19
- 'react/no-find-dom-node': 2,
20
- 'react/no-is-mounted': 2,
21
- 'react/no-render-return-value': 2,
22
- 'react/no-string-refs': 2,
23
- 'react/no-unescaped-entities': 2,
24
- 'react/no-unknown-property': 2,
25
- 'react/no-unsafe': 0,
26
- 'react/prop-types': 2,
27
- 'react/react-in-jsx-scope': 2,
28
- 'react/require-render-return': 2,
29
-
30
- 'react/boolean-prop-naming': 0,
31
- 'react/button-has-type': 0,
32
- 'react/default-props-match-prop-types': 0,
33
- 'react/destructuring-assignment': 0,
34
- 'react/forbid-component-props': 0,
35
- 'react/forbid-dom-props': 0,
36
- 'react/forbid-elements': 0,
37
- 'react/forbid-foreign-prop-types': 0,
38
- 'react/forbid-prop-types': 0,
39
- 'react/function-component-definition': 0,
40
- 'react/hook-use-state': 0,
41
- 'react/iframe-missing-sandbox': 0,
42
- 'react/jsx-boolean-value': 0,
43
- 'react/jsx-filename-extension': 0,
44
- 'react/jsx-handler-names': 0,
45
- 'react/jsx-max-depth': 0,
46
- 'react/jsx-no-bind': 0,
47
- 'react/jsx-no-constructed-context-values': 0,
48
- 'react/jsx-no-leaked-render': 0,
49
- 'react/jsx-no-literals': 0,
50
- 'react/jsx-no-script-url': 0,
51
- 'react/jsx-no-useless-fragment': 0,
52
- 'react/jsx-pascal-case': 0,
53
- 'react/jsx-fragments': 0,
54
- 'react/jsx-props-no-spreading': 0,
55
- 'react/no-invalid-html-attribute': 0,
56
- 'react/no-access-state-in-setstate': 0,
57
- 'react/no-adjacent-inline-elements': 0,
58
- 'react/no-array-index-key': 0,
59
- 'react/no-arrow-function-lifecycle': 0,
60
- 'react/no-danger': 0,
61
- 'react/no-did-mount-set-state': 0,
62
- 'react/no-did-update-set-state': 0,
63
- 'react/no-multi-comp': 0,
64
- 'react/no-namespace': 0,
65
- 'react/no-set-state': 0,
66
- 'react/no-redundant-should-component-update': 0,
67
- 'react/no-this-in-sfc': 0,
68
- 'react/no-typos': 0,
69
- 'react/no-unstable-nested-components': 0,
70
- 'react/no-unused-class-component-methods': 0,
71
- 'react/no-unused-prop-types': 0,
72
- 'react/no-unused-state': 0,
73
- 'react/no-object-type-as-default-prop': 0,
74
- 'react/no-will-update-set-state': 0,
75
- 'react/prefer-es6-class': 0,
76
- 'react/prefer-exact-props': 0,
77
- 'react/prefer-read-only-props': 0,
78
- 'react/prefer-stateless-function': 0,
79
- 'react/require-default-props': 0,
80
- 'react/require-optimization': 0,
81
- 'react/self-closing-comp': 0,
82
- 'react/sort-comp': 0,
83
- 'react/sort-default-props': 0,
84
- 'react/sort-prop-types': 0,
85
- 'react/state-in-constructor': 0,
86
- 'react/static-property-placement': 0,
87
- 'react/style-prop-object': 0,
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,20 @@ 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
+ },
109
+ ];
110
+ }
98
111
 
99
112
  return [
100
113
  {
@@ -106,7 +119,7 @@ export async function createEslintReactConfig(root) {
106
119
  },
107
120
  },
108
121
  settings: {
109
- react: { version: packageJson?.version },
122
+ react: { version: packageJson.version },
110
123
  },
111
124
  plugins: { react },
112
125
  rules: rules,
@@ -121,7 +134,7 @@ export async function createEslintReactConfig(root) {
121
134
  },
122
135
  },
123
136
  settings: {
124
- react: { version: packageJson?.version },
137
+ react: { version: packageJson.version },
125
138
  },
126
139
  plugins: { react },
127
140
  rules: rules,
@@ -17,8 +17,6 @@ function idef(target) {
17
17
  */
18
18
  export async function createEslintTypescriptConfig(root) {
19
19
  const packageJson = await getPackageJson(root, 'typescript');
20
-
21
- // Typescript not installed
22
20
  if (packageJson == null) {
23
21
  return [];
24
22
  }
@@ -61,7 +59,6 @@ export async function createEslintTypescriptConfig(root) {
61
59
 
62
60
  // Rules that prevert some commmon ts issues
63
61
  'no-var': 'error',
64
- 'prefer-const': 'error',
65
62
  'prefer-rest-params': 'error',
66
63
  'prefer-spread': 'error',
67
64