This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
/
.eslintrc.js
99 lines (99 loc) · 3.32 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
module.exports = {
plugins: ["filename-rules", "eslint-plugin-n"],
ignorePatterns: [
"node_modules/**/*",
"public/**/*",
"build/**/*",
"ops/**/*",
"agent-build/**/*",
],
overrides: [
{
files: ["*.ts", "*.tsx"],
excludedFiles: ["app/routes/**/*.tsx", "app/components/**/*.tsx"],
parserOptions: {
project: "./tsconfig.json",
},
rules: {
"filename-rules/match": [
"warn",
/^[a-z0-9\-]+(\.[a-z0-9\-]+)?(\.((test)|(d)|(server)|(client)|(shared)))?\.((ts)|(tsx))$/,
],
},
},
// {
// files: ["app/routes/**/*.ts", "app/routes/**/*.tsx"],
// parserOptions: {
// project: "./tsconfig.json",
// },
// rules: {
// "no-restricted-syntax": [
// "warn",
// {
// selector:
// ":matches([id.name='loader'], [id.name='action']):not([init.callee.name='handleRouteErrors'])",
// message: "Always wrap your loader and action functions in handleRouteErrors",
// },
// ],
// },
// },
{
files: ["*.ts", "*.tsx"],
extends: ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
parserOptions: {
project: ["./tsconfig.json"], // Specify it only for TypeScript files
},
rules: {
"n/no-sync": ["error", { allowAtRootLevel: true }],
"n/prefer-global/console": ["error", "always"],
"n/prefer-global/process": ["error", "always"],
"n/prefer-global/text-decoder": ["error", "always"],
"n/prefer-global/text-encoder": ["error", "always"],
"n/prefer-global/url": ["error", "always"],
"n/prefer-global/url-search-params": ["error", "always"],
"n/prefer-promises/fs": "error",
"n/prefer-promises/dns": "error",
"n/no-unsupported-features/node-builtins": ["error"],
"n/no-unsupported-features/es-syntax": ["error"],
"n/no-unsupported-features/es-builtins": ["error"],
"n/no-path-concat": ["error"],
"n/no-deprecated-api": ["error"],
"@typescript-eslint/no-unused-vars": [
"warn",
{ args: "after-used", argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
camelcase: ["warn"],
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/no-empty-function": ["error", { allow: ["arrowFunctions"] }],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-base-to-string": "warn",
"no-console": "warn",
"import/order": [
"warn",
{
alphabetize: {
order: "asc",
caseInsensitive: true,
},
"newlines-between": "always",
},
],
"@typescript-eslint/no-restricted-imports": [
"error",
{
paths: [
{
name: "@prisma/client",
importNames: ["PrismaClient"],
message:
"Please use the client from the request context instead, or if just importing for types, use Prisma.NonTransactionClient",
allowTypeImports: false,
},
],
},
],
"@typescript-eslint/require-array-sort-compare": ["warn", { ignoreStringArrays: true }],
},
},
],
};