This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
66 lines (62 loc) · 1.65 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
module.exports = {
ignorePatterns: ['node_modules/*', '.next/*', '.out/*', '!.prettierrc.js'],
parser: '@typescript-eslint/parser',
settings: {
react: {
version: 'detect',
},
},
env: {
browser: true,
node: true,
es6: true,
},
plugins: ['simple-import-sort', 'unused-imports'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// 'plugin:jsx-a11y/recommended',
'plugin:@next/next/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:tailwindcss/recommended',
'plugin:storybook/recommended',
'prettier',
],
rules: {
// We will use TypeScript's types for component props instead
'react/prop-types': 'off',
// No need to import React when using Next.js
'react/react-in-jsx-scope': 'off',
// typescript can handle this
'@typescript-eslint/no-explicit-any': 'off',
// Why would you want unused vars?
'@typescript-eslint/no-unused-vars': ['error'],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
// custom
'@typescript-eslint/ban-types': 'off',
'no-empty-pattern': 'off',
// for unused-imports
// or "@typescript-eslint/no-unused-vars": "off",
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
overrides: [
{
files: ['*.stories.tsx'],
rules: {
'react-hooks/rules-of-hooks': 'off',
},
},
],
}