-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
108 lines (104 loc) · 3.55 KB
/
Copy patheslint.config.ts
File metadata and controls
108 lines (104 loc) · 3.55 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import globals from 'globals';
import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
export default defineConfig(
// Base configuration
eslint.configs.recommended,
tseslint.configs.recommended,
// Global ignores
{
ignores: ["dist", "build", "node_modules", "*.config.ts", "*.config.js"],
},
// React rules
pluginReact.configs.flat.recommended,
// Project-specific configuration
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.browser,
...globals.node
}
},
settings: {
react: {
version: "detect",
},
},
rules: {
"max-len": ["warn", {
"code": 135,
"tabWidth": 4,
"comments": 200,
}],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
}],
"no-lonely-if": "error",
"no-lone-blocks": "error",
"dot-notation": "off",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"eqeqeq": ["error", "smart"],
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-exports": "error",
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/no-deprecated": "error",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "separate-type-imports"
}
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": null,
},
{
"selector": "variable",
"format": ["camelCase", "PascalCase", "UPPER_CASE"],
"leadingUnderscore": "allow",
},
{
"selector": "function",
"format": ["camelCase", "PascalCase"],
},
{
"selector": "typeLike",
"format": ["PascalCase"],
},
],
"@typescript-eslint/method-signature-style": ["error", "property"],
"quotes": ["error", "single", { avoidEscape: true }],
"semi": ["error", "always"],
"react/react-in-jsx-scope": "off",
"react/no-unescaped-entities": "off",
},
},
// Specific configuration for test files
{
files: ["**/*.test.{js,ts,jsx,tsx}"],
rules: {
"no-console": "off",
},
},
);