Skip to content

Commit 6ec7adc

Browse files
committed
Add ESLint
1 parent 708948f commit 6ec7adc

File tree

3 files changed

+1688
-111
lines changed

3 files changed

+1688
-111
lines changed

eslint.config.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import globals from "globals";
2+
import js from "@eslint/js";
3+
import ts from "typescript-eslint";
4+
import prettier from "eslint-config-prettier/flat";
5+
6+
import { defineConfig, globalIgnores } from "eslint/config";
7+
8+
const rootDir = import.meta.dirname;
9+
10+
export default defineConfig([
11+
globalIgnores(["node_modules", "**/*.d.ts", "dist", "vite.config.ts"]),
12+
{
13+
languageOptions: {
14+
globals: globals.browser,
15+
},
16+
},
17+
{
18+
files: [
19+
"**/*.js",
20+
"**/*.cjs",
21+
"**/*.mjs",
22+
"**/*.jsx",
23+
"**/*.ts",
24+
"**/*.tsx",
25+
],
26+
},
27+
js.configs.recommended,
28+
ts.configs["strictTypeChecked"],
29+
ts.configs["stylisticTypeChecked"],
30+
{
31+
files: [
32+
"**/*.js",
33+
"**/*.cjs",
34+
"**/*.mjs",
35+
"**/*.jsx",
36+
"**/*.ts",
37+
"**/*.tsx",
38+
],
39+
languageOptions: {
40+
parser: ts.parser,
41+
parserOptions: {
42+
projectService: true,
43+
tsconfigRootDir: rootDir,
44+
},
45+
},
46+
},
47+
{
48+
rules: {
49+
"@typescript-eslint/no-non-null-assertion": "off",
50+
"@typescript-eslint/no-inferrable-types": [
51+
"warn",
52+
{
53+
ignoreParameters: true,
54+
ignoreProperties: true,
55+
},
56+
],
57+
},
58+
},
59+
prettier,
60+
]);

0 commit comments

Comments
 (0)