Skip to content

Commit 1cb993e

Browse files
committed
test(plugin-eslint): convert nx monorepo integration test fixture to flat config
1 parent 78ba02e commit 1cb993e

File tree

19 files changed

+163
-234
lines changed

19 files changed

+163
-234
lines changed

packages/plugin-eslint/mocks/fixtures/nx-monorepo/.eslintrc.json

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const nx = require('@nx/eslint-plugin');
2+
3+
module.exports = [
4+
{
5+
files: ['**/*.json'],
6+
// Override or add rules here
7+
rules: {},
8+
languageOptions: {
9+
parser: require('jsonc-eslint-parser'),
10+
},
11+
},
12+
...nx.configs['flat/base'],
13+
...nx.configs['flat/typescript'],
14+
...nx.configs['flat/javascript'],
15+
{
16+
ignores: ['**/dist'],
17+
},
18+
{
19+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
20+
rules: {
21+
'@nx/enforce-module-boundaries': [
22+
'warn',
23+
{
24+
enforceBuildableLibDependency: true,
25+
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?js$'],
26+
depConstraints: [
27+
{
28+
sourceTag: '*',
29+
onlyDependOnLibsWithTags: ['*'],
30+
},
31+
],
32+
},
33+
],
34+
},
35+
},
36+
{
37+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
38+
// Override or add rules here
39+
rules: {},
40+
},
41+
];

packages/plugin-eslint/mocks/fixtures/nx-monorepo/nx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"@nrwl/js": {
44
"analyzeSourceFiles": true
55
}
6-
}
6+
},
7+
"useDaemonProcess": false
78
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"private": true,
3+
"type": "commonjs"
4+
}

packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/cli/.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const baseConfig = require('../../eslint.config.js');
2+
3+
module.exports = [
4+
...baseConfig,
5+
{
6+
files: ['**/*.json'],
7+
rules: {
8+
'@nx/dependency-checks': [
9+
'error',
10+
{
11+
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
12+
},
13+
],
14+
},
15+
languageOptions: {
16+
parser: require('jsonc-eslint-parser'),
17+
},
18+
},
19+
];

packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/cli/project.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
"implicitDependencies": ["core"],
66
"targets": {
77
"lint": {
8-
"executor": "@nx/linter:eslint",
9-
"outputs": ["{options.outputFile}"],
10-
"options": {
11-
"lintFilePatterns": ["packages/cli/**/*.ts"]
12-
}
8+
"executor": "@nx/eslint:lint"
139
}
1410
}
1511
}

packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/core/.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const baseConfig = require('../../eslint.config.js');
2+
3+
module.exports = [
4+
...baseConfig,
5+
{
6+
files: ['**/*.json'],
7+
rules: {
8+
'@nx/dependency-checks': [
9+
'error',
10+
{
11+
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
12+
},
13+
],
14+
},
15+
languageOptions: {
16+
parser: require('jsonc-eslint-parser'),
17+
},
18+
},
19+
];

packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/core/project.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
"implicitDependencies": ["utils"],
66
"targets": {
77
"lint": {
8-
"executor": "@nx/linter:eslint",
9-
"outputs": ["{options.outputFile}"],
10-
"options": {
11-
"lintFilePatterns": ["packages/core/**/*.ts"]
12-
}
8+
"executor": "@nx/eslint:lint"
139
}
1410
}
1511
}

0 commit comments

Comments
 (0)