-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
88 lines (81 loc) · 2.78 KB
/
eslint.config.js
File metadata and controls
88 lines (81 loc) · 2.78 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
import stylistic from "@stylistic/eslint-plugin";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import eslintPluginJsonc from "eslint-plugin-jsonc";
import reactHooks from "eslint-plugin-react-hooks";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import globals from "globals";
export default [
// Base configuration for all TypeScript files
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2022,
sourceType: "module",
},
globals: globals.node,
},
plugins: {
"@typescript-eslint": typescriptEslint,
"@stylistic": stylistic,
"simple-import-sort": simpleImportSort,
"react-hooks": reactHooks,
"unicorn": eslintPluginUnicorn,
},
rules: {
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "warn",
"no-dupe-keys": "error",
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],
"@typescript-eslint/no-invalid-this": ["error"],
"@stylistic/brace-style": ["error", "allman", { allowSingleLine: true }],
"@stylistic/quotes": ["error", "double"],
"@stylistic/comma-dangle": ["error", "always-multiline"],
"@stylistic/indent": ["error", 4],
"@stylistic/eol-last": ["error", "always"],
"@stylistic/object-curly-spacing": ["error", "always"],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
...reactHooks.configs["recommended-latest"].rules,
"unicorn/filename-case": ["error", { case: "kebabCase" }],
},
},
// Lint all json files
{
files: ["**/*.json"],
ignores: ["**/package-lock.json"],
plugins: {
"jsonc": eslintPluginJsonc,
"@stylistic": stylistic,
},
languageOptions: {
parser: eslintPluginJsonc,
},
rules: {
"jsonc/indent": ["error", 4],
"jsonc/comma-dangle": ["error", "never"],
"@stylistic/eol-last": ["error", "always"],
},
},
// Global ignores
{
ignores: [
"dist",
"node_modules",
"patches",
".git",
"**/dist/**",
"**/node_modules/**",
".code-bandit",
],
},
];