-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
67 lines (66 loc) · 2.42 KB
/
eslint.config.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
import typescript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended';
export default [
// 'eslint:recommended',
{
ignores: ['build/*', '.yarn/'],
},
{
files: ['**/*.{js,ts,tsx}'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest', // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
plugins: {
'@typescript-eslint': typescript, // Uses the recommended rules from the @typescript-eslint/eslint-plugin
prettier, // Disables ESLint rules that would conflict with prettier
prettierPluginRecommended, // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
},
rules: {
'@typescript-eslint/ban-types': [
'error',
{
types: {
'{}': false,
Object: false,
object: false,
Function: false,
},
extendDefaults: true,
},
],
'max-len': [
'warn',
{
code: 80,
comments: 120,
ignoreComments: true,
ignoreStrings: true, // ignores lines that contain a double-quoted or single-quoted string
ignoreTemplateLiterals: true, // ignores lines that contain a template literal
ignoreRegExpLiterals: true, // ignores lines that contain a RegExp literal
tabWidth: 2,
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/adjacent-overload-signatures': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
quotes: [1, 'single', 'avoid-escape'], // TODO: check the options
'spaced-comment': ['error', 'always'],
},
},
];