|
1 | | -const {getESLintConfig, deepMerge} = require('ocular-dev-tools'); |
| 1 | +const {getESLintConfig} = require('ocular-dev-tools/configuration'); |
2 | 2 |
|
3 | | -const defaultConfig = getESLintConfig({react: '16.8.2'}); |
| 3 | +module.exports = getESLintConfig({ |
| 4 | + react: '16.8.2', |
| 5 | + overrides: { |
| 6 | + parserOptions: { |
| 7 | + project: ['./tsconfig.json'], |
| 8 | + ecmaVersion: 2020 |
| 9 | + }, |
4 | 10 |
|
5 | | -// Make any changes to default config here |
6 | | -const config = deepMerge(defaultConfig, { |
7 | | - parserOptions: { |
8 | | - project: ['./tsconfig.json'], |
9 | | - ecmaVersion: 2020 |
10 | | - }, |
| 11 | + rules: { |
| 12 | + 'max-depth': ['warn', 4], |
| 13 | + complexity: ['warn'], |
| 14 | + 'max-statements': ['warn'], |
| 15 | + 'callback-return': 0 |
| 16 | + }, |
11 | 17 |
|
12 | | - env: { |
13 | | - es2020: true |
14 | | - // browser: true, |
15 | | - // node: true |
16 | | - }, |
17 | | - |
18 | | - rules: { |
19 | | - camelcase: 0, |
20 | | - indent: 0, |
21 | | - 'import/no-unresolved': 0, |
22 | | - 'import/no-extraneous-dependencies': 0, // ['warn'], |
23 | | - 'no-console': 1, |
24 | | - 'no-continue': ['warn'], |
25 | | - 'callback-return': 0, |
26 | | - 'max-depth': ['warn', 4], |
27 | | - complexity: ['warn'], |
28 | | - 'max-statements': ['warn'], |
29 | | - 'default-case': ['warn'], |
30 | | - 'no-eq-null': ['warn'], |
31 | | - eqeqeq: ['warn'], |
32 | | - radix: 0 |
33 | | - // 'accessor-pairs': ['error', {getWithoutSet: false, setWithoutGet: false}] |
34 | | - }, |
35 | | - |
36 | | - overrides: [ |
37 | | - { |
38 | | - files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'], |
39 | | - rules: { |
40 | | - indent: 0, |
41 | | - quotes: ['error', 'single', {avoidEscape: true}], |
42 | | - // For parquet module |
43 | | - '@typescript-eslint/no-non-null-assertion': 0, |
44 | | - '@typescript-eslint/no-non-null-asserted-optional-chain': 0, |
45 | | - // Gradually enable |
46 | | - '@typescript-eslint/ban-ts-comment': 0, |
47 | | - '@typescript-eslint/ban-types': 0, |
48 | | - '@typescript-eslint/no-unsafe-member-access': 0, |
49 | | - '@typescript-eslint/no-unsafe-assignment': 0, |
50 | | - '@typescript-eslint/no-var-requires': 0, |
51 | | - '@typescript-eslint/no-unused-vars': [ |
52 | | - 'warn', |
53 | | - {vars: 'all', args: 'none', ignoreRestSiblings: false} |
54 | | - ], |
55 | | - // We still have some issues with import resolution |
56 | | - 'import/named': 0, |
57 | | - // Warn instead of error |
58 | | - // 'max-params': ['warn'], |
59 | | - // 'no-undef': ['warn'], |
60 | | - // camelcase: ['warn'], |
61 | | - // '@typescript-eslint/no-floating-promises': ['warn'], |
62 | | - // '@typescript-eslint/await-thenable': ['warn'], |
63 | | - // '@typescript-eslint/no-misused-promises': ['warn'], |
64 | | - '@typescript-eslint/no-empty-function': ['warn', {allow: ['arrowFunctions']}], |
65 | | - // We use function hoisting |
66 | | - '@typescript-eslint/no-use-before-define': 0, |
67 | | - // We always want explicit typing, e.g `field: string = ''` |
68 | | - '@typescript-eslint/no-inferrable-types': 0, |
69 | | - '@typescript-eslint/restrict-template-expressions': 0, |
70 | | - '@typescript-eslint/explicit-module-boundary-types': 0, |
71 | | - '@typescript-eslint/require-await': 0, |
72 | | - '@typescript-eslint/no-unsafe-return': 0, |
73 | | - '@typescript-eslint/no-unsafe-call': 0, |
74 | | - '@typescript-eslint/no-empty-interface': 0, |
75 | | - '@typescript-eslint/restrict-plus-operands': 0 |
| 18 | + overrides: [ |
| 19 | + { |
| 20 | + files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'], |
| 21 | + rules: { |
| 22 | + // Gradually enable |
| 23 | + '@typescript-eslint/ban-ts-comment': 0, |
| 24 | + '@typescript-eslint/ban-types': 0, |
| 25 | + '@typescript-eslint/no-unsafe-member-access': 0, |
| 26 | + '@typescript-eslint/no-unsafe-assignment': 0, |
| 27 | + 'import/named': 0, |
| 28 | + '@typescript-eslint/no-empty-function': ['warn', {allow: ['arrowFunctions']}], |
| 29 | + '@typescript-eslint/restrict-template-expressions': 0, |
| 30 | + '@typescript-eslint/explicit-module-boundary-types': 0, |
| 31 | + '@typescript-eslint/no-unsafe-return': 0, |
| 32 | + '@typescript-eslint/no-unsafe-call': 0, |
| 33 | + '@typescript-eslint/restrict-plus-operands': 0 |
| 34 | + } |
76 | 35 | } |
77 | | - } |
78 | | - ], |
79 | | - |
80 | | - settings: { |
81 | | - // Ensure eslint finds typescript files |
82 | | - 'import/resolver': { |
83 | | - node: { |
84 | | - extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx'] |
85 | | - } |
86 | | - } |
| 36 | + ] |
87 | 37 | } |
88 | 38 | }); |
89 | | - |
90 | | -module.exports = config; |
0 commit comments