eslint-config-isaacscript 5.0.1 → 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.
Files changed (3) hide show
  1. package/package.json +9 -8
  2. package/src/index.js +1 -0
  3. package/src/mod.js +26 -15
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-config-isaacscript",
3
- "version": "5.0.1",
4
- "description": "A sharable ESLint config for TypeScript and IsaacScript projects.",
3
+ "version": "6.0.0",
4
+ "description": "A sharable ESLint config for IsaacScript projects.",
5
5
  "keywords": [
6
6
  "eslint",
7
7
  "config",
@@ -22,20 +22,21 @@
22
22
  "license": "MIT",
23
23
  "author": "Zamiell",
24
24
  "type": "module",
25
+ "main": "./src/index.js",
25
26
  "files": [
26
- "LICENSE",
27
- "package.json",
28
- "README.md",
29
27
  "src"
30
28
  ],
31
29
  "scripts": {
32
30
  "lint": "tsx ./scripts/lint.ts"
33
31
  },
34
32
  "dependencies": {
35
- "eslint-plugin-isaacscript": "^4.0.0",
36
- "typescript-eslint": "^8.5.0"
33
+ "eslint-plugin-isaacscript": "4.0.0",
34
+ "typescript-eslint": "8.43.0"
37
35
  },
38
36
  "devDependencies": {
39
- "complete-node": "^1.3.0"
37
+ "complete-node": "12.0.0"
38
+ },
39
+ "peerDependencies": {
40
+ "eslint": ">= 9.0.0"
40
41
  }
41
42
  }
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ export { isaacScriptModConfigBase } from "./mod.js";
package/src/mod.js CHANGED
@@ -1,24 +1,30 @@
1
1
  import ESLintPluginIsaacScript from "eslint-plugin-isaacscript";
2
- import tseslint from "typescript-eslint";
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 = tseslint.config(
20
- // `eslint-plugin-isaacscript` provides rules specifically for IsaacScript mods.
21
- ...ESLintPluginIsaacScript.configs.recommended,
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
  );