| 1 | module.exports = { |
| 2 | env: { |
| 3 | es2021: true, |
| 4 | node: true, |
| 5 | mocha: true |
| 6 | }, |
| 7 | parser: '@typescript-eslint/parser', |
| 8 | parserOptions: { |
| 9 | ecmaVersion: 2020, |
| 10 | sourceType: 'module' |
| 11 | }, |
| 12 | plugins: [ |
| 13 | '@typescript-eslint', |
| 14 | 'promise', |
| 15 | 'prettierx', |
| 16 | 'jsdoc', |
| 17 | 'spellcheck' |
| 18 | ], |
| 19 | extends: [ |
| 20 | 'standard', |
| 21 | 'eslint:recommended', |
| 22 | 'plugin:@typescript-eslint/recommended', |
| 23 | 'plugin:import/errors', |
| 24 | 'plugin:import/warnings', |
| 25 | 'plugin:import/typescript', |
| 26 | 'plugin:promise/recommended', |
| 27 | 'plugin:prettierx/standardx', |
| 28 | 'plugin:prettierx/@typescript-eslint' |
| 29 | ], |
| 30 | rules: { |
| 31 | 'no-void': 'off', |
| 32 | |
| 33 | // We have some intentionally empty functions |
| 34 | '@typescript-eslint/no-empty-function': 'off', |
| 35 | |
| 36 | '@typescript-eslint/no-inferrable-types': [ |
| 37 | 'error', |
| 38 | { ignoreProperties: true } |
| 39 | ], |
| 40 | |
| 41 | 'sort-imports': [ |
| 42 | 'warn', |
| 43 | { |
| 44 | ignoreMemberSort: true, |
| 45 | ignoreDeclarationSort: true |
| 46 | } |
| 47 | ], |
| 48 | |
| 49 | 'spellcheck/spell-checker': [ |
| 50 | 'warn', |
| 51 | { |
| 52 | skipWords: [ |
| 53 | 'poolifier', |
| 54 | 'pioardi', |
| 55 | 'christopher', |
| 56 | 'ecma', |
| 57 | 'jsdoc', |
| 58 | 'readonly', |
| 59 | 'serializable', |
| 60 | 'unregister', |
| 61 | 'workerpool' |
| 62 | ], |
| 63 | skipIfMatch: ['^@.*', '^plugin:.*'] |
| 64 | } |
| 65 | ] |
| 66 | }, |
| 67 | overrides: [ |
| 68 | { |
| 69 | files: ['src/**/*.ts'], |
| 70 | extends: 'plugin:jsdoc/recommended', |
| 71 | rules: { |
| 72 | 'jsdoc/no-types': 'error', |
| 73 | 'jsdoc/require-param-type': 'off', |
| 74 | 'jsdoc/require-returns-type': 'off' |
| 75 | } |
| 76 | }, |
| 77 | { |
| 78 | files: ['*.js'], |
| 79 | extends: 'plugin:node/recommended', |
| 80 | rules: { |
| 81 | '@typescript-eslint/no-unused-vars': 'off', |
| 82 | '@typescript-eslint/no-var-requires': 'off' |
| 83 | } |
| 84 | }, |
| 85 | { |
| 86 | files: ['examples/typescript/**/*.ts'], |
| 87 | rules: { |
| 88 | 'import/no-unresolved': 'off' |
| 89 | } |
| 90 | }, |
| 91 | { |
| 92 | files: ['examples/**/*.js'], |
| 93 | rules: { |
| 94 | 'node/no-missing-require': 'off' |
| 95 | } |
| 96 | } |
| 97 | ] |
| 98 | } |