|
| 1 | +const tseslint = require('typescript-eslint'); |
1 | 2 | const baseConfig = require('../../eslint.config.js').default; |
2 | 3 |
|
3 | | -module.exports = [ |
| 4 | +module.exports = tseslint.config( |
4 | 5 | ...baseConfig, |
| 6 | + { |
| 7 | + files: ['**/*.ts'], |
| 8 | + languageOptions: { |
| 9 | + parserOptions: { |
| 10 | + projectService: true, |
| 11 | + tsconfigRootDir: __dirname, |
| 12 | + }, |
| 13 | + }, |
| 14 | + }, |
| 15 | + { |
| 16 | + files: ['**/*.ts'], |
| 17 | + rules: { |
| 18 | + // Nx plugins don't yet support ESM: https://github.com/nrwl/nx/issues/15682 |
| 19 | + 'unicorn/prefer-module': 'off', |
| 20 | + // used instead of verbatimModuleSyntax tsconfig flag (requires ESM) |
| 21 | + '@typescript-eslint/consistent-type-imports': [ |
| 22 | + 'warn', |
| 23 | + { |
| 24 | + fixStyle: 'inline-type-imports', |
| 25 | + disallowTypeAnnotations: false, |
| 26 | + }, |
| 27 | + ], |
| 28 | + '@typescript-eslint/consistent-type-exports': [ |
| 29 | + 'warn', |
| 30 | + { fixMixedExportsWithInlineTypeSpecifier: true }, |
| 31 | + ], |
| 32 | + // `import path from 'node:path'` incompatible with CJS runtime, prefer `import * as path from 'node:path'` |
| 33 | + 'unicorn/import-style': [ |
| 34 | + 'warn', |
| 35 | + { styles: { 'node:path': { namespace: true } } }, |
| 36 | + ], |
| 37 | + // `import { logger } from '@nx/devkit' is OK here |
| 38 | + 'no-restricted-imports': 'off', |
| 39 | + }, |
| 40 | + }, |
5 | 41 | { |
6 | 42 | files: ['**/*.json'], |
7 | 43 | rules: { |
8 | 44 | '@nx/dependency-checks': 'error', |
9 | 45 | }, |
10 | 46 | }, |
11 | | -]; |
| 47 | + { |
| 48 | + files: ['**/package.json', '**/generators.json'], |
| 49 | + rules: { |
| 50 | + '@nx/nx-plugin-checks': 'error', |
| 51 | + }, |
| 52 | + }, |
| 53 | +); |
0 commit comments