forked from valkey-io/valkey-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
97 lines (95 loc) · 3 KB
/
eslint.config.js
File metadata and controls
97 lines (95 loc) · 3 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
import importPlugin from "eslint-plugin-import";
import stylistic from "@stylistic/eslint-plugin";
import react from "eslint-plugin-react";
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import { globalIgnores } from "eslint/config";
export default tseslint.config([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
plugins: {
react,
"@stylistic": stylistic,
import: importPlugin,
},
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs["recommended-latest"],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
rules: {
quotes: ["error", "double"],
"keyword-spacing": ["error", { "before": true, "after": true }],
"import/order": [
"error",
{
groups: [
["builtin", "external"], // Built-in modules and external packages
["internal"], // Internal modules (e.g., aliased paths)
["parent", "sibling", "index"], // Relative imports
["type"], // Type imports (if using TypeScript)
["object"], // Side-effect imports (e.g., CSS imports without assigned variables)
],
pathGroups: [
{
pattern: "**/*.css",
group: "object", // Assign CSS imports to the 'object' group
position: "after", // Ensure they appear after other imports in this group
},
{
pattern: "**/*.scss", // Include SCSS if applicable
group: "object",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin", "external"], // Exclude these from path group matching
},
],
// Enforce a single newline at the end of non-empty files
"eol-last": "error",
// Prevent multiple consecutive empty lines, allowing only one
"no-multiple-empty-lines": ["error", { max: 1 }],
semi: ["error", "never"],
"no-unexpected-multiline": "error",
"arrow-parens": ["error", "always"],
"comma-dangle": [
"error",
{
arrays: "always-multiline",
objects: "always-multiline",
imports: "never",
exports: "never",
functions: "always-multiline", // This is the key for function arguments
},
],
"max-len": [
"error",
{
code: 145,
ignoreComments: false,
ignoreUrls: false,
ignoreStrings: false,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
"object-curly-spacing": ["error", "always"],
"@stylistic/indent": ["error", 2],
"react/jsx-sort-props": [
"error",
{
noSortAlphabetically: false,
},
],
},
},
]);