|
| 1 | +import js from '@eslint/js'; |
| 2 | +import tseslint from '@typescript-eslint/eslint-plugin'; |
| 3 | +import tsParser from '@typescript-eslint/parser'; |
| 4 | +import prettier from 'eslint-plugin-prettier'; // ✅ Explicitly import the plugin |
| 5 | +import prettierConfig from 'eslint-config-prettier'; |
| 6 | + |
| 7 | +export default [ |
| 8 | + js.configs.recommended, |
| 9 | + { |
| 10 | + files: ['src/**/*.ts', 'test/**/*.ts'], |
| 11 | + languageOptions: { |
| 12 | + parser: tsParser, |
| 13 | + parserOptions: { |
| 14 | + project: './tsconfig.json', |
| 15 | + tsconfigRootDir: import.meta.dirname, |
| 16 | + sourceType: 'module', |
| 17 | + }, |
| 18 | + }, |
| 19 | + plugins: { |
| 20 | + '@typescript-eslint': tseslint, |
| 21 | + prettier, // ✅ Register Prettier plugin |
| 22 | + }, |
| 23 | + rules: { |
| 24 | + ...tseslint.configs.recommended.rules, |
| 25 | + ...prettierConfig.rules, // ✅ Apply Prettier rules |
| 26 | + 'prettier/prettier': 'error', // ✅ Ensure Prettier rules are enforced |
| 27 | + '@typescript-eslint/interface-name-prefix': 'off', |
| 28 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 29 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 30 | + '@typescript-eslint/no-explicit-any': 'off', |
| 31 | + }, |
| 32 | + ignores: ['**/*.config.js', '**/node_modules/**'], |
| 33 | + }, |
| 34 | +]; |
0 commit comments