Skip to content

Commit f0ad87d

Browse files
committed
Update eslint
1 parent f2d82fe commit f0ad87d

File tree

6 files changed

+309
-311
lines changed

6 files changed

+309
-311
lines changed

.eslintrc.json

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

.ncurc.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
2+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
23
target: (dependencyName, [{ semver, version, operator, major, minor, patch, release, build }]) => {
34
if (dependencyName.startsWith("@mantine/")) return "minor";
4-
if (dependencyName === "eslint") return "minor";
55
if (dependencyName === "@tabler/icons-react") return "minor";
66
if (dependencyName === "react") return "minor";
77
if (dependencyName === "@types/react") return "minor";
@@ -10,6 +10,7 @@ module.exports = {
1010
if (major === "0") return "minor";
1111
return "latest";
1212
},
13+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1314
reject: (name, semver) => {
1415
if (name === "tmp") {
1516
return true;

eslint.config.mjs

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
// @ts-check
2+
import eslint from "@eslint/js";
3+
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
4+
import eslintPluginUnicorn from "eslint-plugin-unicorn";
5+
import globals from "globals";
6+
import tseslint from "typescript-eslint";
7+
8+
export default tseslint.config(
9+
{
10+
files: ["**/*.{ts,tsx,cts,mts,js,cjs,mjs}"],
11+
},
12+
{
13+
ignores: [
14+
"**/dist/**",
15+
"**/node_modules/**",
16+
"bin/**",
17+
"coverage/**",
18+
],
19+
},
20+
eslint.configs.recommended,
21+
...tseslint.configs.strictTypeChecked,
22+
eslintPluginUnicorn.configs["flat/recommended"],
23+
{
24+
languageOptions: {
25+
parserOptions: {
26+
warnOnUnsupportedTypeScriptVersion: false,
27+
ecmaVersion: "latest",
28+
sourceType: "module",
29+
project: true,
30+
},
31+
globals: globals.node,
32+
},
33+
plugins: {
34+
"simple-import-sort": eslintPluginSimpleImportSort,
35+
},
36+
},
37+
{
38+
"rules": {
39+
"eqeqeq": "error",
40+
"no-constant-condition": "off",
41+
"no-inner-declarations": "off",
42+
"no-undef": "off",
43+
"no-unused-vars": "off",
44+
"no-restricted-globals": ["error", "console", "process"],
45+
"simple-import-sort/imports": "error",
46+
"simple-import-sort/exports": "error",
47+
// In theory good, but less good when declaring a new interface and
48+
// stopping to think about its contents.
49+
"@typescript-eslint/no-empty-interface": "off",
50+
"@typescript-eslint/no-namespace": "off",
51+
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
52+
"@typescript-eslint/no-use-before-define": "off",
53+
"@typescript-eslint/no-explicit-any": "off",
54+
"@typescript-eslint/no-unsafe-argument": "off",
55+
"@typescript-eslint/no-unsafe-assignment": "off",
56+
"@typescript-eslint/no-unsafe-call": "off",
57+
"@typescript-eslint/no-unsafe-member-access": "off",
58+
"@typescript-eslint/no-unsafe-return": "off",
59+
"@typescript-eslint/no-empty-object-type": "off",
60+
"@typescript-eslint/require-await": "off",
61+
"@typescript-eslint/restrict-template-expressions": "off",
62+
"@typescript-eslint/naming-convention": [
63+
"error",
64+
{
65+
"selector": [
66+
"classProperty",
67+
"typeProperty",
68+
"parameterProperty",
69+
"classMethod",
70+
"typeMethod",
71+
"accessor",
72+
],
73+
"modifiers": ["private"],
74+
"leadingUnderscore": "require",
75+
"format": ["camelCase"],
76+
"filter": {
77+
"regex": "^(test_| )",
78+
"match": false,
79+
},
80+
},
81+
{
82+
"selector": [
83+
"classProperty",
84+
"typeProperty",
85+
"parameterProperty",
86+
"classMethod",
87+
"typeMethod",
88+
"accessor",
89+
],
90+
"modifiers": ["protected"],
91+
"leadingUnderscore": "allow",
92+
"format": ["camelCase"],
93+
"filter": {
94+
"regex": "^(test_| )",
95+
"match": false,
96+
},
97+
},
98+
{
99+
"selector": [
100+
"classProperty",
101+
"typeProperty",
102+
"parameterProperty",
103+
"classMethod",
104+
"typeMethod",
105+
"accessor",
106+
],
107+
"modifiers": ["public"],
108+
"leadingUnderscore": "forbid",
109+
"format": ["camelCase"],
110+
"filter": {
111+
"regex": "^(test_| )",
112+
"match": false,
113+
},
114+
},
115+
],
116+
"unicorn/no-negated-condition": "off",
117+
"unicorn/catch-error-name": "off",
118+
"unicorn/filename-case": "off",
119+
"unicorn/no-array-callback-reference": "off",
120+
"unicorn/no-await-expression-member": "off",
121+
"unicorn/no-useless-undefined": "off",
122+
"unicorn/prevent-abbreviations": "off",
123+
"unicorn/switch-case-braces": "off",
124+
"unicorn/prefer-string-replace-all": "off", // Bad suggestion for old targets
125+
},
126+
},
127+
{
128+
files: [
129+
".ncurc.cjs",
130+
"eslint.config.mjs",
131+
"vite.config.ts",
132+
],
133+
extends: [tseslint.configs.disableTypeChecked],
134+
},
135+
);

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@
3434
"@types/react": "^18.3.14",
3535
"@types/react-dom": "^18.3.2",
3636
"@types/tmp": "^0.2.6",
37-
"@typescript-eslint/eslint-plugin": "^8.17.0",
38-
"@typescript-eslint/parser": "^8.17.0",
3937
"@vitejs/plugin-react": "^4.3.4",
4038
"dprint": "^0.47.6",
4139
"esbuild": "0.24.0",
42-
"eslint": "^8.57.1",
40+
"eslint": "^9.16.0",
4341
"eslint-plugin-simple-import-sort": "^12.1.1",
4442
"eslint-plugin-unicorn": "^56.0.1",
4543
"execa": "^9.5.2",
44+
"globals": "^15.13.0",
4645
"node-fetch": "^3.3.2",
4746
"tmp": "^0.2.3",
4847
"ts-morph": "^24.0.0",
4948
"tsx": "^4.19.2",
5049
"typescript": "^5.7.2",
50+
"typescript-eslint": "^8.17.0",
5151
"vite": "^6.0.3",
5252
"vite-plugin-node-polyfills": "^0.22.0",
5353
"vite-plugin-static-copy": "^2.2.0"

0 commit comments

Comments
 (0)