eslint-config-isaacscript 4.20.0 → 5.0.0
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/LICENSE +1 -1
- package/README.md +2 -4
- package/package.json +8 -5
- package/base.js +0 -68
- package/configs/base-eslint-comments.js +0 -59
- package/configs/base-eslint.js +0 -723
- package/configs/base-import.js +0 -250
- package/configs/base-jsdoc.js +0 -253
- package/configs/base-n.js +0 -158
- package/configs/base-no-autofix.js +0 -30
- package/configs/base-typescript-eslint.js +0 -551
- package/configs/base-unicorn.js +0 -233
- package/mod.js +0 -229
package/configs/base-import.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
// This ESLint config only contains rules from `eslint-plugin-import`:
|
|
2
|
-
// https://github.com/import-js/eslint-plugin-import
|
|
3
|
-
|
|
4
|
-
// Rules are separated into categories:
|
|
5
|
-
// 1) Helpful warnings
|
|
6
|
-
// 2) Module systems
|
|
7
|
-
// 3) Static analysis
|
|
8
|
-
// 4) Style guide
|
|
9
|
-
|
|
10
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
11
|
-
const HELPFUL_WARNINGS = {
|
|
12
|
-
"import/export": "error",
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Superseded by the `deprecation/deprecation` rule. (That rule is better because it catches
|
|
16
|
-
* deprecated usage that does not come from import statements specifically.)
|
|
17
|
-
*/
|
|
18
|
-
"import/no-deprecated": "off",
|
|
19
|
-
|
|
20
|
-
"import/no-empty-named-blocks": "error",
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The options are [copied from
|
|
24
|
-
* Airbnb](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/import.js).
|
|
25
|
-
*
|
|
26
|
-
* We also add a "scripts" directory entry for "devDependencies".
|
|
27
|
-
*/
|
|
28
|
-
"import/no-extraneous-dependencies": [
|
|
29
|
-
"error",
|
|
30
|
-
{
|
|
31
|
-
devDependencies: [
|
|
32
|
-
"test/**", // tape, common npm pattern
|
|
33
|
-
"tests/**", // also common npm pattern
|
|
34
|
-
"spec/**", // mocha, rspec-like pattern
|
|
35
|
-
"**/__tests__/**", // jest pattern
|
|
36
|
-
"**/__mocks__/**", // jest pattern
|
|
37
|
-
"test.{js,jsx}", // repos with a single test file
|
|
38
|
-
"test-*.{js,jsx}", // repos with multiple top-level test files
|
|
39
|
-
"**/*{.,_}{test,spec}.{js,jsx}", // tests where the extension or filename suffix denotes that it is a test
|
|
40
|
-
"**/jest.config.js", // jest config
|
|
41
|
-
"**/jest.setup.js", // jest setup
|
|
42
|
-
"**/vue.config.js", // vue-cli config
|
|
43
|
-
"**/webpack.config.js", // webpack config
|
|
44
|
-
"**/webpack.config.*.js", // webpack config
|
|
45
|
-
"**/rollup.config.js", // rollup config
|
|
46
|
-
"**/rollup.config.*.js", // rollup config
|
|
47
|
-
"**/gulpfile.js", // gulp config
|
|
48
|
-
"**/gulpfile.*.js", // gulp config
|
|
49
|
-
"**/Gruntfile{,.js}", // grunt config
|
|
50
|
-
"**/protractor.conf.js", // protractor config
|
|
51
|
-
"**/protractor.conf.*.js", // protractor config
|
|
52
|
-
"**/karma.conf.js", // karma config
|
|
53
|
-
"**/.eslintrc.js", // eslint config
|
|
54
|
-
|
|
55
|
-
"**/scripts/*.{js,cjs,mjs,ts,cts,mts}", // Files inside of a "scripts" directory.
|
|
56
|
-
],
|
|
57
|
-
optionalDependencies: false,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
|
|
61
|
-
"import/no-mutable-exports": "error",
|
|
62
|
-
"import/no-named-as-default": "error",
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Disabled because this is [already handled by the TypeScript
|
|
66
|
-
* compiler](https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting/#eslint-plugin-import).
|
|
67
|
-
*/
|
|
68
|
-
"import/no-named-as-default-member": "off",
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Disabled since this check is better performed by the [`knip`](https://github.com/webpro/knip)
|
|
72
|
-
* tool.
|
|
73
|
-
*/
|
|
74
|
-
"import/no-unused-modules": "off",
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
78
|
-
const MODULE_SYSTEMS = {
|
|
79
|
-
"import/no-amd": "error",
|
|
80
|
-
"import/no-commonjs": "error",
|
|
81
|
-
"import/no-import-module-exports": "error",
|
|
82
|
-
|
|
83
|
-
/** Disabled because it is only used in specific environments (like the browser). */
|
|
84
|
-
"import/no-nodejs-modules": "off",
|
|
85
|
-
|
|
86
|
-
/** Disabled because this is already handled by the TypeScript compiler. */
|
|
87
|
-
"import/unambiguous": "off",
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
91
|
-
const STATIC_ANALYSIS = {
|
|
92
|
-
/**
|
|
93
|
-
* Disabled because this is [already handled by the TypeScript
|
|
94
|
-
* compiler](https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting/#eslint-plugin-import).
|
|
95
|
-
*/
|
|
96
|
-
"import/default": "off",
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Disabled because this is [already handled by the TypeScript
|
|
100
|
-
* compiler](https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting/#eslint-plugin-import).
|
|
101
|
-
*/
|
|
102
|
-
"import/named": "off",
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Disabled because this is [already handled by the TypeScript
|
|
106
|
-
* compiler](https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting/#eslint-plugin-import).
|
|
107
|
-
*/
|
|
108
|
-
"import/namespace": "off",
|
|
109
|
-
|
|
110
|
-
"import/no-absolute-path": "error",
|
|
111
|
-
"import/no-cycle": "error",
|
|
112
|
-
"import/no-dynamic-require": "error",
|
|
113
|
-
|
|
114
|
-
/** Disabled since a prescribed import pattern is not generalizable enough across projects. */
|
|
115
|
-
"import/no-internal-modules": "off",
|
|
116
|
-
|
|
117
|
-
"import/no-relative-packages": "error",
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Disabled since a forward import direction pattern is not generalizable enough across projects.
|
|
121
|
-
*/
|
|
122
|
-
"import/no-relative-parent-imports": "off",
|
|
123
|
-
|
|
124
|
-
/** Disabled since this rule should only contain a project-specific path restriction. */
|
|
125
|
-
"import/no-restricted-paths": "off",
|
|
126
|
-
|
|
127
|
-
"import/no-self-import": "error",
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Disabled because this is [already handled by the TypeScript
|
|
131
|
-
* compiler](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js).
|
|
132
|
-
*/
|
|
133
|
-
"import/no-unresolved": "off",
|
|
134
|
-
|
|
135
|
-
"import/no-useless-path-segments": "error",
|
|
136
|
-
"import/no-webpack-loader-syntax": "error",
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
140
|
-
const STYLE_GUIDE = {
|
|
141
|
-
"import/consistent-type-specifier-style": "error",
|
|
142
|
-
|
|
143
|
-
/** Disabled because it is only useful in environments that use webpack. */
|
|
144
|
-
"import/dynamic-import-chunkname": "off",
|
|
145
|
-
|
|
146
|
-
/** Disabled because this style is not generally used. */
|
|
147
|
-
"import/exports-last": "off",
|
|
148
|
-
|
|
149
|
-
/** Disabled because this is already handled by the TypeScript compiler. */
|
|
150
|
-
"import/extensions": "off",
|
|
151
|
-
|
|
152
|
-
"import/first": "error",
|
|
153
|
-
|
|
154
|
-
/** Disabled because this style is not generally used. */
|
|
155
|
-
"import/group-exports": "off",
|
|
156
|
-
|
|
157
|
-
/** Disabled because this rule is deprecated. */
|
|
158
|
-
"import/imports-first": "off",
|
|
159
|
-
|
|
160
|
-
/** Disabled since it will trigger false positives in codebases that prefer smaller files. */
|
|
161
|
-
"import/max-dependencies": "off",
|
|
162
|
-
|
|
163
|
-
"import/newline-after-import": "error",
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Disabled since we disallow default exports elsewhere in this config (in favor of named
|
|
167
|
-
* exports).
|
|
168
|
-
*/
|
|
169
|
-
"import/no-anonymous-default-export": "off",
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* The case against default exports is [layed out by Basarat Ali
|
|
173
|
-
* Syed](https://basarat.gitbook.io/typescript/main-1/defaultisbad).
|
|
174
|
-
*/
|
|
175
|
-
"import/no-default-export": "error",
|
|
176
|
-
|
|
177
|
-
"import/no-duplicates": "error",
|
|
178
|
-
"import/no-named-default": "error",
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Disabled since we disallow default exports elsewhere in this config (in favor of named
|
|
182
|
-
* exports).
|
|
183
|
-
*/
|
|
184
|
-
"import/no-named-export": "off",
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Disabled since it is too prescriptive for a general audience. (Using `import * as` is common.)
|
|
188
|
-
*/
|
|
189
|
-
"import/no-namespace": "off",
|
|
190
|
-
|
|
191
|
-
"import/no-unassigned-import": "error",
|
|
192
|
-
|
|
193
|
-
/** Disabled because this is automatically handled by `prettier-plugin-organize-imports`. */
|
|
194
|
-
"import/order": "off",
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Disabled because we disallow default exports elsewhere in this config (in favor of named
|
|
198
|
-
* exports).
|
|
199
|
-
*/
|
|
200
|
-
"import/prefer-default-export": "off",
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
/*
|
|
204
|
-
* @type {import("eslint").Linter.Config}
|
|
205
|
-
*/
|
|
206
|
-
const config = {
|
|
207
|
-
// Beyond just specifying the plugin, additional configuration is necessary to make the plugin
|
|
208
|
-
// work properly with TypeScript. We extend the upstream TypeScript config to accomplish this:
|
|
209
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/config/typescript.js
|
|
210
|
-
// (The necessity of this extra configuration was tested with the `import/no-cycle` rule.)
|
|
211
|
-
extends: ["plugin:import/typescript"],
|
|
212
|
-
|
|
213
|
-
plugins: ["import"],
|
|
214
|
-
|
|
215
|
-
rules: {
|
|
216
|
-
...HELPFUL_WARNINGS,
|
|
217
|
-
...MODULE_SYSTEMS,
|
|
218
|
-
...STATIC_ANALYSIS,
|
|
219
|
-
...STYLE_GUIDE,
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
overrides: [
|
|
223
|
-
// Disable some TypeScript-specific rules in JavaScript files.
|
|
224
|
-
{
|
|
225
|
-
files: ["*.js", "*.cjs", "*.mjs", "*.jsx"],
|
|
226
|
-
rules: {
|
|
227
|
-
"import/no-commonjs": "off",
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
// Disable some specific rules in config files.
|
|
232
|
-
{
|
|
233
|
-
files: [
|
|
234
|
-
".remarkrc.mjs",
|
|
235
|
-
".remarkrc.js",
|
|
236
|
-
"prettier.config.mjs",
|
|
237
|
-
"prettier.config.js",
|
|
238
|
-
"typedoc.config.mjs",
|
|
239
|
-
"typedoc.config.js",
|
|
240
|
-
"vite.config.js",
|
|
241
|
-
"vite.config.mjs",
|
|
242
|
-
],
|
|
243
|
-
rules: {
|
|
244
|
-
"import/no-default-export": "off",
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
module.exports = config;
|
package/configs/base-jsdoc.js
DELETED
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This ESLint config only contains rules from `eslint-plugin-jsdoc`:
|
|
3
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
4
|
-
*
|
|
5
|
-
* @type {import("eslint").Linter.Config}
|
|
6
|
-
*/
|
|
7
|
-
const config = {
|
|
8
|
-
plugins: ["jsdoc"],
|
|
9
|
-
|
|
10
|
-
rules: {
|
|
11
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
12
|
-
"jsdoc/check-access": "off",
|
|
13
|
-
|
|
14
|
-
/** Superseded by the `isaacscript/limit-jsdoc-comments` rule. */
|
|
15
|
-
"jsdoc/check-alignment": "off",
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Disabled since it [does not work with ESLint
|
|
19
|
-
* 8](https://github.com/eslint/eslint/issues/14745).
|
|
20
|
-
*/
|
|
21
|
-
"jsdoc/check-examples": "off",
|
|
22
|
-
|
|
23
|
-
/** Superseded by the `isaacscript/limit-jsdoc-comments` rule. */
|
|
24
|
-
"jsdoc/check-indentation": "off",
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Disabled since this is not a common formatting scheme. It is also not recommended by the
|
|
28
|
-
* plugin authors.
|
|
29
|
-
*/
|
|
30
|
-
"jsdoc/check-line-alignment": "off",
|
|
31
|
-
|
|
32
|
-
"jsdoc/check-param-names": "error",
|
|
33
|
-
|
|
34
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
35
|
-
"jsdoc/check-property-names": "off",
|
|
36
|
-
|
|
37
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
38
|
-
"jsdoc/check-syntax": "off",
|
|
39
|
-
|
|
40
|
-
"jsdoc/check-tag-names": [
|
|
41
|
-
"error",
|
|
42
|
-
{
|
|
43
|
-
definedTags: [
|
|
44
|
-
// Ignore tags used by the TypeScript compiler:
|
|
45
|
-
// https://www.typescriptlang.org/tsconfig#stripInternal
|
|
46
|
-
"internal", // Used by TypeScript
|
|
47
|
-
|
|
48
|
-
// Ignore tags used in TypeDoc:
|
|
49
|
-
// https://typedoc.org/guides/doccomments/
|
|
50
|
-
"category",
|
|
51
|
-
"hidden",
|
|
52
|
-
"notExported", // From: typedoc-plugin-not-exported
|
|
53
|
-
"rename", // From: typedoc-plugin-rename
|
|
54
|
-
|
|
55
|
-
// Ignore tags used in TypeScriptToLua:
|
|
56
|
-
// https://typescripttolua.github.io/docs/advanced/compiler-annotations
|
|
57
|
-
"noResolution",
|
|
58
|
-
"noSelf",
|
|
59
|
-
"noSelfInFile",
|
|
60
|
-
|
|
61
|
-
// Ignore tags used in `ts-json-schema-generator`:
|
|
62
|
-
// https://github.com/vega/ts-json-schema-generator
|
|
63
|
-
"minimum",
|
|
64
|
-
"maximum",
|
|
65
|
-
|
|
66
|
-
// Ignore tags used in `eslint-plugin-isaacscript`:
|
|
67
|
-
// https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-plugin-isaacscript/docs/rules/require-variadic-function-argument.md
|
|
68
|
-
"allowEmptyVariadic",
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
|
|
73
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
74
|
-
"jsdoc/check-types": "off",
|
|
75
|
-
|
|
76
|
-
"jsdoc/check-values": "error",
|
|
77
|
-
"jsdoc/empty-tags": "error",
|
|
78
|
-
"jsdoc/implements-on-classes": "error",
|
|
79
|
-
|
|
80
|
-
/** Disabled since you cannot configure it with a path to the correct "package.json" file. */
|
|
81
|
-
"jsdoc/imports-as-dependencies": "off",
|
|
82
|
-
|
|
83
|
-
"jsdoc/informative-docs": "error",
|
|
84
|
-
|
|
85
|
-
/** Superseded by the `isaacscript/jsdoc-full-sentences` rule. */
|
|
86
|
-
"jsdoc/match-description": "off",
|
|
87
|
-
|
|
88
|
-
/** Disabled because it is only needed for projects with specific JSDoc requirements. */
|
|
89
|
-
"jsdoc/match-name": "off",
|
|
90
|
-
|
|
91
|
-
/** Superseded by the `isaacscript/limit-jsdoc-comments` rule. */
|
|
92
|
-
"jsdoc/multiline-blocks": "off",
|
|
93
|
-
|
|
94
|
-
/** Superseded by the `isaacscript/limit-jsdoc-comments` rule. */
|
|
95
|
-
"jsdoc/newline-after-description": "off",
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Disabled because it provides little value; it only detects JSDoc comments with tags in them.
|
|
99
|
-
*/
|
|
100
|
-
"jsdoc/no-bad-blocks": "off",
|
|
101
|
-
|
|
102
|
-
/** Superseded by the `isaacscript/format-jsdoc-comments` rule. */
|
|
103
|
-
"jsdoc/no-blank-block-descriptions": "off",
|
|
104
|
-
|
|
105
|
-
/** Superseded by the `isaacscript/no-empty-jsdoc` rule. */
|
|
106
|
-
"jsdoc/no-blank-blocks": "off",
|
|
107
|
-
|
|
108
|
-
/** Disabled because it provides little value; the `@default` tag is rare. */
|
|
109
|
-
"jsdoc/no-defaults": "off",
|
|
110
|
-
|
|
111
|
-
/** Disabled because it is too project-specific. */
|
|
112
|
-
"jsdoc/no-missing-syntax": "off",
|
|
113
|
-
|
|
114
|
-
/** Superseded by the `isaacscript/limit-jsdoc-comments` rule. */
|
|
115
|
-
"jsdoc/no-multi-asterisks": "off",
|
|
116
|
-
|
|
117
|
-
/** Disabled because it is intended for disabling of specific language features per-project. */
|
|
118
|
-
"jsdoc/no-restricted-syntax": "off",
|
|
119
|
-
|
|
120
|
-
/** The `contexts` option is set to `any` to make the rule stricter. */
|
|
121
|
-
"jsdoc/no-types": [
|
|
122
|
-
"error",
|
|
123
|
-
{
|
|
124
|
-
contexts: ["any"],
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
129
|
-
"jsdoc/no-undefined-types": "off",
|
|
130
|
-
|
|
131
|
-
"jsdoc/require-asterisk-prefix": "error",
|
|
132
|
-
|
|
133
|
-
/** Superseded by the `isaacscript/jsdoc-complete-sentences` rule. */
|
|
134
|
-
"jsdoc/require-description-complete-sentence": "off",
|
|
135
|
-
|
|
136
|
-
/** Disabled because it is overboard for every function to have a description. */
|
|
137
|
-
"jsdoc/require-description": "off",
|
|
138
|
-
|
|
139
|
-
/** Disabled because it is overboard for every function to require an example. */
|
|
140
|
-
"jsdoc/require-example": "off",
|
|
141
|
-
|
|
142
|
-
/** Disabled because it is overboard for every file to require an overview. */
|
|
143
|
-
"jsdoc/require-file-overview": "off",
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* The `never` option is provided to make the rule match the format of the official TypeScript
|
|
147
|
-
* codebase.
|
|
148
|
-
*/
|
|
149
|
-
"jsdoc/require-hyphen-before-param-description": ["error", "never"],
|
|
150
|
-
|
|
151
|
-
/** Disabled since it is overboard for every function to have a JSDoc comment. */
|
|
152
|
-
"jsdoc/require-jsdoc": "off",
|
|
153
|
-
|
|
154
|
-
/** The `contexts` option is set to `any` to make the rule stricter. */
|
|
155
|
-
"jsdoc/require-param-description": [
|
|
156
|
-
"error",
|
|
157
|
-
{
|
|
158
|
-
contexts: ["any"],
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
|
|
162
|
-
/** The `contexts` option is set to `any` to make the rule stricter. */
|
|
163
|
-
"jsdoc/require-param-name": [
|
|
164
|
-
"error",
|
|
165
|
-
{
|
|
166
|
-
contexts: ["any"],
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
|
|
170
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
171
|
-
"jsdoc/require-param-type": "off",
|
|
172
|
-
|
|
173
|
-
/** Configured to only apply when there are one or more parameters. */
|
|
174
|
-
"jsdoc/require-param": [
|
|
175
|
-
"error",
|
|
176
|
-
{
|
|
177
|
-
contexts: [
|
|
178
|
-
{
|
|
179
|
-
context: "FunctionDeclaration",
|
|
180
|
-
comment: 'JsdocBlock:has(JsdocTag[tag="param"])',
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
|
|
186
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
187
|
-
"jsdoc/require-property": "off",
|
|
188
|
-
|
|
189
|
-
"jsdoc/require-property-description": "error",
|
|
190
|
-
"jsdoc/require-property-name": "error",
|
|
191
|
-
|
|
192
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
193
|
-
"jsdoc/require-property-type": "off",
|
|
194
|
-
|
|
195
|
-
/** Disabled because it is overboard for every function to document every return value. */
|
|
196
|
-
"jsdoc/require-returns-check": "off",
|
|
197
|
-
|
|
198
|
-
/** The `contexts` option is set to `any` to make the rule stricter. */
|
|
199
|
-
"jsdoc/require-returns-description": [
|
|
200
|
-
"error",
|
|
201
|
-
{
|
|
202
|
-
contexts: ["any"],
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
|
|
206
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
207
|
-
"jsdoc/require-returns-type": "off",
|
|
208
|
-
|
|
209
|
-
/** Disabled because it is overboard for every function to document every return value. */
|
|
210
|
-
"jsdoc/require-returns": "off",
|
|
211
|
-
|
|
212
|
-
/** Disabled because it is overboard to document every throw statement. */
|
|
213
|
-
"jsdoc/require-throws": "off",
|
|
214
|
-
|
|
215
|
-
/** Disabled because it is overboard to document every yield. */
|
|
216
|
-
"jsdoc/require-yields": "off",
|
|
217
|
-
|
|
218
|
-
/** Disabled because it is overboard to document every yield. */
|
|
219
|
-
"jsdoc/require-yields-check": "off",
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Disabled because it is not very useful. In most cases, a function will only have `@param` and
|
|
223
|
-
* `@return` tags, making sorting unnecessary.
|
|
224
|
-
*/
|
|
225
|
-
"jsdoc/sort-tags": "off",
|
|
226
|
-
|
|
227
|
-
/** Superseded by the `isaacscript/format-jsdoc-comments` rule. */
|
|
228
|
-
"jsdoc/tag-lines": "off",
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Disabled since it is only useful in certain environments (e.g. when your project converts
|
|
232
|
-
* JSDoc comments to Markdown).
|
|
233
|
-
*/
|
|
234
|
-
"jsdoc/text-escaping": "off",
|
|
235
|
-
|
|
236
|
-
/** Disabled because it is not needed in TypeScript. */
|
|
237
|
-
"jsdoc/valid-types": "off",
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
overrides: [
|
|
241
|
-
// Disable some TypeScript-specific rules in JavaScript files.
|
|
242
|
-
{
|
|
243
|
-
files: ["*.js", "*.cjs", "*.mjs", "*.jsx"],
|
|
244
|
-
rules: {
|
|
245
|
-
"jsdoc/no-types": "off",
|
|
246
|
-
"jsdoc/require-param-description": "off",
|
|
247
|
-
"jsdoc/require-returns-description": "off",
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
],
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
module.exports = config;
|
package/configs/base-n.js
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
// This ESLint config only contains rules from `eslint-plugin-n`:
|
|
2
|
-
// https://github.com/eslint-community/eslint-plugin-n
|
|
3
|
-
// (This is a forked version of `eslint-plugin-node`.)
|
|
4
|
-
|
|
5
|
-
// Rules are separated into categories:
|
|
6
|
-
// 1) Best Practices
|
|
7
|
-
// 2) Possible Errors
|
|
8
|
-
// 3) Stylistic Issues
|
|
9
|
-
|
|
10
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
11
|
-
const BEST_PRACTICES = {
|
|
12
|
-
"n/no-deprecated-api": "error",
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
16
|
-
const POSSIBLE_ERRORS = {
|
|
17
|
-
"n/handle-callback-err": "error",
|
|
18
|
-
"n/no-callback-literal": "error",
|
|
19
|
-
"n/no-exports-assign": "error",
|
|
20
|
-
|
|
21
|
-
/** Disabled since it is handled by the TypeScript compiler. */
|
|
22
|
-
"n/no-extraneous-import": "off",
|
|
23
|
-
|
|
24
|
-
/** Disabled since require statements are not used in TypeScript code. */
|
|
25
|
-
"n/no-extraneous-require": "off",
|
|
26
|
-
|
|
27
|
-
/** Disabled because this rule is deprecated. */
|
|
28
|
-
"n/no-hide-core-modules": "off",
|
|
29
|
-
|
|
30
|
-
/** Disabled since it is handled by the TypeScript compiler. */
|
|
31
|
-
"n/no-missing-import": "off",
|
|
32
|
-
|
|
33
|
-
"n/no-missing-require": "error",
|
|
34
|
-
"n/no-new-require": "error",
|
|
35
|
-
"n/no-path-concat": "error",
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Disabled because using `process.exit` is common to exit command-line applications without
|
|
39
|
-
* verbose output.
|
|
40
|
-
*/
|
|
41
|
-
"n/no-process-exit": "off",
|
|
42
|
-
|
|
43
|
-
"n/no-unpublished-bin": "error",
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* An exception is made for files in a "scripts" directory, since those should be allowed to
|
|
47
|
-
* import from "devDependencies".
|
|
48
|
-
*/
|
|
49
|
-
"n/no-unpublished-import": "error",
|
|
50
|
-
|
|
51
|
-
"n/no-unpublished-require": "error",
|
|
52
|
-
|
|
53
|
-
/** Disabled because this rule is deprecated. */
|
|
54
|
-
"n/no-unsupported-features": "off",
|
|
55
|
-
|
|
56
|
-
/** Disabled because it is assumed that we are running on modern versions of Node.js. */
|
|
57
|
-
"n/no-unsupported-features/es-builtins": "off",
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Disabled because it is assumed that our transpiler or runtime has support for the latest
|
|
61
|
-
* version of ESM.
|
|
62
|
-
*/
|
|
63
|
-
"n/no-unsupported-features/es-syntax": "off",
|
|
64
|
-
|
|
65
|
-
/** Disabled since it is handled by the TypeScript compiler. */
|
|
66
|
-
"n/no-unsupported-features/node-builtins": "off",
|
|
67
|
-
|
|
68
|
-
"n/process-exit-as-throw": "error",
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Disabled since it does not work very well with TypeScript. (It needs project-specific
|
|
72
|
-
* configuration depending on where the output directory is located.)
|
|
73
|
-
*/
|
|
74
|
-
"n/shebang": "off",
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
78
|
-
const STYLISTIC_ISSUES = {
|
|
79
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
80
|
-
"n/callback-return": "off",
|
|
81
|
-
|
|
82
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
83
|
-
"n/exports-style": "off",
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* This rule is helpful to automatically fix file extensions in import statements throughout an
|
|
87
|
-
* entire codebase.
|
|
88
|
-
*/
|
|
89
|
-
"n/file-extension-in-import": ["error", "always"],
|
|
90
|
-
|
|
91
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
92
|
-
"n/global-require": "off",
|
|
93
|
-
|
|
94
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
95
|
-
"n/no-mixed-requires": "off",
|
|
96
|
-
|
|
97
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
98
|
-
"n/no-process-env": "off",
|
|
99
|
-
|
|
100
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
101
|
-
"n/no-restricted-import": "off",
|
|
102
|
-
|
|
103
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
104
|
-
"n/no-restricted-require": "off",
|
|
105
|
-
|
|
106
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
107
|
-
"n/no-sync": "off",
|
|
108
|
-
|
|
109
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
110
|
-
"n/prefer-global/buffer": "off",
|
|
111
|
-
|
|
112
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
113
|
-
"n/prefer-global/console": "off",
|
|
114
|
-
|
|
115
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
116
|
-
"n/prefer-global/process": "off",
|
|
117
|
-
|
|
118
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
119
|
-
"n/prefer-global/text-decoder": "off",
|
|
120
|
-
|
|
121
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
122
|
-
"n/prefer-global/text-encoder": "off",
|
|
123
|
-
|
|
124
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
125
|
-
"n/prefer-global/url": "off",
|
|
126
|
-
|
|
127
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
128
|
-
"n/prefer-global/url-search-params": "off",
|
|
129
|
-
|
|
130
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
131
|
-
"n/prefer-promises/dns": "off",
|
|
132
|
-
|
|
133
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
134
|
-
"n/prefer-promises/fs": "off",
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
/** @type {import("eslint").Linter.Config} */
|
|
138
|
-
const config = {
|
|
139
|
-
extends: ["plugin:n/recommended"],
|
|
140
|
-
|
|
141
|
-
rules: {
|
|
142
|
-
...BEST_PRACTICES,
|
|
143
|
-
...POSSIBLE_ERRORS,
|
|
144
|
-
...STYLISTIC_ISSUES,
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
overrides: [
|
|
148
|
-
// Imports in a "scripts" directory can use "devDependencies".
|
|
149
|
-
{
|
|
150
|
-
files: ["**/scripts/*.{js,cjs,mjs,ts,cts,mts}"],
|
|
151
|
-
rules: {
|
|
152
|
-
"n/no-unpublished-import": "off",
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
module.exports = config;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This ESLint config only contains rules from `eslint-plugin-no-autofix`:
|
|
3
|
-
* https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix
|
|
4
|
-
*
|
|
5
|
-
* This allows the fixer for specific core ESLint rules to be turned off.
|
|
6
|
-
*
|
|
7
|
-
* @type {import("eslint").Linter.Config}
|
|
8
|
-
*/
|
|
9
|
-
const config = {
|
|
10
|
-
plugins: ["no-autofix"],
|
|
11
|
-
|
|
12
|
-
rules: {
|
|
13
|
-
/**
|
|
14
|
-
* It is common during development to comment out code after an [early
|
|
15
|
-
* return](https://medium.com/swlh/return-early-pattern-3d18a41bba8). In these cases, the
|
|
16
|
-
* auto-fixer is harmful, since it would require us to manually go put the return statement back
|
|
17
|
-
* after uncommenting the code.
|
|
18
|
-
*/
|
|
19
|
-
"no-autofix/no-useless-return": "error",
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* It is common during development to comment out code that modifies a `let` variable. In these
|
|
23
|
-
* cases, the auto-fixer is harmful, since it would require us to manually go change the `const`
|
|
24
|
-
* back to a `let` after uncommenting the code.
|
|
25
|
-
*/
|
|
26
|
-
"no-autofix/prefer-const": "error",
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
module.exports = config;
|