|
| 1 | +import nx from '@nx/eslint-plugin'; |
| 2 | + |
| 3 | +export default [ |
| 4 | + ...nx.configs['flat/base'], |
| 5 | + ...nx.configs['flat/typescript'], |
| 6 | + ...nx.configs['flat/javascript'], |
| 7 | + { |
| 8 | + files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], |
| 9 | + rules: { |
| 10 | + '@nx/enforce-module-boundaries': [ |
| 11 | + 'error', |
| 12 | + { |
| 13 | + enforceBuildableLibDependency: true, |
| 14 | + allow: [], |
| 15 | + depConstraints: [ |
| 16 | + { |
| 17 | + sourceTag: '*', |
| 18 | + onlyDependOnLibsWithTags: ['*'], |
| 19 | + }, |
| 20 | + ], |
| 21 | + }, |
| 22 | + ], |
| 23 | + }, |
| 24 | + }, |
| 25 | + { |
| 26 | + files: ['**/*.ts', '**/*.tsx'], |
| 27 | + rules: { |
| 28 | + 'no-empty': 'off', |
| 29 | + 'no-useless-escape': 'off', |
| 30 | + 'no-inner-declarations': 'off', |
| 31 | + 'no-prototype-builtins': 'off', |
| 32 | + '@typescript-eslint/no-empty-interface': 'off', |
| 33 | + '@typescript-eslint/no-var-requires': 'off', |
| 34 | + '@typescript-eslint/no-empty-function': 'off', |
| 35 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 36 | + '@typescript-eslint/no-unused-vars': 'off', |
| 37 | + '@typescript-eslint/no-explicit-any': 'off', |
| 38 | + '@typescript-eslint/no-this-alias': 'warn', |
| 39 | + '@typescript-eslint/no-namespace': 'off', |
| 40 | + '@typescript-eslint/no-inferrable-types': 'off', |
| 41 | + '@typescript-eslint/no-empty-object-type': 'off', |
| 42 | + '@typescript-eslint/no-unsafe-function-type': 'off', |
| 43 | + '@typescript-eslint/no-wrapper-object-types': 'off', |
| 44 | + '@typescript-eslint/no-unsafe-declaration-merging': 'off', |
| 45 | + '@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }], |
| 46 | + 'no-extra-semi': 'off', |
| 47 | + }, |
| 48 | + }, |
| 49 | + { |
| 50 | + files: ['**/*.js', '**/*.jsx'], |
| 51 | + rules: { |
| 52 | + 'no-extra-semi': 'off', |
| 53 | + }, |
| 54 | + }, |
| 55 | + { |
| 56 | + files: ['**/references.d.ts'], |
| 57 | + rules: { |
| 58 | + '@typescript-eslint/triple-slash-reference': 'off', |
| 59 | + }, |
| 60 | + }, |
| 61 | + { |
| 62 | + // Not in packages/core: its build and the HMR core bundle ship every *.mjs. |
| 63 | + ignores: ['packages/core/**/global-types.d.ts', 'packages/core/**/node_modules/**/*', 'packages/core/**/__tests__/**/*', 'packages/core/**/platforms/**/*', 'packages/core/**/css/lib/**/*', 'packages/core/**/vite.config.*.timestamp*', 'packages/core/**/vitest.config.*.timestamp*', 'packages/core/**/*.{js,jsx,mjs,cjs,mts,cts}', '!packages/core/**/*.spec.{js,jsx}'], |
| 64 | + }, |
| 65 | +]; |
0 commit comments