-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
.eslintrc.js
82 lines (78 loc) · 2.49 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
const { resolve } = require('node:path');
const project = resolve(__dirname, 'tsconfig.json');
module.exports = {
root: true,
extends: [
require.resolve('@vercel/style-guide/eslint/node'),
require.resolve('@vercel/style-guide/eslint/typescript'),
require.resolve('@vercel/style-guide/eslint/browser'),
require.resolve('@vercel/style-guide/eslint/react'),
require.resolve('@vercel/style-guide/eslint/next'),
],
parserOptions: {
project,
},
settings: {
'import/resolver': {
typescript: {
project,
},
},
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true,
},
],
'@typescript-eslint/no-shadow': [
'error',
{
ignoreOnInitialization: true,
},
],
'import/newline-after-import': 'error',
'react/jsx-uses-react': 'error',
'react/react-in-jsx-scope': 'error',
'unicorn/filename-case': [
'error',
{
cases: {
kebabCase: true, // personal style
pascalCase: true,
},
},
],
// Deactivated
'@typescript-eslint/dot-notation': 'off', // paths are used with a dot notation
'@typescript-eslint/no-misused-promises': 'off', // onClick with async fails
'@typescript-eslint/no-non-null-assertion': 'off', // sometimes compiler is unable to detect
'@typescript-eslint/no-unnecessary-condition': 'off', // remove when no static data is used
'@typescript-eslint/require-await': 'off', // Server Actions require async flag always
'@typescript-eslint/prefer-nullish-coalescing': 'off', // personal style
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowNumber: true,
},
],
'import/no-default-export': 'off', // Next.js components must be exported as default
'import/no-extraneous-dependencies': 'off', // conflict with sort-imports plugin
'import/order': 'off', // using custom sort plugin
'no-nested-ternary': 'off', // personal style
'no-redeclare': 'off', // conflict with TypeScript function overloads
'react/jsx-fragments': 'off', // personal style
'react/prop-types': 'off', // TypeScript is used for type checking
'@next/next/no-img-element': 'off', // Temporary disabled
},
};