@w5s/eslint-config 3.2.1 → 3.3.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/dist/index.d.ts +45 -6
- package/dist/index.js +148 -44
- package/dist/index.js.map +1 -1
- package/package.json +38 -12
- package/src/config/es.ts +1 -5
- package/src/config/ts.ts +15 -37
- package/src/defineConfig.ts +9 -3
- package/src/rules/tsRules.ts +132 -0
- package/src/typegen/jsdoc.d.ts +4 -0
- package/src/typegen/node.d.ts +14 -0
- package/src/typegen/style.d.ts +21 -5
- package/src/typegen/ts.d.ts +6 -1
- package/src/config/createRules.ts +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -21,10 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"require": {
|
|
25
|
-
"types": "./dist/index.d.cts",
|
|
26
|
-
"default": "./dist/index.cjs"
|
|
27
|
-
},
|
|
28
24
|
"import": {
|
|
29
25
|
"types": "./dist/index.d.ts",
|
|
30
26
|
"default": "./dist/index.js"
|
|
@@ -42,26 +38,55 @@
|
|
|
42
38
|
"!**/__tests__/**"
|
|
43
39
|
],
|
|
44
40
|
"scripts": {
|
|
45
|
-
"
|
|
41
|
+
"build": "npx run-p \"build:*\"",
|
|
42
|
+
"build:tsc": "node --experimental-strip-types scripts/typegen.ts && tsup",
|
|
43
|
+
"clean": "npx run-p \"clean:*\"",
|
|
44
|
+
"clean:tsc": "rm -rf dist",
|
|
45
|
+
"docs": "node ../../markdown.mjs",
|
|
46
|
+
"format": "npx run-p \"format:*\"",
|
|
47
|
+
"format:src": "eslint . --fix",
|
|
48
|
+
"lint": "npx run-p \"lint:*\"",
|
|
49
|
+
"lint:src": "eslint .",
|
|
50
|
+
"postpack": "npx clean-package restore",
|
|
51
|
+
"prepack": "npx clean-package",
|
|
52
|
+
"prepare": "npx run-p \"prepare:*\"",
|
|
53
|
+
"prepare:empty": ":",
|
|
54
|
+
"prepublishOnly": "npm run clean;npm run build",
|
|
55
|
+
"spellcheck": "cspell --no-progress '**'",
|
|
56
|
+
"test": "npx run-p \"test:*\"",
|
|
57
|
+
"test:script": "scripts/test",
|
|
58
|
+
"test_:rule-coverage": "eslint-find-rules --unused"
|
|
46
59
|
},
|
|
47
60
|
"dependencies": {
|
|
48
61
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
49
62
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
50
63
|
"@typescript-eslint/parser": "^8.0.0",
|
|
51
64
|
"@vitest/eslint-plugin": "^1.0.0",
|
|
52
|
-
"@w5s/dev": "^3.1.
|
|
53
|
-
"@w5s/prettier-config": "^3.0.
|
|
65
|
+
"@w5s/dev": "^3.1.3",
|
|
66
|
+
"@w5s/prettier-config": "^3.0.5",
|
|
54
67
|
"eslint-plugin-import": "^2.25.0",
|
|
55
|
-
"eslint-plugin-jsdoc": "^
|
|
68
|
+
"eslint-plugin-jsdoc": "^62.0.0",
|
|
56
69
|
"eslint-plugin-jsonc": "^2.4.0",
|
|
57
70
|
"eslint-plugin-n": "^17.0.0",
|
|
58
71
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
59
|
-
"eslint-plugin-yml": "^
|
|
72
|
+
"eslint-plugin-yml": "^2.0.0",
|
|
60
73
|
"find-up": "^8.0.0",
|
|
61
74
|
"globals": "^17.0.0",
|
|
62
75
|
"jsonc-eslint-parser": "^2.0.0",
|
|
63
76
|
"parse-gitignore": "^2.0.0",
|
|
64
|
-
"yaml-eslint-parser": "^
|
|
77
|
+
"yaml-eslint-parser": "^2.0.0"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@types/eslint": "9.6.1",
|
|
81
|
+
"@types/parse-gitignore": "1.0.2",
|
|
82
|
+
"@types/react": "19.2.14",
|
|
83
|
+
"@typescript-eslint/parser": "8.56.0",
|
|
84
|
+
"eslint": "9.39.2",
|
|
85
|
+
"eslint-find-rules": "5.0.0",
|
|
86
|
+
"eslint-typegen": "2.3.0",
|
|
87
|
+
"react": "19.2.4",
|
|
88
|
+
"vite": "7.3.1",
|
|
89
|
+
"vitest": "4.0.18"
|
|
65
90
|
},
|
|
66
91
|
"peerDependencies": {
|
|
67
92
|
"eslint": "9.x",
|
|
@@ -75,6 +100,7 @@
|
|
|
75
100
|
"optional": true
|
|
76
101
|
}
|
|
77
102
|
},
|
|
103
|
+
"clean-package": "../../clean-package.config.mjs",
|
|
78
104
|
"engines": {
|
|
79
105
|
"node": ">=20.0.0"
|
|
80
106
|
},
|
|
@@ -82,5 +108,5 @@
|
|
|
82
108
|
"access": "public"
|
|
83
109
|
},
|
|
84
110
|
"sideEffect": false,
|
|
85
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "550810ad9a8d35378bb00361cd0080bd67058fc5"
|
|
86
112
|
}
|
package/src/config/es.ts
CHANGED
|
@@ -3,14 +3,11 @@ import eslintConfig from '@eslint/js';
|
|
|
3
3
|
import { Project } from '@w5s/dev';
|
|
4
4
|
import { type PluginOptionsBase, type Config } from '../type.js';
|
|
5
5
|
import type { RuleOptions } from '../typegen/jsonc.js';
|
|
6
|
-
import { createRules } from './createRules.js';
|
|
7
6
|
import { esRules } from '../rules/esRules.js';
|
|
8
7
|
|
|
9
8
|
const defaultFiles = [`**/${Project.extensionsToGlob(Project.queryExtensions(['javascript', 'javascriptreact']))}`];
|
|
10
9
|
|
|
11
|
-
export async function es(
|
|
12
|
-
options: es.Options,
|
|
13
|
-
) {
|
|
10
|
+
export async function es(options: es.Options) {
|
|
14
11
|
const { rules = {} } = options;
|
|
15
12
|
|
|
16
13
|
return [
|
|
@@ -47,7 +44,6 @@ export async function es(
|
|
|
47
44
|
files: defaultFiles,
|
|
48
45
|
rules: {
|
|
49
46
|
...eslintConfig.configs.recommended.rules,
|
|
50
|
-
...createRules(''),
|
|
51
47
|
...esRules(),
|
|
52
48
|
...rules,
|
|
53
49
|
},
|
package/src/config/ts.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ESLintConfig, interopDefault, Project } from '@w5s/dev';
|
|
3
3
|
import { StylisticConfig, type PluginOptionsBase, type Config } from '../type.js';
|
|
4
4
|
import type { RuleOptions } from '../typegen/ts.js';
|
|
5
|
-
import {
|
|
5
|
+
import { tsRules } from '../rules/tsRules.js';
|
|
6
6
|
|
|
7
7
|
const defaultFiles = [`**/${Project.extensionsToGlob(Project.queryExtensions(['typescript', 'typescriptreact']))}`];
|
|
8
8
|
|
|
@@ -45,48 +45,26 @@ export async function ts(options: ts.Options = {}) {
|
|
|
45
45
|
},
|
|
46
46
|
name: 'w5s/ts/rules',
|
|
47
47
|
rules: {
|
|
48
|
-
...ESLintConfig.renameRules(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
),
|
|
52
|
-
...ESLintConfig.renameRules(
|
|
53
|
-
tsStrictRules,
|
|
54
|
-
{ '@typescript-eslint': 'ts' },
|
|
55
|
-
),
|
|
56
|
-
'ts/ban-ts-comment': [
|
|
57
|
-
'warn',
|
|
58
|
-
{
|
|
59
|
-
'minimumDescriptionLength': 3,
|
|
60
|
-
'ts-check': false,
|
|
61
|
-
'ts-expect-error': 'allow-with-description',
|
|
62
|
-
'ts-ignore': 'allow-with-description',
|
|
63
|
-
'ts-nocheck': true,
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
'ts/no-empty-object-type': 'off',
|
|
67
|
-
'ts/no-explicit-any': 'off', // if any is explicit then it's wanted
|
|
68
|
-
'ts/no-namespace': 'off', // We don't agree with community, namespaces are great and not deprecated
|
|
69
|
-
...createRules('ts/'),
|
|
70
|
-
...(stylisticEnabled
|
|
71
|
-
? {}
|
|
72
|
-
: {}),
|
|
48
|
+
...ESLintConfig.renameRules(tsRecommendedRules, { '@typescript-eslint': 'ts' }),
|
|
49
|
+
...ESLintConfig.renameRules(tsStrictRules, { '@typescript-eslint': 'ts' }),
|
|
50
|
+
...tsRules(),
|
|
51
|
+
...(stylisticEnabled ? {} : {}),
|
|
73
52
|
...rules,
|
|
74
53
|
},
|
|
75
54
|
},
|
|
76
55
|
...(typeChecked
|
|
77
|
-
? [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
tsTypeCheckedRules,
|
|
84
|
-
|
|
85
|
-
),
|
|
56
|
+
? ([
|
|
57
|
+
{
|
|
58
|
+
files: defaultFiles,
|
|
59
|
+
// ignores: ignoresTypeAware,
|
|
60
|
+
name: 'w5s/ts/rules-type-checked',
|
|
61
|
+
rules: {
|
|
62
|
+
...ESLintConfig.renameRules(tsTypeCheckedRules, { '@typescript-eslint': 'ts' }),
|
|
63
|
+
},
|
|
86
64
|
},
|
|
87
|
-
|
|
65
|
+
] as const)
|
|
88
66
|
: []),
|
|
89
|
-
] as
|
|
67
|
+
] as [Config, Config] | [Config, Config, Config] satisfies Array<Config>;
|
|
90
68
|
}
|
|
91
69
|
export namespace ts {
|
|
92
70
|
export type Rules = RuleOptions;
|
package/src/defineConfig.ts
CHANGED
|
@@ -14,9 +14,15 @@ export interface DefineConfigOptions extends ignores.Options {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export async function defineConfig(options: DefineConfigOptions = {}) {
|
|
17
|
-
const stylisticOptions =
|
|
18
|
-
|
|
19
|
-
const
|
|
17
|
+
const stylisticOptions =
|
|
18
|
+
typeof options.stylistic === 'boolean' ? { enabled: options.stylistic } : { enabled: true, ...options.stylistic };
|
|
19
|
+
const withDefaultStylistic = <T>(_options: T) => ({ stylistic: stylisticOptions, ..._options });
|
|
20
|
+
const toOption = <T extends {}>(optionsOrBoolean: T | boolean | undefined) =>
|
|
21
|
+
withDefaultStylistic(
|
|
22
|
+
(typeof optionsOrBoolean === 'boolean'
|
|
23
|
+
? { enabled: optionsOrBoolean }
|
|
24
|
+
: { enabled: true, ...optionsOrBoolean }) as T & { enabled: boolean },
|
|
25
|
+
);
|
|
20
26
|
const esOptions = toOption(options.es);
|
|
21
27
|
const importOptions = toOption(options.import);
|
|
22
28
|
const jsdocOptions = toOption(options.jsdoc);
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ESLintConfig } from '@w5s/dev';
|
|
2
|
+
import { esRules } from './esRules.js';
|
|
3
|
+
|
|
4
|
+
export const tsRules = () => {
|
|
5
|
+
const baseRules = esRules();
|
|
6
|
+
|
|
7
|
+
return ESLintConfig.renameRules(
|
|
8
|
+
{
|
|
9
|
+
// '@typescript-eslint/comma-dangle': [
|
|
10
|
+
// baseRules['comma-dangle'][0],
|
|
11
|
+
// {
|
|
12
|
+
// ...baseRules['comma-dangle'][1],
|
|
13
|
+
// enums: baseRules['comma-dangle'][1].arrays,
|
|
14
|
+
// generics: baseRules['comma-dangle'][1].arrays,
|
|
15
|
+
// tuples: baseRules['comma-dangle'][1].arrays,
|
|
16
|
+
// },
|
|
17
|
+
// ],
|
|
18
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
19
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
20
|
+
'warn',
|
|
21
|
+
{
|
|
22
|
+
'minimumDescriptionLength': 3,
|
|
23
|
+
'ts-check': false,
|
|
24
|
+
'ts-expect-error': 'allow-with-description',
|
|
25
|
+
'ts-ignore': 'allow-with-description',
|
|
26
|
+
'ts-nocheck': true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
// '@typescript-eslint/brace-style': baseRules['brace-style'],
|
|
30
|
+
// '@typescript-eslint/comma-dangle': [
|
|
31
|
+
// baseRules['comma-dangle'][0],
|
|
32
|
+
// {
|
|
33
|
+
// ...baseRules['comma-dangle'][1],
|
|
34
|
+
// enums: baseRules['comma-dangle'][1].arrays,
|
|
35
|
+
// generics: baseRules['comma-dangle'][1].arrays,
|
|
36
|
+
// tuples: baseRules['comma-dangle'][1].arrays,
|
|
37
|
+
// },
|
|
38
|
+
// ],
|
|
39
|
+
// '@typescript-eslint/comma-spacing': baseRules['comma-spacing'],
|
|
40
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
41
|
+
'error',
|
|
42
|
+
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' },
|
|
43
|
+
],
|
|
44
|
+
'@typescript-eslint/default-param-last': baseRules['default-param-last'],
|
|
45
|
+
// '@typescript-eslint/dot-notation': baseRules['dot-notation'], // TODO: Stylistic typechecked
|
|
46
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
47
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
48
|
+
// '@typescript-eslint/func-call-spacing': baseRules['func-call-spacing'],
|
|
49
|
+
// '@typescript-eslint/indent': baseRules.indent,
|
|
50
|
+
// '@typescript-eslint/keyword-spacing': baseRules['keyword-spacing'],
|
|
51
|
+
// '@typescript-eslint/lines-between-class-members': baseRules['lines-between-class-members'],
|
|
52
|
+
// '@typescript-eslint/member-delimiter-style': 'error', // TODO: @stylistic/member-delimiter-style
|
|
53
|
+
'@typescript-eslint/naming-convention': [
|
|
54
|
+
'error',
|
|
55
|
+
// {
|
|
56
|
+
// format: ['PascalCase', 'camelCase'],
|
|
57
|
+
// leadingUnderscore: 'allow',
|
|
58
|
+
// selector: 'default',
|
|
59
|
+
// trailingUnderscore: 'allow',
|
|
60
|
+
// },
|
|
61
|
+
{
|
|
62
|
+
format: ['PascalCase', 'camelCase', 'UPPER_CASE'],
|
|
63
|
+
leadingUnderscore: 'allow',
|
|
64
|
+
selector: 'variable',
|
|
65
|
+
trailingUnderscore: 'allow',
|
|
66
|
+
},
|
|
67
|
+
// {
|
|
68
|
+
// format: ['PascalCase', 'camelCase', 'UPPER_CASE'],
|
|
69
|
+
// leadingUnderscore: 'allowSingleOrDouble',
|
|
70
|
+
// selector: 'memberLike',
|
|
71
|
+
// trailingUnderscore: 'allowDouble',
|
|
72
|
+
// },
|
|
73
|
+
{
|
|
74
|
+
format: ['PascalCase'],
|
|
75
|
+
selector: 'typeLike',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
// '@typescript-eslint/no-array-constructor': baseRules['no-array-constructor'],
|
|
79
|
+
// '@typescript-eslint/no-base-to-string': 'error', // TODO: require type check
|
|
80
|
+
'@typescript-eslint/no-dupe-class-members': baseRules['no-dupe-class-members'],
|
|
81
|
+
'@typescript-eslint/no-empty-function': baseRules['no-empty-function'],
|
|
82
|
+
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
|
|
83
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
84
|
+
'@typescript-eslint/no-explicit-any': 'off', // if any is explicit then it's wanted
|
|
85
|
+
'@typescript-eslint/no-extra-parens': baseRules['no-extra-parens'],
|
|
86
|
+
// '@typescript-eslint/no-extra-semi': baseRules['no-extra-semi'], // TODO: @stylistic/no-extra-semi
|
|
87
|
+
'@typescript-eslint/no-inferrable-types': 'error',
|
|
88
|
+
'@typescript-eslint/no-loop-func': baseRules['no-loop-func'],
|
|
89
|
+
'@typescript-eslint/no-loss-of-precision': baseRules['no-loss-of-precision'],
|
|
90
|
+
'@typescript-eslint/no-magic-numbers': baseRules['no-magic-numbers'],
|
|
91
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
92
|
+
'@typescript-eslint/no-namespace': 'off', // We don't agree with community, namespaces are great and not deprecated
|
|
93
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
94
|
+
'@typescript-eslint/no-redeclare': ESLintConfig.fixme(baseRules['no-redeclare']),
|
|
95
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
96
|
+
'@typescript-eslint/no-shadow': baseRules['no-shadow'],
|
|
97
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
98
|
+
// '@typescript-eslint/no-unnecessary-condition': 'error',// TODO: require type check
|
|
99
|
+
// '@typescript-eslint/no-unsafe-argument': 'error', // TODO: recommended type check
|
|
100
|
+
'@typescript-eslint/no-unused-expressions': baseRules['no-unused-expressions'],
|
|
101
|
+
'@typescript-eslint/no-unused-vars': baseRules['no-unused-vars'],
|
|
102
|
+
'@typescript-eslint/no-use-before-define': baseRules['no-use-before-define'],
|
|
103
|
+
'@typescript-eslint/no-useless-constructor': baseRules['no-useless-constructor'],
|
|
104
|
+
'@typescript-eslint/no-var-requires': 'error',
|
|
105
|
+
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
106
|
+
// '@typescript-eslint/object-curly-spacing': baseRules['object-curly-spacing'],
|
|
107
|
+
// '@typescript-eslint/only-throw-error': baseRules['no-throw-literal'], //TODO: Recommended type check
|
|
108
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
109
|
+
// '@typescript-eslint/prefer-reduce-type-parameter': 'error', // TODO: strict type check
|
|
110
|
+
// '@typescript-eslint/quotes': baseRules.quotes,
|
|
111
|
+
'@typescript-eslint/require-await': baseRules['require-await'],
|
|
112
|
+
// '@typescript-eslint/return-await': baseRules['no-return-await'], // TODO: strict type check
|
|
113
|
+
// '@typescript-eslint/semi': baseRules.semi,
|
|
114
|
+
// '@typescript-eslint/space-before-function-paren': baseRules['space-before-function-paren'],
|
|
115
|
+
// '@typescript-eslint/space-infix-ops': baseRules['space-infix-ops'],
|
|
116
|
+
// '@typescript-eslint/strict-boolean-expressions': [
|
|
117
|
+
// 'error',
|
|
118
|
+
// {
|
|
119
|
+
// allowNullableObject: false,
|
|
120
|
+
// allowNumber: false,
|
|
121
|
+
// allowString: false,
|
|
122
|
+
// },
|
|
123
|
+
// ], //TODO: require typing
|
|
124
|
+
// '@typescript-eslint/switch-exhaustiveness-check': 'error',//TODO: require type check
|
|
125
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
126
|
+
// '@typescript-eslint/type-annotation-spacing': 'error',// TODO: @stylistic/type-annotation-spacing
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
'@typescript-eslint': 'ts',
|
|
130
|
+
},
|
|
131
|
+
);
|
|
132
|
+
};
|
package/src/typegen/jsdoc.d.ts
CHANGED
|
@@ -1156,6 +1156,8 @@ type JsdocTypeFormatting = []|[{
|
|
|
1156
1156
|
|
|
1157
1157
|
objectFieldSeparatorTrailingPunctuation?: boolean
|
|
1158
1158
|
|
|
1159
|
+
objectTypeBracketSpacing?: string
|
|
1160
|
+
|
|
1159
1161
|
parameterDefaultValueSpacing?: string
|
|
1160
1162
|
|
|
1161
1163
|
postMethodNameSpacing?: string
|
|
@@ -1166,6 +1168,8 @@ type JsdocTypeFormatting = []|[{
|
|
|
1166
1168
|
|
|
1167
1169
|
stringQuotes?: ("double" | "single")
|
|
1168
1170
|
|
|
1171
|
+
trailingPunctuationMultilineOnly?: boolean
|
|
1172
|
+
|
|
1169
1173
|
typeBracketSpacing?: string
|
|
1170
1174
|
|
|
1171
1175
|
unionSpacing?: string
|
package/src/typegen/node.d.ts
CHANGED
|
@@ -165,6 +165,11 @@ export interface RuleOptions {
|
|
|
165
165
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/console.md
|
|
166
166
|
*/
|
|
167
167
|
'node/prefer-global/console'?: Linter.RuleEntry<NodePreferGlobalConsole>
|
|
168
|
+
/**
|
|
169
|
+
* enforce either `crypto` or `require("crypto").webcrypto`
|
|
170
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/crypto.md
|
|
171
|
+
*/
|
|
172
|
+
'node/prefer-global/crypto'?: Linter.RuleEntry<NodePreferGlobalCrypto>
|
|
168
173
|
/**
|
|
169
174
|
* enforce either `process` or `require("process")`
|
|
170
175
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/process.md
|
|
@@ -180,6 +185,11 @@ export interface RuleOptions {
|
|
|
180
185
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/text-encoder.md
|
|
181
186
|
*/
|
|
182
187
|
'node/prefer-global/text-encoder'?: Linter.RuleEntry<NodePreferGlobalTextEncoder>
|
|
188
|
+
/**
|
|
189
|
+
* enforce either global timer functions or `require("timers")`
|
|
190
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/timers.md
|
|
191
|
+
*/
|
|
192
|
+
'node/prefer-global/timers'?: Linter.RuleEntry<NodePreferGlobalTimers>
|
|
183
193
|
/**
|
|
184
194
|
* enforce either `URL` or `require("url").URL`
|
|
185
195
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/url.md
|
|
@@ -488,12 +498,16 @@ type NodeNoUnsupportedFeaturesNodeBuiltins = []|[{
|
|
|
488
498
|
type NodePreferGlobalBuffer = []|[("always" | "never")]
|
|
489
499
|
// ----- node/prefer-global/console -----
|
|
490
500
|
type NodePreferGlobalConsole = []|[("always" | "never")]
|
|
501
|
+
// ----- node/prefer-global/crypto -----
|
|
502
|
+
type NodePreferGlobalCrypto = []|[("always" | "never")]
|
|
491
503
|
// ----- node/prefer-global/process -----
|
|
492
504
|
type NodePreferGlobalProcess = []|[("always" | "never")]
|
|
493
505
|
// ----- node/prefer-global/text-decoder -----
|
|
494
506
|
type NodePreferGlobalTextDecoder = []|[("always" | "never")]
|
|
495
507
|
// ----- node/prefer-global/text-encoder -----
|
|
496
508
|
type NodePreferGlobalTextEncoder = []|[("always" | "never")]
|
|
509
|
+
// ----- node/prefer-global/timers -----
|
|
510
|
+
type NodePreferGlobalTimers = []|[("always" | "never")]
|
|
497
511
|
// ----- node/prefer-global/url -----
|
|
498
512
|
type NodePreferGlobalUrl = []|[("always" | "never")]
|
|
499
513
|
// ----- node/prefer-global/url-search-params -----
|
package/src/typegen/style.d.ts
CHANGED
|
@@ -79,6 +79,11 @@ export interface RuleOptions {
|
|
|
79
79
|
* @see https://eslint.style/rules/eol-last
|
|
80
80
|
*/
|
|
81
81
|
'style/eol-last'?: Linter.RuleEntry<StyleEolLast>
|
|
82
|
+
/**
|
|
83
|
+
* Enforce consistent line break styles for JSX props
|
|
84
|
+
* @see https://eslint.style/rules/jsx-props-style
|
|
85
|
+
*/
|
|
86
|
+
'style/exp-jsx-props-style'?: Linter.RuleEntry<StyleExpJsxPropsStyle>
|
|
82
87
|
/**
|
|
83
88
|
* Enforce consistent spacing and line break styles inside brackets.
|
|
84
89
|
* @see https://eslint.style/rules/list-style
|
|
@@ -676,15 +681,25 @@ type StyleCurlyNewline = []|[(("always" | "never") | {
|
|
|
676
681
|
type StyleDotLocation = []|[("object" | "property")]
|
|
677
682
|
// ----- style/eol-last -----
|
|
678
683
|
type StyleEolLast = []|[("always" | "never" | "unix" | "windows")]
|
|
684
|
+
// ----- style/exp-jsx-props-style -----
|
|
685
|
+
type StyleExpJsxPropsStyle = []|[{
|
|
686
|
+
singleLine?: {
|
|
687
|
+
maxItems?: number
|
|
688
|
+
}
|
|
689
|
+
multiLine?: {
|
|
690
|
+
minItems?: number
|
|
691
|
+
maxItemsPerLine?: number
|
|
692
|
+
}
|
|
693
|
+
}]
|
|
679
694
|
// ----- style/exp-list-style -----
|
|
680
695
|
type StyleExpListStyle = []|[{
|
|
681
696
|
singleLine?: _StyleExpListStyle_SingleLineConfig
|
|
682
697
|
multiLine?: _StyleExpListStyle_MultiLineConfig
|
|
683
698
|
overrides?: {
|
|
699
|
+
"()"?: _StyleExpListStyle_BaseConfig
|
|
684
700
|
"[]"?: _StyleExpListStyle_BaseConfig
|
|
685
701
|
"{}"?: _StyleExpListStyle_BaseConfig
|
|
686
702
|
"<>"?: _StyleExpListStyle_BaseConfig
|
|
687
|
-
"()"?: _StyleExpListStyle_BaseConfig
|
|
688
703
|
ArrayExpression?: _StyleExpListStyle_BaseConfig
|
|
689
704
|
ArrayPattern?: _StyleExpListStyle_BaseConfig
|
|
690
705
|
ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig
|
|
@@ -692,21 +707,22 @@ type StyleExpListStyle = []|[{
|
|
|
692
707
|
ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig
|
|
693
708
|
FunctionDeclaration?: _StyleExpListStyle_BaseConfig
|
|
694
709
|
FunctionExpression?: _StyleExpListStyle_BaseConfig
|
|
695
|
-
|
|
710
|
+
IfStatement?: _StyleExpListStyle_BaseConfig
|
|
696
711
|
ImportAttributes?: _StyleExpListStyle_BaseConfig
|
|
712
|
+
ImportDeclaration?: _StyleExpListStyle_BaseConfig
|
|
713
|
+
JSONArrayExpression?: _StyleExpListStyle_BaseConfig
|
|
714
|
+
JSONObjectExpression?: _StyleExpListStyle_BaseConfig
|
|
697
715
|
NewExpression?: _StyleExpListStyle_BaseConfig
|
|
698
716
|
ObjectExpression?: _StyleExpListStyle_BaseConfig
|
|
699
717
|
ObjectPattern?: _StyleExpListStyle_BaseConfig
|
|
700
718
|
TSDeclareFunction?: _StyleExpListStyle_BaseConfig
|
|
719
|
+
TSEnumBody?: _StyleExpListStyle_BaseConfig
|
|
701
720
|
TSFunctionType?: _StyleExpListStyle_BaseConfig
|
|
702
721
|
TSInterfaceBody?: _StyleExpListStyle_BaseConfig
|
|
703
|
-
TSEnumBody?: _StyleExpListStyle_BaseConfig
|
|
704
722
|
TSTupleType?: _StyleExpListStyle_BaseConfig
|
|
705
723
|
TSTypeLiteral?: _StyleExpListStyle_BaseConfig
|
|
706
724
|
TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig
|
|
707
725
|
TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig
|
|
708
|
-
JSONArrayExpression?: _StyleExpListStyle_BaseConfig
|
|
709
|
-
JSONObjectExpression?: _StyleExpListStyle_BaseConfig
|
|
710
726
|
}
|
|
711
727
|
}]
|
|
712
728
|
interface _StyleExpListStyle_SingleLineConfig {
|
package/src/typegen/ts.d.ts
CHANGED
|
@@ -476,7 +476,7 @@ export interface RuleOptions {
|
|
|
476
476
|
* Disallow default values that will never be used
|
|
477
477
|
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
478
478
|
*/
|
|
479
|
-
'ts/no-useless-default-assignment'?: Linter.RuleEntry<
|
|
479
|
+
'ts/no-useless-default-assignment'?: Linter.RuleEntry<TsNoUselessDefaultAssignment>
|
|
480
480
|
/**
|
|
481
481
|
* Disallow empty exports that don't change anything in a module file
|
|
482
482
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
|
@@ -1583,6 +1583,11 @@ type TsNoUseBeforeDefine = []|[("nofunc" | {
|
|
|
1583
1583
|
|
|
1584
1584
|
variables?: boolean
|
|
1585
1585
|
})]
|
|
1586
|
+
// ----- ts/no-useless-default-assignment -----
|
|
1587
|
+
type TsNoUselessDefaultAssignment = []|[{
|
|
1588
|
+
|
|
1589
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean
|
|
1590
|
+
}]
|
|
1586
1591
|
// ----- ts/no-var-requires -----
|
|
1587
1592
|
type TsNoVarRequires = []|[{
|
|
1588
1593
|
|