forked from nverno/cash-clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
83 lines (74 loc) · 2.11 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
83
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
/**
* Disable typescript-eslint rules with type information.
*
* @see https://typescript-eslint.io/docs/linting/type-linting/
*/
const requiresTypeRulesOff = Object.fromEntries(
Object.entries(typescriptEslint.rules)
.filter(([_name, rule]) => rule.meta.docs.requiresTypeChecking)
.map(([name]) => [`@typescript-eslint/${name}`, 'off']),
);
/** @type {import('./types').ESLintConfig} */
module.exports = {
root: true,
extends: [
'standard',
'standard-react',
'plugin:@typescript-eslint/recommended',
'standard-with-typescript',
'prettier',
],
env: {
browser: true,
es2021: true,
jest: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'no-unsafe-finally': 'off',
'no-use-before-define': 'off',
'prefer-promise-reject-errors': 'off',
'react/jsx-handler-names': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
// '@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
rules: {
...requiresTypeRulesOff,
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'import/export': 'off',
},
},
],
};