Skip to content

Commit f11ad39

Browse files
committed
update to eslint flat config
1 parent 73d93a1 commit f11ad39

File tree

3 files changed

+51
-44
lines changed

3 files changed

+51
-44
lines changed

.eslintignore

-13
This file was deleted.

.eslintrc.json

-31
This file was deleted.

eslint.config.mjs

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import globals from "globals";
3+
import tsParser from "@typescript-eslint/parser";
4+
import path from "node:path";
5+
import { fileURLToPath } from "node:url";
6+
import js from "@eslint/js";
7+
import { FlatCompat } from "@eslint/eslintrc";
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all
15+
});
16+
17+
export default [{
18+
ignores: [
19+
"**/node_modules",
20+
"**/dist",
21+
"**/build",
22+
"**/scripts",
23+
"**/package.json",
24+
"**/package-lock.json",
25+
],
26+
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
27+
plugins: {
28+
"@typescript-eslint": typescriptEslint,
29+
},
30+
31+
languageOptions: {
32+
globals: {
33+
...globals.browser,
34+
...Object.fromEntries(Object.entries(globals.node).map(([key]) => [key, "off"])),
35+
},
36+
37+
parser: tsParser,
38+
},
39+
40+
rules: {
41+
"@typescript-eslint/naming-convention": ["warn", {
42+
selector: "interface",
43+
format: ["PascalCase"],
44+
45+
custom: {
46+
regex: "^I[A-Z]",
47+
match: true,
48+
},
49+
}],
50+
},
51+
}];

0 commit comments

Comments
 (0)