@darksheep/eslint 10.1.0 โ 10.1.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 +35 -0
- package/package.json +17 -19
- package/src/index.js +0 -4
- package/src/plugins/json.js +0 -1
- package/src/plugins/perfectionist.js +17 -17
- package/src/types.d.ts +0 -37
- package/types/eslint.config.d.ts +1 -1
- package/types/src/custom-logger/index.d.ts +1 -1
- package/types/tests/helpers/linter.d.ts +1 -1
- package/src/plugins/react-native.js +0 -46
- package/src/plugins/react.js +0 -175
- package/types/src/plugins/react-native.d.ts +0 -7
- package/types/src/plugins/react.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [10.1.2](https://github.com/DarkSheepSoftware/eslint/compare/v10.1.1...v10.1.2) (2026-05-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ๐ฆ Dependencies
|
|
7
|
+
|
|
8
|
+
* **pkg:** update dependency @eslint/compat to v2.1.0 ([#1202](https://github.com/DarkSheepSoftware/eslint/issues/1202)) ([09fcfd8](https://github.com/DarkSheepSoftware/eslint/commit/09fcfd894e6d99385ea458686899277a82b2b346))
|
|
9
|
+
* **pkg:** update dependency eslint-plugin-n to v18 ([#1199](https://github.com/DarkSheepSoftware/eslint/issues/1199)) ([41a972e](https://github.com/DarkSheepSoftware/eslint/commit/41a972e7138000adb23e1ca062938b606b917aca))
|
|
10
|
+
* **pkg:** update dependency eslint-plugin-package-json to v0.91.2 ([#1197](https://github.com/DarkSheepSoftware/eslint/issues/1197)) ([0f96948](https://github.com/DarkSheepSoftware/eslint/commit/0f96948675e8e2a0622f86b69a5c63111426c3a5))
|
|
11
|
+
* **pkg:** update dependency eslint-plugin-perfectionist to v5.9.0 ([#1191](https://github.com/DarkSheepSoftware/eslint/issues/1191)) ([aa8bbe0](https://github.com/DarkSheepSoftware/eslint/commit/aa8bbe03ab190dfd5c7ef0c46dbd70efe30c3835))
|
|
12
|
+
* **pkg:** update dependency eslint-plugin-promise to v7.3.0 ([#1196](https://github.com/DarkSheepSoftware/eslint/issues/1196)) ([ded72f9](https://github.com/DarkSheepSoftware/eslint/commit/ded72f9b3331f7a712752ca4d727a6dd64b1beb1))
|
|
13
|
+
* **pkg:** update dependency eslint-plugin-yml to v3.3.2 ([#1198](https://github.com/DarkSheepSoftware/eslint/issues/1198)) ([11868c7](https://github.com/DarkSheepSoftware/eslint/commit/11868c7f5ffe0cddf9acc8aeb96563842310a197))
|
|
14
|
+
* **pkg:** update eslint monorepo to v10 ([d41beee](https://github.com/DarkSheepSoftware/eslint/commit/d41beee4ecada7ee2a75e2fed71ffef4aa43649b))
|
|
15
|
+
* **pkg:** update typescript-eslint monorepo to v8.59.2 ([#1194](https://github.com/DarkSheepSoftware/eslint/issues/1194)) ([fec2006](https://github.com/DarkSheepSoftware/eslint/commit/fec2006358b7ce129f511a1eb85538fbb953b2b8))
|
|
16
|
+
* **pkg:** update typescript-eslint monorepo to v8.59.3 ([#1204](https://github.com/DarkSheepSoftware/eslint/issues/1204)) ([876fe32](https://github.com/DarkSheepSoftware/eslint/commit/876fe32487d509424c7f15de70d2b30e66cd35cd))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### ๐งน Chores
|
|
20
|
+
|
|
21
|
+
* **react:** remove react and react-native plugin support ([e5bdfb2](https://github.com/DarkSheepSoftware/eslint/commit/e5bdfb296e362df82afa322b2dcd514a47007633))
|
|
22
|
+
* **types:** remove redundant workarounds now handled by eslint v10 ([39d8221](https://github.com/DarkSheepSoftware/eslint/commit/39d8221baf646846bac6623d216e3a409ffdfa6e))
|
|
23
|
+
* yarn dedupe ([eaaf1d1](https://github.com/DarkSheepSoftware/eslint/commit/eaaf1d15c8c53e177dc6090dfc65f4efa1631f90))
|
|
24
|
+
|
|
25
|
+
## [10.1.1](https://github.com/DarkSheepSoftware/eslint/compare/v10.1.0...v10.1.1) (2026-04-17)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### ๐ฉน Fixes
|
|
29
|
+
|
|
30
|
+
* Disable sorting of objects ([#1190](https://github.com/DarkSheepSoftware/eslint/issues/1190)) ([118ea80](https://github.com/DarkSheepSoftware/eslint/commit/118ea80f17d52d52d68a541ed2c7919231d7a946))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### ๐ฆ Dependencies
|
|
34
|
+
|
|
35
|
+
* **pkg:** update dependency eslint-plugin-jest to v29.15.2 ([#1176](https://github.com/DarkSheepSoftware/eslint/issues/1176)) ([75b30a6](https://github.com/DarkSheepSoftware/eslint/commit/75b30a61237c67cb972086f0b4127de1ae40fc16))
|
|
36
|
+
* **pkg:** update typescript-eslint monorepo to v8.58.2 ([#1172](https://github.com/DarkSheepSoftware/eslint/issues/1172)) ([5b6f4aa](https://github.com/DarkSheepSoftware/eslint/commit/5b6f4aa9285cdf8bf16bfcfc4d81661e331f3c6e))
|
|
37
|
+
|
|
3
38
|
## [10.1.0](https://github.com/DarkSheepSoftware/eslint/compare/v10.0.7...v10.1.0) (2026-04-08)
|
|
4
39
|
|
|
5
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darksheep/eslint",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"description": "A fairly complete (opinionated) eslint config",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,37 +27,35 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@darksheep/environment": "3.2.0",
|
|
29
29
|
"@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
|
|
30
|
-
"@eslint/compat": "2.0
|
|
31
|
-
"@eslint/js": "
|
|
30
|
+
"@eslint/compat": "2.1.0",
|
|
31
|
+
"@eslint/js": "10.0.1",
|
|
32
32
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
34
|
-
"@typescript-eslint/parser": "8.
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "8.59.3",
|
|
34
|
+
"@typescript-eslint/parser": "8.59.3",
|
|
35
35
|
"editorconfig": "3.0.2",
|
|
36
36
|
"eslint-plugin-command": "3.5.2",
|
|
37
|
-
"eslint-plugin-jest": "29.15.
|
|
37
|
+
"eslint-plugin-jest": "29.15.2",
|
|
38
38
|
"eslint-plugin-jsdoc": "62.9.0",
|
|
39
39
|
"eslint-plugin-jsonc": "3.1.2",
|
|
40
|
-
"eslint-plugin-n": "
|
|
41
|
-
"eslint-plugin-package-json": "0.91.
|
|
42
|
-
"eslint-plugin-perfectionist": "5.
|
|
43
|
-
"eslint-plugin-promise": "7.
|
|
44
|
-
"eslint-plugin-react": "7.37.5",
|
|
45
|
-
"eslint-plugin-react-native": "5.0.0",
|
|
40
|
+
"eslint-plugin-n": "18.0.1",
|
|
41
|
+
"eslint-plugin-package-json": "0.91.2",
|
|
42
|
+
"eslint-plugin-perfectionist": "5.9.0",
|
|
43
|
+
"eslint-plugin-promise": "7.3.0",
|
|
46
44
|
"eslint-plugin-regexp": "3.1.0",
|
|
47
45
|
"eslint-plugin-security": "4.0.0",
|
|
48
46
|
"eslint-plugin-unicorn": "64.0.0",
|
|
49
47
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
50
|
-
"eslint-plugin-yml": "3.3.
|
|
48
|
+
"eslint-plugin-yml": "3.3.2",
|
|
51
49
|
"jsonc-eslint-parser": "3.1.0",
|
|
52
50
|
"yaml-eslint-parser": "2.0.0"
|
|
53
51
|
},
|
|
54
52
|
"devDependencies": {
|
|
55
|
-
"@darksheep/eslint-formatter-github": "2.2.
|
|
53
|
+
"@darksheep/eslint-formatter-github": "2.2.1",
|
|
56
54
|
"@darksheep/package.json": "~3.1.0",
|
|
57
|
-
"@eslint/config-inspector": "~
|
|
55
|
+
"@eslint/config-inspector": "~3.0.0",
|
|
58
56
|
"@types/node": "~24.12.0",
|
|
59
57
|
"dedent": "~1.7.2",
|
|
60
|
-
"eslint": "~
|
|
58
|
+
"eslint": "~10.3.0",
|
|
61
59
|
"typescript": "~6.0.0"
|
|
62
60
|
},
|
|
63
61
|
"peerDependenciesMeta": {
|
|
@@ -68,12 +66,12 @@
|
|
|
68
66
|
"optional": true
|
|
69
67
|
}
|
|
70
68
|
},
|
|
71
|
-
"packageManager": "yarn@4.
|
|
69
|
+
"packageManager": "yarn@4.14.1",
|
|
72
70
|
"engines": {
|
|
73
71
|
"node": "^20.13.1 || >=22.2.0"
|
|
74
72
|
},
|
|
75
73
|
"volta": {
|
|
76
|
-
"node": "24.
|
|
77
|
-
"yarn": "4.
|
|
74
|
+
"node": "24.15.0",
|
|
75
|
+
"yarn": "4.14.1"
|
|
78
76
|
}
|
|
79
77
|
}
|
package/src/index.js
CHANGED
|
@@ -18,8 +18,6 @@ import { createEslintNodeConfig } from './plugins/node.js';
|
|
|
18
18
|
import { createEslintPackageJsonConfig } from './plugins/package-json.js';
|
|
19
19
|
import { createEslintPerfectionistConfig } from './plugins/perfectionist.js';
|
|
20
20
|
import { createEslintPromiseConfig } from './plugins/promise.js';
|
|
21
|
-
import { createEslintReactNativeConfig } from './plugins/react-native.js';
|
|
22
|
-
import { createEslintReactConfig } from './plugins/react.js';
|
|
23
21
|
import { createEslintRegexpConfig } from './plugins/regexp.js';
|
|
24
22
|
import { createEslintSCAConfig } from './plugins/sca.js';
|
|
25
23
|
import { createEslintSecurityConfig } from './plugins/security.js';
|
|
@@ -45,8 +43,6 @@ const configBuilders = [
|
|
|
45
43
|
createEslintYmlConfig,
|
|
46
44
|
createEslintPromiseConfig,
|
|
47
45
|
createEslintTypescriptConfig,
|
|
48
|
-
createEslintReactConfig,
|
|
49
|
-
createEslintReactNativeConfig,
|
|
50
46
|
createReactConfig,
|
|
51
47
|
createEslintSecurityConfig,
|
|
52
48
|
createEslintUnicornConfig,
|
package/src/plugins/json.js
CHANGED
|
@@ -25,7 +25,6 @@ export async function createEslintJsonConfig() {
|
|
|
25
25
|
name: 'json/core',
|
|
26
26
|
files: [ '**/*.json', '**/*.jsonc', '**/*.json5' ],
|
|
27
27
|
languageOptions: { parser },
|
|
28
|
-
// @ts-expect-error -- This used to work >,<
|
|
29
28
|
plugins: { jsonc },
|
|
30
29
|
rules: {
|
|
31
30
|
'jsonc/auto': 'off',
|
|
@@ -31,13 +31,13 @@ const commonRules = {
|
|
|
31
31
|
],
|
|
32
32
|
},
|
|
33
33
|
],
|
|
34
|
-
'perfectionist/sort-array':
|
|
35
|
-
'perfectionist/sort-array-includes':
|
|
34
|
+
'perfectionist/sort-array': 'off',
|
|
35
|
+
'perfectionist/sort-array-includes': 'off',
|
|
36
36
|
'perfectionist/sort-decorators': 'off',
|
|
37
37
|
'perfectionist/sort-heritage-clauses': 'off',
|
|
38
|
-
'perfectionist/sort-maps':
|
|
38
|
+
'perfectionist/sort-maps': 'off',
|
|
39
39
|
'perfectionist/sort-modules': 'off',
|
|
40
|
-
'perfectionist/sort-objects':
|
|
40
|
+
'perfectionist/sort-objects': 'off',
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
/** @type {Linter.RulesRecord} */
|
|
@@ -106,19 +106,19 @@ const moduleRules = {
|
|
|
106
106
|
|
|
107
107
|
/** @type {Linter.RulesRecord} */
|
|
108
108
|
const typescriptRules = {
|
|
109
|
-
'perfectionist/sort-astro-attributes':
|
|
110
|
-
'perfectionist/sort-enums':
|
|
111
|
-
'perfectionist/sort-interfaces':
|
|
112
|
-
'perfectionist/sort-intersection-types':
|
|
113
|
-
'perfectionist/sort-jsx-props':
|
|
114
|
-
'perfectionist/sort-object-types':
|
|
115
|
-
'perfectionist/sort-objects':
|
|
116
|
-
'perfectionist/sort-sets':
|
|
117
|
-
'perfectionist/sort-svelte-attributes':
|
|
118
|
-
'perfectionist/sort-switch-case':
|
|
119
|
-
'perfectionist/sort-union-types':
|
|
120
|
-
'perfectionist/sort-variable-declarations':
|
|
121
|
-
'perfectionist/sort-vue-attributes':
|
|
109
|
+
'perfectionist/sort-astro-attributes': 'off',
|
|
110
|
+
'perfectionist/sort-enums': 'off',
|
|
111
|
+
'perfectionist/sort-interfaces': 'off',
|
|
112
|
+
'perfectionist/sort-intersection-types': 'off',
|
|
113
|
+
'perfectionist/sort-jsx-props': 'off',
|
|
114
|
+
'perfectionist/sort-object-types': 'off',
|
|
115
|
+
'perfectionist/sort-objects': 'off',
|
|
116
|
+
'perfectionist/sort-sets': 'off',
|
|
117
|
+
'perfectionist/sort-svelte-attributes': 'off',
|
|
118
|
+
'perfectionist/sort-switch-case': 'off',
|
|
119
|
+
'perfectionist/sort-union-types': 'off',
|
|
120
|
+
'perfectionist/sort-variable-declarations': 'off',
|
|
121
|
+
'perfectionist/sort-vue-attributes': 'off',
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
/**
|
package/src/types.d.ts
CHANGED
|
@@ -3,33 +3,6 @@
|
|
|
3
3
|
n/no-unpublished-import: ["error", { "allowModules": [ "eslint" ] } ]
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
declare module '@eslint/js' {
|
|
7
|
-
import type { ESLint } from 'eslint';
|
|
8
|
-
export default {
|
|
9
|
-
configs: {
|
|
10
|
-
all: WithRequired<ESLint.ConfigData, 'rules'>,
|
|
11
|
-
recommended: WithRequired<ESLint.ConfigData, 'rules'>,
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
17
|
-
|
|
18
|
-
declare module '@eslint-community/eslint-plugin-eslint-comments' {
|
|
19
|
-
import type { ESLint } from 'eslint';
|
|
20
|
-
export default {} as ESLint.Plugin;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare module 'eslint-plugin-perfectionist' {
|
|
24
|
-
import type { ESLint } from 'eslint';
|
|
25
|
-
export default {} as ESLint.Plugin;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
declare module '@stylistic/eslint-plugin' {
|
|
29
|
-
import type { ESLint } from 'eslint';
|
|
30
|
-
export default {} as WithRequired<ESLint.Plugin, 'environments'>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
6
|
declare module 'eslint-plugin-promise' {
|
|
34
7
|
import type { ESLint } from 'eslint';
|
|
35
8
|
export default {} as {
|
|
@@ -40,16 +13,6 @@ declare module 'eslint-plugin-promise' {
|
|
|
40
13
|
};
|
|
41
14
|
}
|
|
42
15
|
|
|
43
|
-
declare module 'eslint-plugin-react' {
|
|
44
|
-
import type { ESLint } from 'eslint';
|
|
45
|
-
export default {} as ESLint.Plugin;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
declare module 'eslint-plugin-react-native' {
|
|
49
|
-
import type { ESLint } from 'eslint';
|
|
50
|
-
export default {} as ESLint.Plugin;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
16
|
declare module 'eslint-plugin-security' {
|
|
54
17
|
import type { ESLint } from 'eslint';
|
|
55
18
|
export default {} as {
|
package/types/eslint.config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: (import("eslint").Linter.Config<import(".store/@eslint-core-npm-
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import(".store/@eslint-core-npm-1.2.1-99bf82852d/package", { with: { "resolution-mode": "require" } }).RulesConfig> | {
|
|
2
2
|
rules: {
|
|
3
3
|
'max-lines-per-function': number;
|
|
4
4
|
};
|
|
@@ -2,7 +2,7 @@ declare const _default: {
|
|
|
2
2
|
processors: {
|
|
3
3
|
logger: {
|
|
4
4
|
supportsAutofix: true;
|
|
5
|
-
postprocess: (messages: import(".store/@eslint-core-npm-
|
|
5
|
+
postprocess: (messages: import(".store/@eslint-core-npm-1.2.1-99bf82852d/package", { with: { "resolution-mode": "require" } }).LintMessage[][], filename: string) => import(".store/@eslint-core-npm-1.2.1-99bf82852d/package", { with: { "resolution-mode": "require" } }).LintMessage[];
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
};
|
|
@@ -17,7 +17,7 @@ export function createLinter(configs: import("eslint").Linter.Config[]): {
|
|
|
17
17
|
* @param {string} code
|
|
18
18
|
* @param {string} [filename]
|
|
19
19
|
*/
|
|
20
|
-
verify(code: string, filename?: string): import(".store/@eslint-core-npm-
|
|
20
|
+
verify(code: string, filename?: string): import(".store/@eslint-core-npm-1.2.1-99bf82852d/package", { with: { "resolution-mode": "require" } }).LintMessage[];
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* Builds the full config from the given URL, then disables projectService and
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import { Linter } from 'eslint';
|
|
3
|
-
*/
|
|
4
|
-
import { fixupPluginRules } from '@eslint/compat';
|
|
5
|
-
import reactnative from 'eslint-plugin-react-native';
|
|
6
|
-
|
|
7
|
-
import { getPackageJson } from '../utilities/package.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get ESLint config for imports check.
|
|
11
|
-
* @param {URL} root - The root of the package being linted.
|
|
12
|
-
* @returns {Promise<Linter.Config[]>}
|
|
13
|
-
*/
|
|
14
|
-
export async function createEslintReactNativeConfig(root) {
|
|
15
|
-
const packageJson = await getPackageJson(root, 'react-native');
|
|
16
|
-
if (packageJson == null) {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return [
|
|
21
|
-
{
|
|
22
|
-
name: 'react-native',
|
|
23
|
-
files: [ '**/*.jsx', '**/*.tsx' ],
|
|
24
|
-
languageOptions: {
|
|
25
|
-
parserOptions: {
|
|
26
|
-
ecmaFeatures: { jsx: true },
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
plugins: { 'react-native': fixupPluginRules(reactnative) },
|
|
30
|
-
rules: {
|
|
31
|
-
// Trialing
|
|
32
|
-
'react-native/no-unused-styles': [ 'warn' ],
|
|
33
|
-
'react-native/no-inline-styles': [ 'warn' ],
|
|
34
|
-
'react-native/no-color-literals': [ 'warn' ],
|
|
35
|
-
|
|
36
|
-
// Stable
|
|
37
|
-
'react-native/no-raw-text': [ 'error', { skip: [ 'ThemedText' ] } ],
|
|
38
|
-
'react-native/no-single-element-style-arrays': [ 'error' ],
|
|
39
|
-
'react-native/split-platform-components': [ 'error' ],
|
|
40
|
-
|
|
41
|
-
// Perfectionist sorts these
|
|
42
|
-
'react-native/sort-styles': [ 'off' ],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
}
|
package/src/plugins/react.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import { Linter } from 'eslint';
|
|
3
|
-
*/
|
|
4
|
-
import react from 'eslint-plugin-react';
|
|
5
|
-
|
|
6
|
-
import { getPackageJson } from '../utilities/package.js';
|
|
7
|
-
/** @type {Linter.RulesRecord} */
|
|
8
|
-
const disabledStyle = {
|
|
9
|
-
'react/jsx-child-element-spacing': 'off',
|
|
10
|
-
'react/jsx-closing-bracket-location': 'off',
|
|
11
|
-
'react/jsx-closing-tag-location': 'off',
|
|
12
|
-
'react/jsx-curly-spacing': 'off',
|
|
13
|
-
'react/jsx-curly-newline': 'off',
|
|
14
|
-
'react/jsx-equals-spacing': 'off',
|
|
15
|
-
'react/jsx-first-prop-new-line': 'off',
|
|
16
|
-
'react/jsx-indent': 'off',
|
|
17
|
-
'react/jsx-indent-props': 'off',
|
|
18
|
-
'react/jsx-max-props-per-line': 'off',
|
|
19
|
-
'react/jsx-newline': 'off',
|
|
20
|
-
'react/jsx-one-expression-per-line': 'off',
|
|
21
|
-
'react/jsx-curly-brace-presence': 'off',
|
|
22
|
-
'react/jsx-props-no-multi-spaces': 'off',
|
|
23
|
-
'react/jsx-props-no-spread-multi': 'off',
|
|
24
|
-
'react/jsx-sort-props': 'off',
|
|
25
|
-
'react/jsx-tag-spacing': 'off',
|
|
26
|
-
'react/jsx-wrap-multilines': 'off',
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/** @type {Linter.RulesRecord} */
|
|
30
|
-
const rules = {
|
|
31
|
-
...disabledStyle,
|
|
32
|
-
'react/boolean-prop-naming': 'off',
|
|
33
|
-
'react/button-has-type': 'off',
|
|
34
|
-
'react/checked-requires-onchange-or-readonly': 'off',
|
|
35
|
-
'react/default-props-match-prop-types': 'off',
|
|
36
|
-
'react/destructuring-assignment': 'off',
|
|
37
|
-
'react/display-name': 'error',
|
|
38
|
-
'react/forbid-component-props': 'off',
|
|
39
|
-
'react/forbid-dom-props': 'off',
|
|
40
|
-
'react/forbid-elements': 'off',
|
|
41
|
-
'react/forbid-foreign-prop-types': 'off',
|
|
42
|
-
'react/forbid-prop-types': 'off',
|
|
43
|
-
'react/forward-ref-uses-ref': 'off',
|
|
44
|
-
'react/function-component-definition': 'off',
|
|
45
|
-
'react/hook-use-state': 'off',
|
|
46
|
-
'react/iframe-missing-sandbox': 'off',
|
|
47
|
-
'react/jsx-boolean-value': 'off',
|
|
48
|
-
'react/jsx-filename-extension': 'off',
|
|
49
|
-
'react/jsx-fragments': 'off',
|
|
50
|
-
'react/jsx-handler-names': 'off',
|
|
51
|
-
'react/jsx-key': 'error',
|
|
52
|
-
'react/jsx-max-depth': 'off',
|
|
53
|
-
'react/jsx-no-bind': 'warn',
|
|
54
|
-
'react/jsx-no-comment-textnodes': 'error',
|
|
55
|
-
'react/jsx-no-constructed-context-values': 'off',
|
|
56
|
-
'react/jsx-no-duplicate-props': 'error',
|
|
57
|
-
'react/jsx-no-leaked-render': 'off',
|
|
58
|
-
'react/jsx-no-literals': 'off',
|
|
59
|
-
'react/jsx-no-script-url': 'off',
|
|
60
|
-
'react/jsx-no-target-blank': 'error',
|
|
61
|
-
'react/jsx-no-undef': 'error',
|
|
62
|
-
'react/jsx-no-useless-fragment': 'off',
|
|
63
|
-
'react/jsx-pascal-case': 'off',
|
|
64
|
-
'react/jsx-props-no-spreading': 'off',
|
|
65
|
-
'react/jsx-uses-react': 'error',
|
|
66
|
-
'react/jsx-uses-vars': 'error',
|
|
67
|
-
'react/no-access-state-in-setstate': 'off',
|
|
68
|
-
'react/no-adjacent-inline-elements': 'off',
|
|
69
|
-
'react/no-array-index-key': 'off',
|
|
70
|
-
'react/no-arrow-function-lifecycle': 'off',
|
|
71
|
-
'react/no-children-prop': 'error',
|
|
72
|
-
'react/no-danger-with-children': 'error',
|
|
73
|
-
'react/no-danger': 'off',
|
|
74
|
-
'react/no-deprecated': 'error',
|
|
75
|
-
'react/no-did-mount-set-state': 'off',
|
|
76
|
-
'react/no-did-update-set-state': 'off',
|
|
77
|
-
'react/no-direct-mutation-state': 'error',
|
|
78
|
-
'react/no-find-dom-node': 'error',
|
|
79
|
-
'react/no-invalid-html-attribute': 'off',
|
|
80
|
-
'react/no-is-mounted': 'error',
|
|
81
|
-
'react/no-multi-comp': 'off',
|
|
82
|
-
'react/no-namespace': 'off',
|
|
83
|
-
'react/no-object-type-as-default-prop': 'off',
|
|
84
|
-
'react/no-redundant-should-component-update': 'off',
|
|
85
|
-
'react/no-render-return-value': 'error',
|
|
86
|
-
'react/no-set-state': 'off',
|
|
87
|
-
'react/no-string-refs': 'error',
|
|
88
|
-
'react/no-this-in-sfc': 'off',
|
|
89
|
-
'react/no-typos': 'off',
|
|
90
|
-
'react/no-unescaped-entities': 'error',
|
|
91
|
-
'react/no-unknown-property': 'error',
|
|
92
|
-
'react/no-unsafe': 'off',
|
|
93
|
-
'react/no-unstable-nested-components': 'off',
|
|
94
|
-
'react/no-unused-class-component-methods': 'off',
|
|
95
|
-
'react/no-unused-prop-types': 'off',
|
|
96
|
-
'react/no-unused-state': 'off',
|
|
97
|
-
'react/no-will-update-set-state': 'off',
|
|
98
|
-
'react/prefer-es6-class': 'off',
|
|
99
|
-
'react/prefer-exact-props': 'off',
|
|
100
|
-
'react/prefer-read-only-props': 'off',
|
|
101
|
-
'react/prefer-stateless-function': 'off',
|
|
102
|
-
'react/prop-types': 'error',
|
|
103
|
-
'react/react-in-jsx-scope': 'error',
|
|
104
|
-
'react/require-default-props': 'off',
|
|
105
|
-
'react/require-optimization': 'off',
|
|
106
|
-
'react/require-render-return': 'error',
|
|
107
|
-
'react/self-closing-comp': 'off',
|
|
108
|
-
'react/sort-comp': 'off',
|
|
109
|
-
'react/sort-default-props': 'off',
|
|
110
|
-
'react/sort-prop-types': 'off',
|
|
111
|
-
'react/state-in-constructor': 'off',
|
|
112
|
-
'react/static-property-placement': 'off',
|
|
113
|
-
'react/style-prop-object': 'off',
|
|
114
|
-
'react/void-dom-elements-no-children': 'off',
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Get ESLint config for imports check.
|
|
119
|
-
* @param {URL} root - The root of the package being linted.
|
|
120
|
-
* @returns {Promise<Linter.Config[]>}
|
|
121
|
-
*/
|
|
122
|
-
export async function createEslintReactConfig(root) {
|
|
123
|
-
const packageJson = await getPackageJson(root, 'react');
|
|
124
|
-
if (packageJson == null) {
|
|
125
|
-
return [
|
|
126
|
-
{
|
|
127
|
-
name: 'common/jsx',
|
|
128
|
-
files: [ '**/*.jsx', '**/*.tsx' ],
|
|
129
|
-
languageOptions: {
|
|
130
|
-
parserOptions: {
|
|
131
|
-
ecmaFeatures: { jsx: true },
|
|
132
|
-
jsxPragma: null,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
plugins: { react },
|
|
136
|
-
rules: {
|
|
137
|
-
...Object.fromEntries(Object.entries(rules).map(([ rule ]) => [ rule, 'off' ])),
|
|
138
|
-
'react/jsx-uses-vars': 'error',
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
];
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return [
|
|
145
|
-
{
|
|
146
|
-
name: 'react/jsx',
|
|
147
|
-
files: [ '**/*.jsx' ],
|
|
148
|
-
languageOptions: {
|
|
149
|
-
parserOptions: {
|
|
150
|
-
ecmaFeatures: { jsx: true },
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
settings: {
|
|
154
|
-
react: { version: packageJson.version },
|
|
155
|
-
},
|
|
156
|
-
plugins: { react },
|
|
157
|
-
rules: rules,
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: 'react/tsx',
|
|
161
|
-
files: [ '**/*.tsx' ],
|
|
162
|
-
languageOptions: {
|
|
163
|
-
parserOptions: {
|
|
164
|
-
ecmaFeatures: { jsx: true },
|
|
165
|
-
jsxPragma: null,
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
settings: {
|
|
169
|
-
react: { version: packageJson.version },
|
|
170
|
-
},
|
|
171
|
-
plugins: { react },
|
|
172
|
-
rules: rules,
|
|
173
|
-
},
|
|
174
|
-
];
|
|
175
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get ESLint config for imports check.
|
|
3
|
-
* @param {URL} root - The root of the package being linted.
|
|
4
|
-
* @returns {Promise<Linter.Config[]>}
|
|
5
|
-
*/
|
|
6
|
-
export function createEslintReactNativeConfig(root: URL): Promise<Linter.Config[]>;
|
|
7
|
-
import type { Linter } from 'eslint';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get ESLint config for imports check.
|
|
3
|
-
* @param {URL} root - The root of the package being linted.
|
|
4
|
-
* @returns {Promise<Linter.Config[]>}
|
|
5
|
-
*/
|
|
6
|
-
export function createEslintReactConfig(root: URL): Promise<Linter.Config[]>;
|
|
7
|
-
import type { Linter } from 'eslint';
|