|
| 1 | +import { defineConfig } from 'oxlint'; |
| 2 | +import typegpu from 'eslint-plugin-typegpu'; |
| 3 | + |
| 4 | +const typegpuPreset = typegpu.configs?.recommended; |
| 5 | +const typegpuRules = typegpuPreset && 'rules' in typegpuPreset |
| 6 | + ? typegpuPreset.rules |
| 7 | + : {}; |
| 8 | + |
| 9 | +export default defineConfig({ |
| 10 | + plugins: ['eslint', 'typescript', 'import', 'unicorn', 'oxc'], |
| 11 | + jsPlugins: ['eslint-plugin-typegpu'], |
| 12 | + categories: { |
| 13 | + correctness: 'warn', |
| 14 | + suspicious: 'warn', |
| 15 | + }, |
| 16 | + rules: { |
| 17 | + ...typegpuRules, |
| 18 | + 'typescript/no-unsafe-enum-comparison': 'off', |
| 19 | + 'typescript/restrict-template-expressions': 'off', |
| 20 | + 'typescript/no-unsafe-type-assertion': 'off', |
| 21 | + 'typescript/no-explicit-any': 'error', |
| 22 | + 'typescript/no-non-null-assertion': 'error', |
| 23 | + 'eslint/no-shadow': 'off', |
| 24 | + 'eslint-plugin-unicorn/prefer-add-event-listener': 'off', |
| 25 | + 'eslint-plugin-import/no-named-as-default': 'off', |
| 26 | + 'eslint-plugin-import/no-named-as-default-member': 'off', |
| 27 | + 'eslint-plugin-import/extensions': [ |
| 28 | + 'error', |
| 29 | + 'always', |
| 30 | + { ignorePackages: true }, |
| 31 | + ], |
| 32 | + }, |
| 33 | + ignorePatterns: ['**/*.astro', '**/*.mjs'], |
| 34 | + overrides: [ |
| 35 | + { |
| 36 | + files: ['**/*.test.ts', '**/tests/**'], |
| 37 | + rules: { |
| 38 | + 'typescript/unbound-method': 'off', |
| 39 | + 'typescript/no-non-null-assertion': 'off', |
| 40 | + 'eslint/no-unused-vars': 'off', |
| 41 | + 'eslint/no-unused-expressions': 'off', |
| 42 | + 'eslint-plugin-unicorn/consistent-function-scoping': 'off', |
| 43 | + 'eslint/no-unsafe-optional-chaining': 'off', |
| 44 | + 'eslint/no-constant-condition': 'off', |
| 45 | + }, |
| 46 | + }, |
| 47 | + ], |
| 48 | + env: { |
| 49 | + builtin: true, |
| 50 | + }, |
| 51 | +}); |
0 commit comments