-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
64 lines (64 loc) · 2.13 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
es2021: true,
node: true,
jest: true,
},
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'],
rules: {
indent: ['off'], // To let prettier do its job
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'linebreak-style': ['error', 'unix'],
'no-console': 'warn',
'no-extra-semi': 'error',
'no-return-await': 'error',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'prettier/prettier': 'error',
'react/jsx-indent': ['error', 2, { checkAttributes: false, indentLogicalExpressions: false }],
'react/jsx-no-bind': ['warn'],
},
settings: {
react: {
version: 'detect',
},
},
ignorePatterns: ['dist/**/*'],
overrides: [
{
files: [
// Your TypeScript files extension
'*.ts',
'*.tsx',
],
extends: [
// You should extend TypeScript plugins here, instead of extending them outside the `overrides`.
// If you don't want to extend any rules, you don't need an `extends` attribute.
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parserOptions: {
project: ['./tsconfig.json'],
},
rules: {
'no-shadow': 'off', // Must set to false according to @typescript-eslint/no-shadow
'@typescript-eslint/adjacent-overload-signatures': ['warn'],
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/explicit-module-boundary-types': ['error'],
'@typescript-eslint/no-invalid-void-type': ['warn'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_.*_$', varsIgnorePattern: '^_.*_$' }],
},
},
],
};