@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 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.0",
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.8.1",
30
- "@typescript-eslint/parser": "8.8.1",
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.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",
36
- "eslint-plugin-perfectionist": "3.8.0",
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",
@@ -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,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?.version },
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?.version },
141
+ react: { version: packageJson.version },
125
142
  },
126
143
  plugins: { react },
127
144
  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
  }