Skip to content

Commit 9074613

Browse files
committed
Update internal use of ESLint to v9/flat config.
Update fixture testing to account for that.
1 parent 3fa682c commit 9074613

File tree

11 files changed

+293
-1145
lines changed

11 files changed

+293
-1145
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 70 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// @ts-check
2+
import js from "@eslint/js";
3+
import globals from "globals";
4+
import tseslint from "typescript-eslint";
5+
import pluginEslintPlugin from "eslint-plugin-eslint-plugin";
6+
import solid from "./dist/index.js";
7+
8+
export default tseslint.config(
9+
{
10+
ignores: ["dist", "**/dist.*", "./configs", "node_modules", "eslint.config.mjs"],
11+
},
12+
js.configs.recommended,
13+
...tseslint.configs.recommended,
14+
{
15+
languageOptions: {
16+
sourceType: "module",
17+
parser: tseslint.parser,
18+
parserOptions: {
19+
project: "tsconfig.json",
20+
},
21+
globals: globals.node,
22+
},
23+
rules: {
24+
"@typescript-eslint/no-explicit-any": "off",
25+
"@typescript-eslint/no-non-null-assertion": "off",
26+
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
27+
"no-extra-semi": "off",
28+
"no-mixed-spaces-and-tabs": "off",
29+
"no-new-native-nonconstructor": 1,
30+
"no-new-symbol": "off",
31+
"object-shorthand": "warn",
32+
},
33+
},
34+
{
35+
files: ["src/rules/*.ts", "configs/*"],
36+
languageOptions: {
37+
globals: globals.node,
38+
},
39+
plugins: {
40+
"eslint-plugin": pluginEslintPlugin,
41+
},
42+
rules: {
43+
...pluginEslintPlugin.configs.recommended.rules,
44+
"eslint-plugin/meta-property-ordering": "error",
45+
"eslint-plugin/report-message-format": ["error", "^[A-Z\\{'].*\\.$"],
46+
"eslint-plugin/test-case-property-ordering": "error",
47+
"eslint-plugin/require-meta-docs-description": [
48+
"error",
49+
{ pattern: "^(Enforce|Require|Disallow)" },
50+
],
51+
"eslint-plugin/require-meta-docs-url": [
52+
"error",
53+
{
54+
pattern:
55+
"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/{{name}}.md",
56+
},
57+
],
58+
},
59+
},
60+
// standalone is designed not to need any Node or browser APIs
61+
{
62+
files: ["standalone/index.js"],
63+
languageOptions: {
64+
globals: {},
65+
},
66+
},
67+
// fixture gets tested with the plugin
68+
{
69+
files: ["test/fixture/**/*.{js,jsx,ts,tsx}"],
70+
...solid.configs["flat/recommended"],
71+
languageOptions: {
72+
globals: globals.browser,
73+
},
74+
rules: {
75+
...solid.configs['flat/recommended'].rules,
76+
"@typescript-eslint/ban-ts-comment": 0,
77+
"@typescript-eslint/no-unused-vars": 0,
78+
},
79+
}
80+
);

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"prepare": "husky install",
2222
"prepublishOnly": "pnpm build && pnpm lint && prettier --check src && pnpm test:all",
2323
"build": "tsc -p tsconfig.build.json && pnpm run docs",
24-
"lint": "eslint --ext .js,.jsx,.ts,.tsx --ignore-pattern test/fixture/invalid .",
24+
"eslint": "node node_modules/eslint/bin/eslint.js",
25+
"lint": "pnpm eslint --ignore-pattern test/fixture/invalid",
2526
"docs": "PARSER=none tsx scripts/docs.ts",
2627
"test": "vitest",
2728
"test:ts": "PARSER=ts pnpm test",
@@ -37,7 +38,7 @@
3738
"README.md"
3839
],
3940
"dependencies": {
40-
"@typescript-eslint/utils": "^7.6.0",
41+
"@typescript-eslint/utils": "^7.13.1",
4142
"estraverse": "^5.3.0",
4243
"is-html": "^2.0.0",
4344
"kebab-case": "^1.0.2",
@@ -46,32 +47,34 @@
4647
},
4748
"devDependencies": {
4849
"@babel/core": "^7.24.4",
49-
"@babel/eslint-parser": "^7.24.1",
50+
"@babel/eslint-parser": "^7.24.7",
5051
"@tsconfig/node20": "^20.1.4",
52+
"@types/eslint": "^8.56.10",
5153
"@types/eslint-v6": "npm:@types/eslint@6",
5254
"@types/eslint-v7": "npm:@types/eslint@7",
5355
"@types/eslint-v8": "npm:@types/eslint@8",
56+
"@types/eslint__js": "^8.42.3",
5457
"@types/estraverse": "^5.1.7",
5558
"@types/is-html": "^2.0.2",
5659
"@types/markdown-magic": "^1.0.4",
57-
"@types/node": "^16.18.94",
60+
"@types/node": "^20",
5861
"@types/prettier": "^2.7.3",
59-
"@typescript-eslint/eslint-plugin": "^6.21.0",
60-
"@typescript-eslint/parser": "^6.21.0",
61-
"eslint": "^9.0.0",
62-
"eslint-plugin-eslint-plugin": "^5.5.0",
63-
"eslint-plugin-import": "^2.29.1",
62+
"@typescript-eslint/eslint-plugin": "^7.13.1",
63+
"@typescript-eslint/parser": "^7.13.1",
64+
"eslint": "^9.5.0",
65+
"eslint-plugin-eslint-plugin": "^6.1.0",
6466
"eslint-plugin-solid": "link:",
6567
"eslint-v6": "npm:eslint@6",
6668
"eslint-v7": "npm:eslint@7",
6769
"eslint-v8": "npm:eslint@8",
70+
"globals": "^15.6.0",
6871
"husky": "^8.0.3",
6972
"lint-staged": "^13.3.0",
7073
"markdown-magic": "^2.6.1",
7174
"prettier": "^2.8.8",
7275
"tsx": "^4.7.3",
7376
"typescript": "^5.4.3",
74-
"typescript-eslint": "^7.7.1",
77+
"typescript-eslint": "^7.13.1",
7578
"vitest": "^1.5.2"
7679
},
7780
"peerDependencies": {

0 commit comments

Comments
 (0)