eslint-config-isaacscript 5.0.2 → 6.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/package.json +8 -8
- package/src/mod.js +26 -15
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-isaacscript",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A sharable ESLint config for
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"description": "A sharable ESLint config for IsaacScript projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
7
7
|
"config",
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"type": "module",
|
|
25
25
|
"main": "./src/index.js",
|
|
26
26
|
"files": [
|
|
27
|
-
"LICENSE",
|
|
28
|
-
"package.json",
|
|
29
|
-
"README.md",
|
|
30
27
|
"src"
|
|
31
28
|
],
|
|
32
29
|
"scripts": {
|
|
33
30
|
"lint": "tsx ./scripts/lint.ts"
|
|
34
31
|
},
|
|
35
32
|
"dependencies": {
|
|
36
|
-
"eslint-plugin-isaacscript": "
|
|
37
|
-
"typescript-eslint": "
|
|
33
|
+
"eslint-plugin-isaacscript": "4.0.0",
|
|
34
|
+
"typescript-eslint": "8.43.0"
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
40
|
-
"complete-node": "
|
|
37
|
+
"complete-node": "12.0.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"eslint": ">= 9.0.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/mod.js
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import ESLintPluginIsaacScript from "eslint-plugin-isaacscript";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
// Hot-patch "eslint-plugin-isaacscript" to convert errors to warnings.
|
|
5
|
-
for (const config of ESLintPluginIsaacScript.configs.recommended) {
|
|
6
|
-
if (config.rules !== undefined) {
|
|
7
|
-
for (const [key, value] of Object.entries(config.rules)) {
|
|
8
|
-
if (value === "error") {
|
|
9
|
-
config.rules[key] = "warn";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
14
3
|
|
|
15
4
|
/**
|
|
16
5
|
* This ESLint config is meant to be used as a base for IsaacScript mods (or TypeScriptToLua
|
|
17
6
|
* projects).
|
|
18
7
|
*/
|
|
19
|
-
export const isaacScriptModConfigBase =
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
export const isaacScriptModConfigBase = defineConfig(
|
|
9
|
+
{
|
|
10
|
+
plugins: {
|
|
11
|
+
// TODO: The `defineConfig` helper function is bugged.
|
|
12
|
+
// @ts-expect-error https://github.com/typescript-eslint/typescript-eslint/issues/11543
|
|
13
|
+
isaacscript: ESLintPluginIsaacScript,
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
rules: {
|
|
17
|
+
"isaacscript/enum-member-number-separation": "warn",
|
|
18
|
+
"isaacscript/no-invalid-default-map": "warn",
|
|
19
|
+
"isaacscript/no-throw": "warn",
|
|
20
|
+
"isaacscript/require-v-registration": "warn",
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Rules that require type information will throw an error on ".json" files. (This is needed
|
|
24
|
+
// when using `eslint-plugin-package-json`. Even though this config does not currently use the
|
|
25
|
+
// plugin, we include it here defensively.)
|
|
26
|
+
ignores: ["*.json", "*.jsonc"],
|
|
27
|
+
},
|
|
22
28
|
|
|
23
29
|
{
|
|
24
30
|
rules: {
|
|
@@ -199,5 +205,10 @@ export const isaacScriptModConfigBase = tseslint.config(
|
|
|
199
205
|
*/
|
|
200
206
|
"no-restricted-globals": "off",
|
|
201
207
|
},
|
|
208
|
+
|
|
209
|
+
// Rules that require type information will throw an error on ".json" files. (This is needed
|
|
210
|
+
// when using `eslint-plugin-package-json`. Even though this config does not currently use the
|
|
211
|
+
// plugin, we include it here defensively.)
|
|
212
|
+
ignores: ["*.json", "*.jsonc"],
|
|
202
213
|
},
|
|
203
214
|
);
|