-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy patheslint.config.mjs
45 lines (44 loc) · 1.17 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import parser from "@typescript-eslint/parser";
import plugins from "@typescript-eslint/eslint-plugin";
import unusedImports from "eslint-plugin-unused-imports";
import globals from "globals";
export default tseslint.config(
{ ignores: ["dist"] },
{
languageOptions: {
parserOptions: {
parser,
ecmaVersion: 12,
sourceType: "module",
project: ["./tsconfig.json"],
tsconfigRootDir: import.meta.dirname,
globals: globals.node,
},
},
},
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.ts"],
plugins: {
"unused-imports": unusedImports,
},
rules: {
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{ vars: "all", varsIgnorePattern: "^_", args: "after-used", argsIgnorePattern: "^_" },
],
},
},
{
files: ["__tests__/**/*.js", "__tests__/**/*.{ts,tsx}"],
languageOptions: {
parserOptions: {
globals: globals.mocha,
},
},
},
);