|
| 1 | +const path = require('path'); |
| 2 | +const headerDef = path.resolve(__dirname, './packages/config/header.js'); |
| 3 | + |
| 4 | +module.exports = { |
| 5 | + env: { |
| 6 | + browser: true, |
| 7 | + es2020: true |
| 8 | + }, |
| 9 | + extends: 'standard', |
| 10 | + globals: { |
| 11 | + }, |
| 12 | + parser: '@typescript-eslint/parser', |
| 13 | + parserOptions: { |
| 14 | + ecmaVersion: '2020', |
| 15 | + sourceType: 'module', |
| 16 | + project: './tsconfig.json' |
| 17 | + }, |
| 18 | + plugins: [ |
| 19 | + '@typescript-eslint', |
| 20 | + 'import', |
| 21 | + 'unused-imports', |
| 22 | + 'header' |
| 23 | + ], |
| 24 | + rules: { |
| 25 | + indent: ['error', 4, { |
| 26 | + SwitchCase: 1 |
| 27 | + }], |
| 28 | + semi: ['error', 'always'], |
| 29 | + 'no-extra-semi': 'off', |
| 30 | + '@typescript-eslint/no-extra-semi': ['error'], |
| 31 | + 'no-dupe-class-members': 'off', |
| 32 | + '@typescript-eslint/no-dupe-class-members': ['error'], |
| 33 | + 'no-redeclare': 'off', |
| 34 | + '@typescript-eslint/no-redeclare': ['error'], |
| 35 | + 'no-useless-constructor': 'warn', |
| 36 | + 'no-void': 'warn', |
| 37 | + // Following recommendation: |
| 38 | + // https://typescript-eslint.io/docs/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors |
| 39 | + 'no-undef': 'off', |
| 40 | + 'no-unused-vars': 'off', |
| 41 | + '@typescript-eslint/no-unused-vars': ['warn', { |
| 42 | + argsIgnorePattern: '^_' |
| 43 | + }], |
| 44 | + 'header/header': [2, headerDef], |
| 45 | + 'dot-notation': 'off', |
| 46 | + '@typescript-eslint/dot-notation': ['error'] |
| 47 | + }, |
| 48 | + ignorePatterns: ['.eslintrc.js', './packages/examples/browser-lsp/src/serverWorker.ts'] |
| 49 | +}; |
0 commit comments