@darksheep/eslint 6.7.8 โ 6.8.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 +32 -0
- package/package.json +12 -12
- package/src/custom-rules/loose-types.js +12 -1
- package/src/plugins/eslint-comments.js +3 -2
- package/src/plugins/package-json.js +8 -1
- package/src/plugins/perfectionist.js +3 -0
- package/src/plugins/promise.js +1 -0
- package/src/plugins/react.js +25 -0
- package/src/plugins/style.js +1 -0
- package/src/plugins/typescript.js +63 -0
- package/src/plugins/unicorn.js +4 -1
- package/src/types.d.ts +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [6.8.1](https://github.com/DarkSheepSoftware/eslint/compare/v6.8.0...v6.8.1) (2025-02-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ๐งน Chores
|
|
7
|
+
|
|
8
|
+
* why u break things typescript ([b6a1ff1](https://github.com/DarkSheepSoftware/eslint/commit/b6a1ff151f4493bce0e370caef916bb6f563c6f2))
|
|
9
|
+
|
|
10
|
+
## [6.8.0](https://github.com/DarkSheepSoftware/eslint/compare/v6.7.8...v6.8.0) (2025-02-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ๐ Features
|
|
14
|
+
|
|
15
|
+
* no-keyword-prefix - checkProperties: false ([6c4f38b](https://github.com/DarkSheepSoftware/eslint/commit/6c4f38bf3f9ccc6b88aaffbf8217beb7c0720ba8))
|
|
16
|
+
* Update some missing rules ([6acf90f](https://github.com/DarkSheepSoftware/eslint/commit/6acf90ff2442775aad5f277e7b2d89c30bed7d8e))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### ๐ฆ Dependencies
|
|
20
|
+
|
|
21
|
+
* **pkg:** update dependency @stylistic/eslint-plugin to v4 ([#834](https://github.com/DarkSheepSoftware/eslint/issues/834)) ([200ad37](https://github.com/DarkSheepSoftware/eslint/commit/200ad3779eb843bc8bdf80015b2d0cc495fe06f1))
|
|
22
|
+
* **pkg:** update dependency editorconfig to v2.0.1 ([#823](https://github.com/DarkSheepSoftware/eslint/issues/823)) ([fb6251c](https://github.com/DarkSheepSoftware/eslint/commit/fb6251cc9fbf1843320566d416e7d27c6eddd314))
|
|
23
|
+
* **pkg:** update dependency eslint-plugin-package-json to v0.26.0 ([#822](https://github.com/DarkSheepSoftware/eslint/issues/822)) ([9aeeff5](https://github.com/DarkSheepSoftware/eslint/commit/9aeeff5129c6a5edd3c206ffe2e9ea195d9e389e))
|
|
24
|
+
* **pkg:** update dependency eslint-plugin-perfectionist to v4.9.0 ([#837](https://github.com/DarkSheepSoftware/eslint/issues/837)) ([9225f97](https://github.com/DarkSheepSoftware/eslint/commit/9225f97e23803accd9f40d8b2ac525f044da13ee))
|
|
25
|
+
* **pkg:** update dependency eslint-plugin-yml to v1.17.0 ([#833](https://github.com/DarkSheepSoftware/eslint/issues/833)) ([39c876c](https://github.com/DarkSheepSoftware/eslint/commit/39c876c2efab1faded19d22d25e75043b155bb72))
|
|
26
|
+
* **pkg:** update eslint monorepo ([#824](https://github.com/DarkSheepSoftware/eslint/issues/824)) ([fe04e20](https://github.com/DarkSheepSoftware/eslint/commit/fe04e204a7f7746f58d040aa066f199c8dc14e42))
|
|
27
|
+
* **pkg:** update typescript-eslint monorepo to v8.24.1 ([#827](https://github.com/DarkSheepSoftware/eslint/issues/827)) ([31b6e9b](https://github.com/DarkSheepSoftware/eslint/commit/31b6e9bd5149bfb2cf5e0c1c887a5b11baeef7b1))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### ๐งน Chores
|
|
31
|
+
|
|
32
|
+
* enable projectService ([6beeec7](https://github.com/DarkSheepSoftware/eslint/commit/6beeec752c5ac32c8b8df1024508624c8faeab8a))
|
|
33
|
+
* eslint . --fix ([52de94a](https://github.com/DarkSheepSoftware/eslint/commit/52de94a2ffde870c87b224370f06c1352034aee8))
|
|
34
|
+
|
|
3
35
|
## [6.7.8](https://github.com/DarkSheepSoftware/eslint/compare/v6.7.7...v6.7.8) (2025-02-04)
|
|
4
36
|
|
|
5
37
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darksheep/eslint",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/DarkSheepSoftware/eslint"
|
|
@@ -24,31 +24,31 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@darksheep/environment": "3.1.0",
|
|
26
26
|
"@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
|
|
27
|
-
"@eslint/js": "9.
|
|
28
|
-
"@stylistic/eslint-plugin": "
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
30
|
-
"@typescript-eslint/parser": "8.
|
|
31
|
-
"editorconfig": "2.0.
|
|
27
|
+
"@eslint/js": "9.20.0",
|
|
28
|
+
"@stylistic/eslint-plugin": "4.0.1",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "8.24.1",
|
|
30
|
+
"@typescript-eslint/parser": "8.24.1",
|
|
31
|
+
"editorconfig": "2.0.1",
|
|
32
32
|
"eslint-plugin-jsdoc": "50.6.3",
|
|
33
33
|
"eslint-plugin-jsonc": "2.19.1",
|
|
34
34
|
"eslint-plugin-n": "17.15.1",
|
|
35
|
-
"eslint-plugin-package-json": "0.
|
|
36
|
-
"eslint-plugin-perfectionist": "4.
|
|
35
|
+
"eslint-plugin-package-json": "0.26.0",
|
|
36
|
+
"eslint-plugin-perfectionist": "4.9.0",
|
|
37
37
|
"eslint-plugin-promise": "7.2.1",
|
|
38
38
|
"eslint-plugin-react": "7.37.4",
|
|
39
39
|
"eslint-plugin-regexp": "2.7.0",
|
|
40
40
|
"eslint-plugin-security": "3.0.1",
|
|
41
41
|
"eslint-plugin-unicorn": "56.0.1",
|
|
42
42
|
"eslint-plugin-unused-imports": "4.1.4",
|
|
43
|
-
"eslint-plugin-yml": "1.
|
|
43
|
+
"eslint-plugin-yml": "1.17.0",
|
|
44
44
|
"jsonc-eslint-parser": "2.4.0",
|
|
45
45
|
"yaml-eslint-parser": "1.2.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@darksheep/eslint-formatter-github": "2.1.0",
|
|
49
49
|
"@types/node": "~22.13.0",
|
|
50
|
-
"eslint": "~9.
|
|
51
|
-
"type-fest": "~4.
|
|
50
|
+
"eslint": "~9.20.0",
|
|
51
|
+
"type-fest": "~4.35.0",
|
|
52
52
|
"typescript": "~5.7.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"node": "^20 || ^22"
|
|
65
65
|
},
|
|
66
66
|
"volta": {
|
|
67
|
-
"node": "22.
|
|
67
|
+
"node": "22.14.0",
|
|
68
68
|
"yarn": "4.6.0"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {unknown} input - The possible object.
|
|
3
|
+
* @returns {input is { [key: string]: unknown }}
|
|
4
|
+
*/
|
|
5
|
+
function isObject(input) {
|
|
6
|
+
return typeof input === 'object' && input != null;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* @param {string} optionName - Name of the property option.
|
|
3
11
|
* @param {import('eslint').Rule.RuleContext} context - ESLint rule context.
|
|
@@ -12,7 +20,10 @@ function createReporter(optionName, context, message) {
|
|
|
12
20
|
* @returns {void}
|
|
13
21
|
*/
|
|
14
22
|
function validateNode(node) {
|
|
15
|
-
if (
|
|
23
|
+
if (
|
|
24
|
+
isObject(options) &&
|
|
25
|
+
options[optionName] !== true
|
|
26
|
+
) {
|
|
16
27
|
context.report({ node, message });
|
|
17
28
|
}
|
|
18
29
|
}
|
|
@@ -15,12 +15,13 @@ export function createEslintCommentsConfig() {
|
|
|
15
15
|
'eslint-comments/disable-enable-pair': [ 'error', { allowWholeFile: true } ],
|
|
16
16
|
'eslint-comments/no-aggregating-enable': 'error',
|
|
17
17
|
'eslint-comments/no-duplicate-disable': 'error',
|
|
18
|
+
'eslint-comments/no-restricted-disable': 'off',
|
|
18
19
|
'eslint-comments/no-unlimited-disable': 'error',
|
|
19
20
|
'eslint-comments/no-unused-disable': 'error',
|
|
20
21
|
'eslint-comments/no-unused-enable': 'error',
|
|
22
|
+
'eslint-comments/no-use': 'off',
|
|
23
|
+
'eslint-comments/require-description': 'off',
|
|
21
24
|
|
|
22
|
-
'line-comment-position': 'off',
|
|
23
|
-
'multiline-comment-style': 'off',
|
|
24
25
|
'no-inline-comments': 'off',
|
|
25
26
|
},
|
|
26
27
|
},
|
|
@@ -16,14 +16,21 @@ export async function createEslintPackageJsonConfig() {
|
|
|
16
16
|
},
|
|
17
17
|
files: [ 'package.json', '**/package.json' ],
|
|
18
18
|
rules: {
|
|
19
|
+
'package-json/no-empty-fields': 'error',
|
|
20
|
+
'package-json/no-redundant-files': 'error',
|
|
19
21
|
'package-json/order-properties': [ 'error', { order: 'sort-package-json' } ],
|
|
20
22
|
'package-json/prefer-repository-shorthand': 'off',
|
|
21
23
|
'package-json/repository-shorthand': [ 'error', { form: 'object' } ],
|
|
24
|
+
'package-json/require-author': 'off',
|
|
25
|
+
'package-json/require-files': 'warn',
|
|
26
|
+
'package-json/require-keywords': 'off',
|
|
27
|
+
'package-json/require-name': 'error',
|
|
28
|
+
'package-json/require-version': 'error',
|
|
22
29
|
'package-json/sort-collections': 'error',
|
|
23
30
|
'package-json/unique-dependencies': 'error',
|
|
24
31
|
'package-json/valid-local-dependency': 'error',
|
|
25
32
|
'package-json/valid-name': 'error',
|
|
26
|
-
'package-json/valid-package-
|
|
33
|
+
'package-json/valid-package-definition': 'warn',
|
|
27
34
|
'package-json/valid-repository-directory': 'error',
|
|
28
35
|
'package-json/valid-version': 'error',
|
|
29
36
|
},
|
|
@@ -29,7 +29,10 @@ const commonRules = {
|
|
|
29
29
|
},
|
|
30
30
|
],
|
|
31
31
|
'perfectionist/sort-array-includes': 0,
|
|
32
|
+
'perfectionist/sort-decorators': 'off',
|
|
33
|
+
'perfectionist/sort-heritage-clauses': 'off',
|
|
32
34
|
'perfectionist/sort-maps': 0,
|
|
35
|
+
'perfectionist/sort-modules': 'off',
|
|
33
36
|
'perfectionist/sort-objects': 0,
|
|
34
37
|
};
|
|
35
38
|
|
package/src/plugins/promise.js
CHANGED
|
@@ -15,6 +15,7 @@ export function createEslintPromiseConfig() {
|
|
|
15
15
|
'promise/no-return-wrap': [ 'error', { allowReject: true } ],
|
|
16
16
|
'promise/prefer-await-to-callbacks': 'off',
|
|
17
17
|
'promise/prefer-await-to-then': 'off',
|
|
18
|
+
'promise/prefer-catch': 'error',
|
|
18
19
|
'promise/spec-only': 'error',
|
|
19
20
|
},
|
|
20
21
|
} ];
|
package/src/plugins/react.js
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
import react from 'eslint-plugin-react';
|
|
2
2
|
|
|
3
3
|
import { getPackageJson } from '../utilities/package.js';
|
|
4
|
+
/** @type {import('eslint').Linter.RulesRecord} */
|
|
5
|
+
const disabledStyle = {
|
|
6
|
+
'react/jsx-child-element-spacing': 'off',
|
|
7
|
+
'react/jsx-closing-bracket-location': 'off',
|
|
8
|
+
'react/jsx-closing-tag-location': 'off',
|
|
9
|
+
'react/jsx-curly-spacing': 'off',
|
|
10
|
+
'react/jsx-curly-newline': 'off',
|
|
11
|
+
'react/jsx-equals-spacing': 'off',
|
|
12
|
+
'react/jsx-first-prop-new-line': 'off',
|
|
13
|
+
'react/jsx-indent': 'off',
|
|
14
|
+
'react/jsx-indent-props': 'off',
|
|
15
|
+
'react/jsx-max-props-per-line': 'off',
|
|
16
|
+
'react/jsx-newline': 'off',
|
|
17
|
+
'react/jsx-one-expression-per-line': 'off',
|
|
18
|
+
'react/jsx-curly-brace-presence': 'off',
|
|
19
|
+
'react/jsx-props-no-multi-spaces': 'off',
|
|
20
|
+
'react/jsx-props-no-spread-multi': 'off',
|
|
21
|
+
'react/jsx-sort-props': 'off',
|
|
22
|
+
'react/jsx-tag-spacing': 'off',
|
|
23
|
+
'react/jsx-wrap-multilines': 'off',
|
|
24
|
+
};
|
|
4
25
|
|
|
5
26
|
/** @type {import('eslint').Linter.RulesRecord} */
|
|
6
27
|
const rules = {
|
|
28
|
+
...disabledStyle,
|
|
7
29
|
'react/boolean-prop-naming': 'off',
|
|
8
30
|
'react/button-has-type': 'off',
|
|
31
|
+
'react/checked-requires-onchange-or-readonly': 'off',
|
|
9
32
|
'react/default-props-match-prop-types': 'off',
|
|
10
33
|
'react/destructuring-assignment': 'off',
|
|
11
34
|
'react/display-name': 'error',
|
|
@@ -14,6 +37,7 @@ const rules = {
|
|
|
14
37
|
'react/forbid-elements': 'off',
|
|
15
38
|
'react/forbid-foreign-prop-types': 'off',
|
|
16
39
|
'react/forbid-prop-types': 'off',
|
|
40
|
+
'react/forward-ref-uses-ref': 'off',
|
|
17
41
|
'react/function-component-definition': 'off',
|
|
18
42
|
'react/hook-use-state': 'off',
|
|
19
43
|
'react/iframe-missing-sandbox': 'off',
|
|
@@ -107,6 +131,7 @@ export async function createEslintReactConfig(root) {
|
|
|
107
131
|
},
|
|
108
132
|
plugins: { react },
|
|
109
133
|
rules: {
|
|
134
|
+
...Object.fromEntries(Object.entries(rules).map(([ rule ]) => [ rule, 'off' ])),
|
|
110
135
|
'react/jsx-uses-vars': 'error',
|
|
111
136
|
},
|
|
112
137
|
},
|
package/src/plugins/style.js
CHANGED
|
@@ -20,6 +20,7 @@ export function createEslintStyleConfig() {
|
|
|
20
20
|
'style/comma-spacing': [ 'error', { before: false, after: true } ],
|
|
21
21
|
'style/comma-style': [ 'error', 'last' ],
|
|
22
22
|
'style/computed-property-spacing': [ 'error', 'never' ],
|
|
23
|
+
'style/curly-newline': [ 'error', { consistent: true } ],
|
|
23
24
|
'style/dot-location': [ 'error', 'property' ],
|
|
24
25
|
'style/func-call-spacing': [ 'error', 'never' ],
|
|
25
26
|
'style/function-call-argument-newline': [ 'error', 'consistent' ],
|
|
@@ -31,6 +31,7 @@ export async function createEslintTypescriptConfig(root) {
|
|
|
31
31
|
parser: typescriptParser,
|
|
32
32
|
sourceType: 'module',
|
|
33
33
|
parserOptions: {
|
|
34
|
+
projectService: true,
|
|
34
35
|
warnOnUnsupportedTypeScriptVersion: false,
|
|
35
36
|
},
|
|
36
37
|
},
|
|
@@ -40,6 +41,7 @@ export async function createEslintTypescriptConfig(root) {
|
|
|
40
41
|
rules: {
|
|
41
42
|
// Rules that fight with typescript
|
|
42
43
|
'constructor-super': 'off',
|
|
44
|
+
'dot-notation': 'off',
|
|
43
45
|
'getter-return': 'off',
|
|
44
46
|
'no-const-assign': 'off',
|
|
45
47
|
'no-dupe-args': 'off',
|
|
@@ -80,6 +82,67 @@ export async function createEslintTypescriptConfig(root) {
|
|
|
80
82
|
'@typescript-eslint/no-require-imports': 'error',
|
|
81
83
|
'@typescript-eslint/prefer-as-const': 'error',
|
|
82
84
|
'@typescript-eslint/triple-slash-reference': 'error',
|
|
85
|
+
|
|
86
|
+
// custom extras
|
|
87
|
+
'@typescript-eslint/adjacent-overload-signatures': 'off',
|
|
88
|
+
'@typescript-eslint/array-type': 'error',
|
|
89
|
+
'@typescript-eslint/await-thenable': 'warn',
|
|
90
|
+
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
91
|
+
'@typescript-eslint/class-literal-property-style': 'off',
|
|
92
|
+
'@typescript-eslint/class-methods-use-this': 'off',
|
|
93
|
+
'@typescript-eslint/consistent-generic-constructors': 'off',
|
|
94
|
+
'@typescript-eslint/consistent-indexed-object-style': [ 'error', 'index-signature' ],
|
|
95
|
+
'@typescript-eslint/consistent-return': 'off',
|
|
96
|
+
'@typescript-eslint/consistent-type-assertions': 'off',
|
|
97
|
+
'@typescript-eslint/consistent-type-definitions': [ 'error', 'type' ],
|
|
98
|
+
'@typescript-eslint/consistent-type-exports': [ 'error', { fixMixedExportsWithInlineTypeSpecifier: true } ],
|
|
99
|
+
'@typescript-eslint/consistent-type-imports': [ 'error', { fixStyle: 'inline-type-imports', prefer: 'no-type-imports' } ],
|
|
100
|
+
'@typescript-eslint/default-param-last': 'off',
|
|
101
|
+
'@typescript-eslint/dot-notation': 'error',
|
|
102
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
103
|
+
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
104
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
105
|
+
'@typescript-eslint/init-declarations': 'off',
|
|
106
|
+
'@typescript-eslint/max-params': 'off',
|
|
107
|
+
'@typescript-eslint/member-ordering': 'off',
|
|
108
|
+
'@typescript-eslint/method-signature-style': 'off',
|
|
109
|
+
'@typescript-eslint/naming-convention': 'off',
|
|
110
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
111
|
+
'@typescript-eslint/no-base-to-string': 'warn',
|
|
112
|
+
'@typescript-eslint/no-confusing-non-null-assertion': 'warn',
|
|
113
|
+
'@typescript-eslint/no-confusing-void-expression': 'warn',
|
|
114
|
+
'@typescript-eslint/no-deprecated': 'error',
|
|
115
|
+
'@typescript-eslint/only-throw-error': 'error',
|
|
116
|
+
'@typescript-eslint/prefer-destructuring': 'off',
|
|
117
|
+
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
118
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
119
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
120
|
+
'@typescript-eslint/prefer-function-type': 'off',
|
|
121
|
+
'@typescript-eslint/prefer-includes': 'error',
|
|
122
|
+
'@typescript-eslint/prefer-literal-enum-member': 'off',
|
|
123
|
+
'@typescript-eslint/prefer-namespace-keyword': 'off',
|
|
124
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
125
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
126
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'error',
|
|
127
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
128
|
+
'@typescript-eslint/prefer-readonly': 'off',
|
|
129
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
|
|
130
|
+
'@typescript-eslint/prefer-regexp-exec': 'off',
|
|
131
|
+
'@typescript-eslint/prefer-return-this-type': 'off',
|
|
132
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
133
|
+
'@typescript-eslint/promise-function-async': 'off',
|
|
134
|
+
'@typescript-eslint/related-getter-setter-pairs': 'off',
|
|
135
|
+
'@typescript-eslint/require-array-sort-compare': 'off',
|
|
136
|
+
'@typescript-eslint/require-await': 'warn',
|
|
137
|
+
'@typescript-eslint/restrict-plus-operands': 'error',
|
|
138
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
139
|
+
'@typescript-eslint/return-await': 'off',
|
|
140
|
+
'@typescript-eslint/strict-boolean-expressions': 'error',
|
|
141
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'off',
|
|
142
|
+
'@typescript-eslint/typedef': 'off',
|
|
143
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
144
|
+
'@typescript-eslint/unified-signatures': [ 'warn', { ignoreDifferentlyNamedParameters: true } ],
|
|
145
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
|
|
83
146
|
},
|
|
84
147
|
} ];
|
|
85
148
|
}
|
package/src/plugins/unicorn.js
CHANGED
|
@@ -28,6 +28,7 @@ export async function createEslintUnicornConfig(root) {
|
|
|
28
28
|
'unicorn/catch-error-name': 'error',
|
|
29
29
|
'unicorn/consistent-destructuring': 'off',
|
|
30
30
|
'unicorn/consistent-empty-array-spread': 'error',
|
|
31
|
+
'unicorn/consistent-existence-index-check': 'warn',
|
|
31
32
|
'unicorn/consistent-function-scoping': 'warn',
|
|
32
33
|
'unicorn/custom-error-definition': 'off',
|
|
33
34
|
'unicorn/empty-brace-spaces': 'off',
|
|
@@ -55,7 +56,7 @@ export async function createEslintUnicornConfig(root) {
|
|
|
55
56
|
'unicorn/no-instanceof-array': 'off',
|
|
56
57
|
'unicorn/no-invalid-fetch-options': 'off',
|
|
57
58
|
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
58
|
-
'unicorn/no-keyword-prefix': 'warn',
|
|
59
|
+
'unicorn/no-keyword-prefix': [ 'warn', { checkProperties: false } ],
|
|
59
60
|
'unicorn/no-length-as-slice-end': 'warn',
|
|
60
61
|
'unicorn/no-lonely-if': 'warn',
|
|
61
62
|
'unicorn/no-magic-array-flat-depth': 'off', // Breaks typescript
|
|
@@ -103,10 +104,12 @@ export async function createEslintUnicornConfig(root) {
|
|
|
103
104
|
'unicorn/prefer-dom-node-text-content': 'error',
|
|
104
105
|
'unicorn/prefer-event-target': 'warn',
|
|
105
106
|
'unicorn/prefer-export-from': 'warn',
|
|
107
|
+
'unicorn/prefer-global-this': 'warn',
|
|
106
108
|
'unicorn/prefer-includes': 'error',
|
|
107
109
|
'unicorn/prefer-json-parse-buffer': 'error',
|
|
108
110
|
'unicorn/prefer-keyboard-event-key': 'error',
|
|
109
111
|
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
112
|
+
'unicorn/prefer-math-min-max': 'error',
|
|
110
113
|
'unicorn/prefer-math-trunc': 'error',
|
|
111
114
|
'unicorn/prefer-modern-dom-apis': 'error',
|
|
112
115
|
'unicorn/prefer-modern-math-apis': 'error',
|
package/src/types.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
/* eslint
|
|
1
|
+
/* eslint
|
|
2
|
+
no-duplicate-imports: 0,
|
|
3
|
+
n/no-unpublished-import: ["error", { "allowModules": [ "eslint" ] } ]
|
|
4
|
+
*/
|
|
2
5
|
|
|
3
6
|
declare module '@eslint/js' {
|
|
4
|
-
import
|
|
7
|
+
import { ESLint } from 'eslint';
|
|
5
8
|
export default {
|
|
6
9
|
configs: {
|
|
7
10
|
all: WithRequired<ESLint.ConfigData, 'rules'>,
|
|
@@ -13,22 +16,22 @@ declare module '@eslint/js' {
|
|
|
13
16
|
type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
14
17
|
|
|
15
18
|
declare module '@eslint-community/eslint-plugin-eslint-comments' {
|
|
16
|
-
import
|
|
19
|
+
import { ESLint } from 'eslint';
|
|
17
20
|
export default {} as ESLint.Plugin;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
declare module 'eslint-plugin-perfectionist' {
|
|
21
|
-
import
|
|
24
|
+
import { ESLint } from 'eslint';
|
|
22
25
|
export default {} as ESLint.Plugin;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
declare module '@stylistic/eslint-plugin' {
|
|
26
|
-
import
|
|
29
|
+
import { ESLint } from 'eslint';
|
|
27
30
|
export default {} as WithRequired<ESLint.Plugin, 'environments'>;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
declare module 'eslint-plugin-promise' {
|
|
31
|
-
import
|
|
34
|
+
import { ESLint } from 'eslint';
|
|
32
35
|
export default {} as {
|
|
33
36
|
configs: {
|
|
34
37
|
recommended: WithRequired<ESLint.ConfigData, 'plugins' | 'rules'>;
|
|
@@ -38,12 +41,12 @@ declare module 'eslint-plugin-promise' {
|
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
declare module 'eslint-plugin-react' {
|
|
41
|
-
import
|
|
44
|
+
import { ESLint } from 'eslint';
|
|
42
45
|
export default {} as ESLint.Plugin;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
declare module 'eslint-plugin-security' {
|
|
46
|
-
import
|
|
49
|
+
import { ESLint } from 'eslint';
|
|
47
50
|
export default {} as {
|
|
48
51
|
configs: {
|
|
49
52
|
recommended: WithRequired<ESLint.ConfigData, 'plugins' | 'rules'>;
|