-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
93 lines (93 loc) · 3.1 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
86
87
88
89
90
91
92
93
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: ['simple-import-sort'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'react/prop-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-duplicate-imports': 'error',
'simple-import-sort/imports': 'error',
'@typescript-eslint/no-array-constructor': 'off',
'@typescript-eslint/no-explicit-any': [
'error',
{
ignoreRestArgs: true,
},
],
'no-undef': 'error',
// will enable rule but allow already used types
// consider updating these in the future
'@typescript-eslint/ban-types': [
'error',
{
types: {
'{}': false,
Function: false,
object: false,
},
},
],
'no-return-await': 'error',
'default-param-last': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
ignorePatterns: ['lint-staged.config.js', 'newrelic.js'],
overrides: [
{
files: ['apps/atka-web/**/*.tsx', 'apps/atka-web/**/*.ts'],
rules: {
'react/self-closing-comp': [
'error',
{
component: true,
html: true,
},
],
'no-console': [
'error',
{
allow: ['error', 'debug', 'info'],
},
], // do not allow console logs on client
'@typescript-eslint/no-shadow': 'error',
},
globals: {
fetch: true,
localStorage: true,
},
},
],
globals: {
// browser
document: true,
// react
JSX: true,
},
env: {
node: true,
},
};