|
| 1 | +// @ts-check |
| 2 | +import eslintPluginUnicorn from 'eslint-plugin-unicorn' |
| 3 | +import eslint from '@eslint/js' |
| 4 | +import tseslint from 'typescript-eslint' |
| 5 | +import globals from 'globals' |
| 6 | +import importPlugin from 'eslint-plugin-import' |
| 7 | + |
| 8 | +export default tseslint.config( |
| 9 | + eslint.configs.recommended, |
| 10 | + ...tseslint.configs.recommended, |
| 11 | + importPlugin.flatConfigs.errors, |
| 12 | + importPlugin.flatConfigs.warnings, |
| 13 | + { |
| 14 | + plugins: { |
| 15 | + unicorn: eslintPluginUnicorn, |
| 16 | + }, |
| 17 | + languageOptions: { |
| 18 | + globals: { |
| 19 | + ...globals.node, |
| 20 | + ...globals.es5, |
| 21 | + ...globals.jest, |
| 22 | + }, |
| 23 | + ecmaVersion: 2019, |
| 24 | + sourceType: 'module', |
| 25 | + }, |
| 26 | + rules: { |
| 27 | + semi: ['error', 'never'], |
| 28 | + quotes: ['error', 'single'], |
| 29 | + indent: [2, 4], |
| 30 | + |
| 31 | + 'no-constant-condition': 0, |
| 32 | + // see https://stackoverflow.com/questions/55280555/typescript-eslint-eslint-plugin-error-route-is-defined-but-never-used-no-un |
| 33 | + 'no-unused-vars': 'off', |
| 34 | + '@typescript-eslint/no-unused-vars': 'error', |
| 35 | + |
| 36 | + 'import/no-unresolved': 0, |
| 37 | + 'import/named': 2, |
| 38 | + 'import/namespace': 2, |
| 39 | + 'import/default': 2, |
| 40 | + 'import/export': 2, |
| 41 | + |
| 42 | + 'unicorn/prefer-node-protocol': 'error', |
| 43 | + }, |
| 44 | + ignores: ['./build/*'], |
| 45 | + }, |
| 46 | + { |
| 47 | + files: ['*.ts'], |
| 48 | + rules: { |
| 49 | + 'no-undef': 'off', |
| 50 | + }, |
| 51 | + }, |
| 52 | +) |
0 commit comments