-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy path.eslintrc.js
72 lines (65 loc) · 2.42 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
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['next/core-web-vitals', 'plugin:prettier/recommended', 'plugin:storybook/recommended'],
plugins: ['prettier', 'unused-imports', 'react-hooks', 'tailwindcss'],
rules: {
'prefer-template': 'warn',
'unused-imports/no-unused-imports': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'import/order': [
'error',
{
groups: [['builtin', 'external'], 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
shorthandFirst: true,
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': ['warn', { additionalHooks: '(useAsyncEffect)' }],
'tailwindcss/enforces-shorthand': 'warn',
'tailwindcss/no-contradicting-classname': 'error',
'tailwindcss/enforces-negative-arbitrary-values': 'warn',
'tailwindcss/no-arbitrary-value': 'error',
},
settings: {
'import/core-modules': ['electron'],
'import/resolver': {
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
},
'import/ignore': [/\.(?:css|scss|sass)$/i],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
plugins: ['prettier', '@typescript-eslint', 'unused-imports', 'react-hooks'],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/no-unnecessary-condition': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
},
},
{
files: ['**/*.stories.tsx'],
rules: {
'react-hooks/rules-of-hooks': 'off',
},
},
],
ignorePatterns: ['next-env.d.ts', 'node_modules/', 'out/', '.next/'],
};