|
| 1 | +import typescriptEslint from '@typescript-eslint/eslint-plugin'; |
| 2 | +import prettier from 'eslint-plugin-prettier'; |
| 3 | +import globals from 'globals'; |
| 4 | +import tsParser from '@typescript-eslint/parser'; |
| 5 | +import path from 'node:path'; |
| 6 | +import { fileURLToPath } from 'node:url'; |
| 7 | +import js from '@eslint/js'; |
| 8 | +import { FlatCompat } from '@eslint/eslintrc'; |
| 9 | + |
| 10 | +const __filename = fileURLToPath(import.meta.url); |
| 11 | +const __dirname = path.dirname(__filename); |
| 12 | +const compat = new FlatCompat({ |
| 13 | + baseDirectory: __dirname, |
| 14 | + recommendedConfig: js.configs.recommended, |
| 15 | + allConfig: js.configs.all, |
| 16 | +}); |
| 17 | + |
| 18 | +export default [ |
| 19 | + { |
| 20 | + ignores: ['**/dist'], |
| 21 | + }, |
| 22 | + ...compat.extends( |
| 23 | + 'eslint:recommended', |
| 24 | + 'plugin:@typescript-eslint/recommended', |
| 25 | + 'plugin:prettier/recommended', |
| 26 | + ), |
| 27 | + { |
| 28 | + plugins: { |
| 29 | + '@typescript-eslint': typescriptEslint, |
| 30 | + prettier, |
| 31 | + }, |
| 32 | + |
| 33 | + languageOptions: { |
| 34 | + globals: { |
| 35 | + ...globals.node, |
| 36 | + }, |
| 37 | + |
| 38 | + parser: tsParser, |
| 39 | + ecmaVersion: 'latest', |
| 40 | + sourceType: 'module', |
| 41 | + }, |
| 42 | + |
| 43 | + rules: { |
| 44 | + 'prettier/prettier': 'error', |
| 45 | + '@typescript-eslint/no-empty-object-type': 'error', |
| 46 | + '@typescript-eslint/no-unsafe-function-type': 'error', |
| 47 | + '@typescript-eslint/no-wrapper-object-types': 'error', |
| 48 | + }, |
| 49 | + }, |
| 50 | +]; |
0 commit comments