-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
110 lines (110 loc) · 2.79 KB
/
.eslintrc.js
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
109
110
/**
* @type {import('@types/eslint').Linter.BaseConfig}
*/
module.exports = {
root: true,
extends: [
"@remix-run/eslint-config",
"@remix-run/eslint-config/node",
"@remix-run/eslint-config/jest-testing-library",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
plugins: ["@typescript-eslint", "import"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./tsconfig.json"],
},
ignorePatterns: [
"node_modules",
"coverage",
"server-build",
"build",
"public/build",
"*.ignored/",
"*.ignored.*",
"remix.config.js",
".cache",
".history",
"tailwind.config.js",
".eslintrc.js",
"vitest.config.ts",
"cypress",
"test",
"mocks",
"remix.init",
"seed.server.ts",
"wait-shadow-db-setup.js",
"cypress.config.ts",
],
// we're using vitest which has a very similar API to jest
// (so the linting plugins work nicely), but it we have to explicitly
// set the jest version.
settings: {
"import/extensions": [".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./tsconfig.json",
},
},
jest: {
version: 27,
},
},
rules: {
"no-console": "warn",
"arrow-body-style": ["warn", "as-needed"],
"react/jsx-filename-extension": "off",
// @typescript-eslint
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/sort-type-union-intersection-members": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-throw-literal": "off", // for CatchBoundaries
//import
"import/no-default-export": "error",
"import/order": [
"error",
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["react"],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
overrides: [
{
files: [
"./app/root.tsx",
"./app/entry.client.tsx",
"./app/entry.server.tsx",
"./app/routes/**/*.tsx",
],
rules: {
"import/no-default-export": "off",
},
},
],
};