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