eslint-config-isaacscript 4.7.0 → 4.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/base.js +8 -8
- package/{base-eslint.js → configs/base-eslint.js} +1 -5
- package/{base-import.js → configs/base-import.js} +12 -1
- package/{base-n.js → configs/base-n.js} +21 -9
- package/{base-typescript-eslint.js → configs/base-typescript-eslint.js} +34 -2
- package/mod.js +1 -1
- package/package.json +12 -1
- package/monorepo.js +0 -31
- /package/{base-eslint-comments.js → configs/base-eslint-comments.js} +0 -0
- /package/{base-jsdoc.js → configs/base-jsdoc.js} +0 -0
- /package/{base-no-autofix.js → configs/base-no-autofix.js} +0 -0
- /package/{base-unicorn.js → configs/base-unicorn.js} +0 -0
package/base.js
CHANGED
|
@@ -30,14 +30,14 @@ const config = {
|
|
|
30
30
|
* Rule modifications are split out into different files for better organization (based on the
|
|
31
31
|
* originating plugin) .
|
|
32
32
|
*/
|
|
33
|
-
"./base-eslint",
|
|
34
|
-
"./base-no-autofix",
|
|
35
|
-
"./base-typescript-eslint",
|
|
36
|
-
"./base-eslint-comments",
|
|
37
|
-
"./base-import",
|
|
38
|
-
"./base-jsdoc",
|
|
39
|
-
"./base-n", // "n" stands for Node.
|
|
40
|
-
"./base-unicorn",
|
|
33
|
+
"./configs/base-eslint",
|
|
34
|
+
"./configs/base-no-autofix",
|
|
35
|
+
"./configs/base-typescript-eslint",
|
|
36
|
+
"./configs/base-eslint-comments",
|
|
37
|
+
"./configs/base-import",
|
|
38
|
+
"./configs/base-jsdoc",
|
|
39
|
+
"./configs/base-n", // "n" stands for Node.
|
|
40
|
+
"./configs/base-unicorn",
|
|
41
41
|
],
|
|
42
42
|
|
|
43
43
|
plugins: [
|
|
@@ -209,11 +209,7 @@ const SUGGESTIONS = {
|
|
|
209
209
|
|
|
210
210
|
"max-nested-callbacks": "error",
|
|
211
211
|
|
|
212
|
-
/**
|
|
213
|
-
* Disabled because enforcing an arbitrary parameter number threshold for every function in a
|
|
214
|
-
* project does not provide much value. (Additionally, using TypeScript reduces the value of such
|
|
215
|
-
* a check.)
|
|
216
|
-
*/
|
|
212
|
+
/** Superseded by the `@typescript-eslint/max-params` rule. */
|
|
217
213
|
"max-params": "off",
|
|
218
214
|
|
|
219
215
|
/**
|
|
@@ -22,6 +22,8 @@ const HELPFUL_WARNINGS = {
|
|
|
22
22
|
/**
|
|
23
23
|
* The options are [copied from
|
|
24
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".
|
|
25
27
|
*/
|
|
26
28
|
"import/no-extraneous-dependencies": [
|
|
27
29
|
"error",
|
|
@@ -49,6 +51,8 @@ const HELPFUL_WARNINGS = {
|
|
|
49
51
|
"**/protractor.conf.*.js", // protractor config
|
|
50
52
|
"**/karma.conf.js", // karma config
|
|
51
53
|
"**/.eslintrc.js", // eslint config
|
|
54
|
+
|
|
55
|
+
"**/scripts/*.{js,cjs,mjs,ts,cts,mts}", // Files inside of a "scripts" directory.
|
|
52
56
|
],
|
|
53
57
|
optionalDependencies: false,
|
|
54
58
|
},
|
|
@@ -217,7 +221,14 @@ const config = {
|
|
|
217
221
|
|
|
218
222
|
// Disable some specific rules in config files.
|
|
219
223
|
{
|
|
220
|
-
files: [
|
|
224
|
+
files: [
|
|
225
|
+
".remarkrc.mjs",
|
|
226
|
+
".remarkrc.js",
|
|
227
|
+
"prettier.config.mjs",
|
|
228
|
+
"prettier.config.js",
|
|
229
|
+
"typedoc.config.mjs",
|
|
230
|
+
"typedoc.config.js",
|
|
231
|
+
],
|
|
221
232
|
rules: {
|
|
222
233
|
"import/no-default-export": "off",
|
|
223
234
|
},
|
|
@@ -41,7 +41,13 @@ const POSSIBLE_ERRORS = {
|
|
|
41
41
|
"n/no-process-exit": "off",
|
|
42
42
|
|
|
43
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
|
+
*/
|
|
44
49
|
"n/no-unpublished-import": "error",
|
|
50
|
+
|
|
45
51
|
"n/no-unpublished-require": "error",
|
|
46
52
|
|
|
47
53
|
/** Disabled because this rule is deprecated. */
|
|
@@ -61,15 +67,11 @@ const POSSIBLE_ERRORS = {
|
|
|
61
67
|
|
|
62
68
|
"n/process-exit-as-throw": "error",
|
|
63
69
|
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"src/**/*.ts": ["^src/(.+?)\\.ts$", "dist/$1.js"],
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
],
|
|
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",
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
/** @type {import("eslint").Linter.RulesRecord} */
|
|
@@ -141,6 +143,16 @@ const config = {
|
|
|
141
143
|
...POSSIBLE_ERRORS,
|
|
142
144
|
...STYLISTIC_ISSUES,
|
|
143
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
|
+
],
|
|
144
156
|
};
|
|
145
157
|
|
|
146
158
|
module.exports = config;
|
|
@@ -46,6 +46,14 @@ const SUPPORTED_RULES = {
|
|
|
46
46
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
47
47
|
|
|
48
48
|
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Disabled because enforcing an arbitrary parameter number threshold for every function in a
|
|
52
|
+
* project does not provide much value. (Additionally, using TypeScript reduces the value of such
|
|
53
|
+
* a check.)
|
|
54
|
+
*/
|
|
55
|
+
"@typescript-eslint/max-params": "off",
|
|
56
|
+
|
|
49
57
|
"@typescript-eslint/member-delimiter-style": "off", // eslint-config-prettier
|
|
50
58
|
|
|
51
59
|
/** Disabled since prescribed class ordering is too project-specific. */
|
|
@@ -100,7 +108,13 @@ const SUPPORTED_RULES = {
|
|
|
100
108
|
"@typescript-eslint/no-explicit-any": "error",
|
|
101
109
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
102
110
|
"@typescript-eslint/no-extraneous-class": "error",
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The rule is disabled in "*.test.ts" files, since the built-in Node test runner returns a
|
|
114
|
+
* promise that is not meant to be awaited.
|
|
115
|
+
*/
|
|
103
116
|
"@typescript-eslint/no-floating-promises": "error",
|
|
117
|
+
|
|
104
118
|
"@typescript-eslint/no-for-in-array": "error",
|
|
105
119
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
106
120
|
"@typescript-eslint/no-inferrable-types": "error",
|
|
@@ -322,7 +336,17 @@ const EXTENSION_RULES = {
|
|
|
322
336
|
|
|
323
337
|
"@typescript-eslint/no-shadow": "error",
|
|
324
338
|
"@typescript-eslint/no-throw-literal": "error",
|
|
325
|
-
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* The `allowTaggedTemplates` option is enabled to allow the rule to work with libraries like
|
|
342
|
+
* `execa`.
|
|
343
|
+
*/
|
|
344
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
345
|
+
"error",
|
|
346
|
+
{
|
|
347
|
+
allowTaggedTemplates: true,
|
|
348
|
+
},
|
|
349
|
+
],
|
|
326
350
|
|
|
327
351
|
/**
|
|
328
352
|
* The `args` option is set to `all` make the rule stricter. Additionally, we ignore things that
|
|
@@ -381,7 +405,7 @@ const EXTENSION_RULES = {
|
|
|
381
405
|
const config = {
|
|
382
406
|
// We need to provide some special configuration to ESLint in order for it to parse TypeScript
|
|
383
407
|
// files. From:
|
|
384
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/
|
|
408
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/base.ts
|
|
385
409
|
parser: "@typescript-eslint/parser",
|
|
386
410
|
parserOptions: {
|
|
387
411
|
sourceType: "module",
|
|
@@ -419,6 +443,14 @@ const config = {
|
|
|
419
443
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
420
444
|
},
|
|
421
445
|
},
|
|
446
|
+
|
|
447
|
+
// The built-in Node.js test-runner returns a promise which is not meant to be awaited.
|
|
448
|
+
{
|
|
449
|
+
files: ["*.test.ts"],
|
|
450
|
+
rules: {
|
|
451
|
+
"@typescript-eslint/no-floating-promises": "off",
|
|
452
|
+
},
|
|
453
|
+
},
|
|
422
454
|
],
|
|
423
455
|
};
|
|
424
456
|
|
package/mod.js
CHANGED
|
@@ -7,7 +7,7 @@ const config = {
|
|
|
7
7
|
extends: [
|
|
8
8
|
/**
|
|
9
9
|
* The IsaacScript mod config extends the base configuration:
|
|
10
|
-
* https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/
|
|
10
|
+
* https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/base.js
|
|
11
11
|
* (Normal TypeScript projects would just use the base configuration directly.)
|
|
12
12
|
*/
|
|
13
13
|
"./base",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-isaacscript",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.1",
|
|
4
4
|
"description": "A sharable ESLint config for TypeScript and IsaacScript projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -22,6 +22,17 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"author": "Zamiell",
|
|
24
24
|
"type": "commonjs",
|
|
25
|
+
"files": [
|
|
26
|
+
"configs",
|
|
27
|
+
"base.js",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"mod.js",
|
|
30
|
+
"package.json",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"lint": "tsx ./scripts/lint.mts"
|
|
35
|
+
},
|
|
25
36
|
"dependencies": {
|
|
26
37
|
"confusing-browser-globals": "^1.0.11"
|
|
27
38
|
}
|
package/monorepo.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const path = require("node:path");
|
|
2
|
-
|
|
3
|
-
const REPO_ROOT = path.join(__dirname, "..", "..", "..");
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This config is meant to be used in the IsaacScript monorepo.
|
|
7
|
-
*
|
|
8
|
-
* @type {import("eslint").Linter.Config}
|
|
9
|
-
*/
|
|
10
|
-
const config = {
|
|
11
|
-
// We need to add the `tsconfigRootDir` property, but we must also repeat the options from
|
|
12
|
-
// "base-typescript-eslint.js" or they will be deleted.
|
|
13
|
-
parserOptions: {
|
|
14
|
-
sourceType: "module",
|
|
15
|
-
ecmaVersion: "latest",
|
|
16
|
-
tsconfigRootDir: REPO_ROOT,
|
|
17
|
-
project: true,
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
rules: {
|
|
21
|
-
// This rule has to be told which "package.json" file that the dependencies are located in.
|
|
22
|
-
"import/no-extraneous-dependencies": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
packageDir: REPO_ROOT,
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
module.exports = config;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|