|
| 1 | +// @ts-check |
| 2 | +import globals from 'globals'; |
| 3 | +import importPlugin from 'eslint-plugin-import'; |
| 4 | +import eslintTerrestris from '@terrestris/eslint-config-typescript'; |
| 5 | +import eslint from '@eslint/js'; |
| 6 | +import tsEslint from 'typescript-eslint'; |
| 7 | +import stylisticEslint from '@stylistic/eslint-plugin' |
| 8 | + |
| 9 | +export default tsEslint.config({ |
| 10 | + extends: [ |
| 11 | + eslint.configs.recommended, |
| 12 | + ...tsEslint.configs.recommended, |
| 13 | + ...tsEslint.configs.stylistic, |
| 14 | + importPlugin.flatConfigs.recommended |
| 15 | + ], |
| 16 | + files: [ |
| 17 | + 'src/**/*.ts', |
| 18 | + 'spec/**/*.spec.ts' |
| 19 | + ], |
| 20 | + ignores: [ |
| 21 | + '**/*.spec.ts', |
| 22 | + '**/dist/*.js', |
| 23 | + '**/jest/__mocks__/*.ts' |
| 24 | + ], |
| 25 | + languageOptions: { |
| 26 | + ecmaVersion: 2022, |
| 27 | + globals: globals.browser, |
| 28 | + parserOptions: { |
| 29 | + project: true, |
| 30 | + tsconfigRootDir: import.meta.dirname |
| 31 | + }, |
| 32 | + }, |
| 33 | + plugins: { |
| 34 | + '@stylistic': stylisticEslint |
| 35 | + }, |
| 36 | + rules: { |
| 37 | + ...eslintTerrestris.rules, |
| 38 | + '@typescript-eslint/member-ordering': 'off', |
| 39 | + '@typescript-eslint/no-empty-object-type': 'off', |
| 40 | + '@typescript-eslint/no-unused-vars': 'warn', |
| 41 | + '@typescript-eslint/no-this-alias': 'warn', |
| 42 | + '@typescript-eslint/prefer-for-of': 'warn', |
| 43 | + '@typescript-eslint/no-unsafe-function-type': 'warn', |
| 44 | + '@typescript-eslint/no-empty-function': 'warn', |
| 45 | + 'import/no-unresolved': 'off', |
| 46 | + 'import/named': 'off', |
| 47 | + 'import/order': ['warn', { |
| 48 | + groups: [ |
| 49 | + 'builtin', |
| 50 | + 'external', |
| 51 | + 'parent', |
| 52 | + 'sibling', |
| 53 | + 'index', |
| 54 | + 'object' |
| 55 | + ], |
| 56 | + pathGroups: [{ |
| 57 | + pattern: 'react', |
| 58 | + group: 'external', |
| 59 | + position: 'before' |
| 60 | + }, { |
| 61 | + pattern: '@terrestris/**', |
| 62 | + group: 'external', |
| 63 | + position: 'after' |
| 64 | + }], |
| 65 | + pathGroupsExcludedImportTypes: ['react'], |
| 66 | + 'newlines-between': 'always-and-inside-groups', |
| 67 | + alphabetize: { |
| 68 | + order: 'asc', |
| 69 | + caseInsensitive: true |
| 70 | + } |
| 71 | + }] |
| 72 | + } |
| 73 | +}); |
0 commit comments