Skip to content

Commit 4226aff

Browse files
committed
eslint config
1 parent 1d7430e commit 4226aff

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

eslint.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { fixupConfigRules } from "@eslint/compat";
2+
import globals from "globals";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import js from "@eslint/js";
6+
import { FlatCompat } from "@eslint/eslintrc";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all
14+
});
15+
16+
export default [
17+
...fixupConfigRules(compat.extends("eslint:recommended", "plugin:import/recommended")),
18+
{
19+
languageOptions: {
20+
globals: {
21+
...globals.browser,
22+
...globals.node,
23+
Atomics: "readonly",
24+
SharedArrayBuffer: "readonly",
25+
},
26+
},
27+
28+
rules: {
29+
"no-unused-vars": ["warn", {
30+
argsIgnorePattern: "^_",
31+
varsIgnorePattern: "^_",
32+
}],
33+
},
34+
},
35+
];

0 commit comments

Comments
 (0)