-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
85 lines (84 loc) · 2.5 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
84
85
/**
* Copyright (c) 2020
*
* ESLint configuration for linting ThoughtSpot Embed UI SDK
* source code.
*
* @summary ESLint config
* @author Ayon Ghosh <[email protected]>
*/
module.exports = {
env: {
browser: true,
es6: true,
},
ignorePatterns: ['*.scss', '*.md'],
extends: [
'airbnb-base',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
settings: {
'import/extensions': ['.js', '.ts'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
node: {
extensions: ['.js', '.ts'],
},
},
},
rules: {
indent: [0, 4, { SwitchCase: 1 }], // Conflict with Prettier
quotes: [2, 'single', { avoidEscape: true }],
'no-tabs': ['error', { allowIndentationTabs: true }],
'jsx-quotes': [2, 'prefer-double'],
'@typescript-eslint/explicit-function-return-type': [0],
'@typescript-eslint/no-explicit-any': [0],
'@typescript-eslint/no-unused-vars': [0],
'import/prefer-default-export': 0,
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
// do not complain when importing js related files without extension,
// Typescript should handle this.
'import/extensions': [0],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/*.spec.{ts,tsx}'],
},
],
'import/no-absolute-path': [0],
// Disable until this is fixed https://github.com/dividab/tsconfig-paths/issues/128
'import/no-unresolved': 0,
'no-plusplus': 0,
'prefer-destructuring': 0,
'no-continue': 0,
'max-classes-per-file': 0,
'class-methods-use-this': 0,
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-param-reassign': [
'error',
{
props: true,
ignorePropertyModificationsFor: ['accu'],
},
],
},
};