-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
64 lines (60 loc) · 1.75 KB
/
eslint.config.mjs
File metadata and controls
64 lines (60 loc) · 1.75 KB
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
import eslint from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import { flatConfigs } from "eslint-plugin-import-x";
import { config, configs as tsConfigs } from "typescript-eslint";
const ESLintConfig = config(
eslint.configs.recommended,
...tsConfigs.recommended,
flatConfigs.recommended,
flatConfigs.typescript,
{
ignores: ["node_modules", "build"],
languageOptions: {
parser: tsParser,
ecmaVersion: 2024,
sourceType: "module",
parserOptions: {
project: "./tsconfig.json",
ecmaFeatures: {
arrowFunctions: true,
},
},
},
rules: {
// Warning for unused variables
"@typescript-eslint/no-unused-vars": "warn",
// Prefer const over let
"prefer-const": "warn",
// Prefer arrow functions
"func-style": ["warn", "expression"],
// Consistent usage of type over interface
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
// Module import sorting and grouping
"import-x/order": [
"warn",
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
pattern: "@app/**",
group: "internal",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["@app/**"],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
// Additional rules for TypeScript and Node.js
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"no-console": "warn",
"no-unused-expressions": "warn",
},
}
);
export default ESLintConfig;