-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
97 lines (96 loc) · 2.98 KB
/
eslint.config.mjs
File metadata and controls
97 lines (96 loc) · 2.98 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 comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import eslint from "@eslint/js";
import pluginQuery from "@tanstack/eslint-plugin-query";
import pluginRouter from "@tanstack/eslint-plugin-router";
import pluginImport from "eslint-plugin-import";
import tsdoc from "eslint-plugin-tsdoc";
import { globalIgnores } from "eslint/config";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
pluginImport.configs.recommended,
pluginQuery.configs.recommended,
pluginRouter.configs.recommended,
tsdoc.configs.recommended,
comments.recommended,
{
files: ["**/*.{js,cjs,mjs,jsx}"],
extends: [tseslint.configs.disableTypeChecked],
},
{
files: ["**/*.{ts,tsx}"],
extends: [
pluginImport.flatConfigs.recommended,
pluginImport.flatConfigs.typescript,
],
},
{
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^(?:_|...)",
varsIgnorePattern: "^(?:_|...)",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"sort-imports": [
"error",
{
ignoreCase: false,
ignoreDeclarationSort: true, // use eslint-plugin-import to handle this rule
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
allowSeparatedGroups: true,
},
],
"import/no-named-as-default-member": "off",
"import/namespace": "off",
"import/order": [
"error",
{
groups: [
"builtin", // Built-in imports
"external", // External imports
"internal", // Absolute imports
["sibling", "parent"], // Relative imports
"index", // index imports
"unknown",
],
// Keep all the `react` imports at the top level
pathGroups: [
{ pattern: "react", group: "builtin", position: "before" },
],
"newlines-between": "always",
alphabetize: {
// sort in ascending order
order: "asc",
caseInsensitive: true,
},
// Exclude `react` imports so that our custom pathGroups applies
pathGroupsExcludedImportTypes: ["react"],
},
],
"tsdoc/syntax": "error",
},
},
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".tanstack/**",
".vite/**",
"out/**",
"build/**",
"migrations/**",
"userData/**",
"forge.env.d.ts",
])
);