|
| 1 | +parser: '@typescript-eslint/parser' |
| 2 | + |
| 3 | +parserOptions: |
| 4 | + ecmaVersion: 2020 |
| 5 | + sourceType: module |
| 6 | + |
| 7 | +env: |
| 8 | + browser: true |
| 9 | + es6: true |
| 10 | + node: true |
| 11 | + jest: true |
| 12 | + |
| 13 | +globals: |
| 14 | + # false means readonly |
| 15 | + globalThis: false |
| 16 | + |
| 17 | +plugins: |
| 18 | + - import |
| 19 | + - sonarjs |
| 20 | + |
| 21 | +extends: |
| 22 | + - eslint:recommended |
| 23 | + - plugin:sonarjs/recommended |
| 24 | + - plugin:prettier/recommended |
| 25 | + |
| 26 | +settings: |
| 27 | + react: |
| 28 | + pragma: React |
| 29 | + version: 16.12.0 |
| 30 | + |
| 31 | +rules: |
| 32 | + # 0 = off, 1 = warn, 2 = error |
| 33 | + 'no-undef': 2 |
| 34 | + 'no-console': [2, { allow: ['error', 'warn', 'info', 'assert'] }] |
| 35 | + 'comma-dangle': ['error', 'only-multiline'] |
| 36 | + 'no-unused-vars': 0 |
| 37 | + 'no-var': 2 |
| 38 | + 'one-var-declaration-per-line': 2 |
| 39 | + 'prefer-const': 2 |
| 40 | + 'no-const-assign': 2 |
| 41 | + 'no-duplicate-imports': 2 |
| 42 | + 'no-use-before-define': [2, { 'functions': false, 'classes': false }] |
| 43 | + 'eqeqeq': [2, 'always', { 'null': 'ignore' }] |
| 44 | + 'no-case-declarations': 0 |
| 45 | + 'no-restricted-syntax': |
| 46 | + [ |
| 47 | + 2, |
| 48 | + { |
| 49 | + 'selector': 'BinaryExpression[operator=/(==|===|!=|!==)/][left.raw=true], BinaryExpression[operator=/(==|===|!=|!==)/][right.raw=true]', |
| 50 | + 'message': Don't compare for equality against boolean literals, |
| 51 | + }, |
| 52 | + ] |
| 53 | + |
| 54 | + 'import/first': 2 |
| 55 | + 'import/newline-after-import': 2 |
| 56 | + |
| 57 | + 'sonarjs/cognitive-complexity': 0 |
| 58 | + 'sonarjs/no-duplicate-string': 0 |
| 59 | + 'sonarjs/no-big-function': 0 |
| 60 | + 'sonarjs/no-identical-functions': 0 |
| 61 | + 'sonarjs/no-small-switch': 0 |
| 62 | + |
| 63 | +overrides: |
| 64 | + - files: |
| 65 | + - packages/**/*.ts |
| 66 | + rules: |
| 67 | + 'no-unused-vars': [2, { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }] |
| 68 | + |
| 69 | + - files: |
| 70 | + - packages/**/*.ts |
| 71 | + plugins: |
| 72 | + - '@typescript-eslint' |
| 73 | + parserOptions: |
| 74 | + project: ./tsconfig.json |
| 75 | + rules: |
| 76 | + # constructor(private readonly foo: string) {} style declaration |
| 77 | + 'no-useless-constructor': 0 |
| 78 | + '@typescript-eslint/no-useless-constructor': 2 |
| 79 | + |
| 80 | + # conflict function override |
| 81 | + 'no-dupe-class-members': 0 |
| 82 | + '@typescript-eslint/no-dupe-class-members': 2 |
| 83 | + |
| 84 | + # constructor(private readonly foo: string) {} style declaration |
| 85 | + 'no-empty-function': 0 |
| 86 | + |
| 87 | + '@typescript-eslint/no-empty-function': 2 |
| 88 | + |
| 89 | + '@typescript-eslint/no-unused-vars': |
| 90 | + [2, { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }] |
| 91 | + '@typescript-eslint/member-ordering': |
| 92 | + [ |
| 93 | + 2, |
| 94 | + { |
| 95 | + default: |
| 96 | + [ |
| 97 | + 'public-static-field', |
| 98 | + 'protected-static-field', |
| 99 | + 'private-static-field', |
| 100 | + 'public-static-method', |
| 101 | + 'protected-static-method', |
| 102 | + 'private-static-method', |
| 103 | + 'public-instance-field', |
| 104 | + 'protected-instance-field', |
| 105 | + 'private-instance-field', |
| 106 | + 'public-constructor', |
| 107 | + 'protected-constructor', |
| 108 | + 'private-constructor', |
| 109 | + 'public-instance-method', |
| 110 | + 'protected-instance-method', |
| 111 | + 'private-instance-method', |
| 112 | + ], |
| 113 | + }, |
| 114 | + ] |
0 commit comments