|
| 1 | +import path from 'node:path'; |
| 2 | +import { fileURLToPath } from 'node:url'; |
| 3 | +import { FlatCompat } from '@eslint/eslintrc'; |
| 4 | +import js from '@eslint/js'; |
| 5 | + |
| 6 | +const __filename = fileURLToPath(import.meta.url); |
| 7 | +const __dirname = path.dirname(__filename); |
| 8 | +const compat = new FlatCompat({ |
| 9 | + baseDirectory: __dirname, |
| 10 | + recommendedConfig: js.configs.recommended, |
| 11 | + allConfig: js.configs.all, |
| 12 | +}); |
| 13 | + |
| 14 | +export default [ |
| 15 | + { |
| 16 | + ignores: [ |
| 17 | + '**/node_modules', |
| 18 | + '**/dist', |
| 19 | + '**/build', |
| 20 | + '**/generated', |
| 21 | + 'packages/cli/tests/cli/init', |
| 22 | + 'packages/cli/tests/cli/validation', |
| 23 | + 'packages/ts/test/', |
| 24 | + '**/examples', |
| 25 | + '**/vitest.config.ts', |
| 26 | + ], |
| 27 | + }, |
| 28 | + ...compat.extends('@theguild'), |
| 29 | + { |
| 30 | + rules: { |
| 31 | + 'import/extensions': 'off', |
| 32 | + 'unicorn/no-array-push-push': 'off', |
| 33 | + 'import/no-default-export': 'off', |
| 34 | + '@typescript-eslint/no-explicit-any': 'off', |
| 35 | + '@typescript-eslint/ban-types': 'off', |
| 36 | + eqeqeq: 'off', |
| 37 | + '@typescript-eslint/no-unused-vars': 'off', |
| 38 | + }, |
| 39 | + }, |
| 40 | + { |
| 41 | + files: ['packages/ts/**'], |
| 42 | + |
| 43 | + rules: { |
| 44 | + '@typescript-eslint/no-namespace': 'off', |
| 45 | + 'sonarjs/no-inverted-boolean-check': 'off', |
| 46 | + 'no-loss-of-precision': 'warn', |
| 47 | + }, |
| 48 | + }, |
| 49 | + { |
| 50 | + files: ['packages/cli/**'], |
| 51 | + |
| 52 | + rules: { |
| 53 | + 'no-restricted-imports': [ |
| 54 | + 'error', |
| 55 | + { |
| 56 | + patterns: [ |
| 57 | + { |
| 58 | + group: ['@whatwg-node/fetch'], |
| 59 | + message: 'Please use `fetch` from `./packages/cli/src/fetch.ts`.', |
| 60 | + }, |
| 61 | + ], |
| 62 | + }, |
| 63 | + ], |
| 64 | + }, |
| 65 | + }, |
| 66 | +]; |
0 commit comments