forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
67 lines (67 loc) · 2.65 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
module.exports = {
extends: ['@deriv/eslint-config-deriv'],
rules: {
'global-require': 'off',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'react/prop-types': 'off',
},
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
excludedFiles: '**/integration-tests/**/*.[jt]s?(x)',
extends: ['plugin:testing-library/react'],
},
{
files: ['*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:react/jsx-runtime', // Enables the new JSX transform runtime
],
parserOptions: {
ecmaversion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
babelOptions: {
presets: ['@babel/preset-react', '@babel/preset-typescript'],
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
},
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {
// use an array
project: 'packages/**/tsconfig.json',
},
node: {
extensions: ['.ts', '.tsx'],
moduleDirectory: ['src', 'node_modules'],
},
},
},
},
],
};