forked from michael-andreuzza/astromax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
75 lines (67 loc) · 1.79 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import tslintPlugin from "@typescript-eslint/eslint-plugin";
import importPlugin from "eslint-plugin-import";
import prettier from "eslint-plugin-prettier";
import tsParser from "@typescript-eslint/parser";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import jslint from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
const compat = new FlatCompat({
baseDirectory: dirname(fileURLToPath(import.meta.url)),
recommendedConfig: jslint.configs.recommended,
allConfig: jslint.configs.all,
});
export default [
{
ignores: ["**/node_modules", "**/build", "**/coverage"],
},
...fixupConfigRules(
compat.extends("plugin:@typescript-eslint/recommended", "plugin:import/typescript", "prettier")
),
{
plugins: {
"@typescript-eslint": fixupPluginRules(tslintPlugin),
import: fixupPluginRules(importPlugin),
prettier,
},
languageOptions: {
parser: tsParser,
},
rules: {
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/consistent-type-imports": "error",
"prettier/prettier": [
"error",
{
trailingComma: "es5",
semi: true,
singleQuote: false,
printWidth: 100,
},
],
},
},
{
files: ["**/*.+(ts|tsx)"],
rules: {
"import/order": [
"error",
{
"newlines-between": "always-and-inside-groups",
alphabetize: {
order: "asc",
},
},
],
"sort-imports": [
"error",
{
ignoreDeclarationSort: true,
},
],
},
},
];