This repository has been archived by the owner on Jul 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
58 lines (56 loc) · 2.2 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
module.exports = {
plugins: ['@typescript-eslint', 'formatjs'],
extends: ['next/core-web-vitals', 'plugin:react/recommended', 'plugin:import/recommended'],
parser: '@typescript-eslint/parser',
rules: {
// https://eslint.org/docs/rules/
// https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
// https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'formatjs/no-offset': 'error',
'formatjs/no-emoji': 'error',
'formatjs/enforce-default-message': ['error', 'literal'],
'import/order': 'warn',
'import/newline-after-import': 'warn',
'import/first': 'warn',
'import/no-mutable-exports': 'warn',
'import/no-cycle': 'warn',
'import/no-unresolved': 'error',
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'warn',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
// https://typescript-eslint.io/docs/linting/type-linting
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
rules: {
// https://typescript-eslint.io/rules/
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/prefer-regexp-exec': 'warn',
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
},
},
],
};