|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es6: true, |
| 5 | + commonjs: true, |
| 6 | + node: true, |
| 7 | + 'jest/globals': true |
| 8 | + }, |
| 9 | + globals: { |
| 10 | + BigInt: 'readonly', |
| 11 | + HTMLCollectionOf: 'readonly', |
| 12 | + NodeJS: 'readonly', |
| 13 | + RequestInit: 'readonly', |
| 14 | + RequestInfo: 'readonly', |
| 15 | + ScrollLogicalPosition: 'readonly' |
| 16 | + }, |
| 17 | + root: true, |
| 18 | + extends: [ |
| 19 | + 'eslint:recommended', |
| 20 | + 'plugin:@typescript-eslint/eslint-recommended', |
| 21 | + 'plugin:@typescript-eslint/recommended', |
| 22 | + 'prettier' |
| 23 | + ], |
| 24 | + parser: '@typescript-eslint/parser', |
| 25 | + plugins: ['@typescript-eslint'], |
| 26 | + overrides: [ |
| 27 | + { |
| 28 | + files: ['test/**/*.spec.ts'], |
| 29 | + plugins: ['jest'], |
| 30 | + extends: ['plugin:jest/recommended'], |
| 31 | + rules: { |
| 32 | + 'jest/no-conditional-expect': 'warn', |
| 33 | + 'jest/valid-title': 'warn', |
| 34 | + 'jest/no-standalone-expect': [ |
| 35 | + 'error', |
| 36 | + { |
| 37 | + additionalTestBlockFunctions: ['it'] |
| 38 | + } |
| 39 | + ] |
| 40 | + } |
| 41 | + } |
| 42 | + ], |
| 43 | + rules: { |
| 44 | + '@typescript-eslint/naming-convention': [ |
| 45 | + 'error', |
| 46 | + { |
| 47 | + selector: 'interface', |
| 48 | + format: ['PascalCase'], |
| 49 | + custom: { |
| 50 | + regex: '^I[A-Z]', |
| 51 | + match: true |
| 52 | + } |
| 53 | + } |
| 54 | + ], |
| 55 | + '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }], |
| 56 | + '@typescript-eslint/no-use-before-define': 'off', |
| 57 | + '@typescript-eslint/no-explicit-any': 'off', |
| 58 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 59 | + '@typescript-eslint/no-namespace': 'off', |
| 60 | + '@typescript-eslint/interface-name-prefix': 'off', |
| 61 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 62 | + '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }], |
| 63 | + '@typescript-eslint/ban-types': 'warn', |
| 64 | + '@typescript-eslint/no-non-null-asserted-optional-chain': 'warn', |
| 65 | + '@typescript-eslint/no-var-requires': 'off', |
| 66 | + '@typescript-eslint/no-empty-interface': 'off', |
| 67 | + '@typescript-eslint/triple-slash-reference': 'warn', |
| 68 | + '@typescript-eslint/no-inferrable-types': 'off', |
| 69 | + camelcase: [ |
| 70 | + 'error', |
| 71 | + { |
| 72 | + allow: [ |
| 73 | + 'cell_type', |
| 74 | + 'display_name', |
| 75 | + 'execution_count', |
| 76 | + 'orig_nbformat', |
| 77 | + 'outputs_hidden', |
| 78 | + 'nbformat_minor' |
| 79 | + ] |
| 80 | + } |
| 81 | + ], |
| 82 | + 'id-match': ['error', '^[a-zA-Z_]+[a-zA-Z0-9_]*$'], // https://certitude.consulting/blog/en/invisible-backdoor/ |
| 83 | + 'no-inner-declarations': 'off', |
| 84 | + 'no-prototype-builtins': 'off', |
| 85 | + 'no-control-regex': 'warn', |
| 86 | + 'no-undef': 'warn', |
| 87 | + 'no-case-declarations': 'warn', |
| 88 | + 'no-useless-escape': 'off', |
| 89 | + 'prefer-const': 'off', |
| 90 | + 'sort-imports': [ |
| 91 | + 'error', |
| 92 | + { |
| 93 | + ignoreCase: true, |
| 94 | + ignoreDeclarationSort: true, |
| 95 | + ignoreMemberSort: false, |
| 96 | + memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], |
| 97 | + allowSeparatedGroups: false |
| 98 | + } |
| 99 | + ] |
| 100 | + } |
| 101 | +}; |
0 commit comments