Skip to content

Commit 229203d

Browse files
committed
Merge branch 'main' into test/cleanup-e2e-test
# Conflicts: # nx.json
2 parents 2b71609 + e03d92b commit 229203d

File tree

16 files changed

+56
-3
lines changed

16 files changed

+56
-3
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ testem.log
4343
.DS_Store
4444
Thumbs.db
4545

46+
# generated eslint reports
47+
.eslint
48+
4649
# generated Code PushUp reports
47-
/.code-pushup
50+
.code-pushup
4851

4952
# Nx workspace cache
5053
.nx

code-pushup.preset.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import coveragePlugin, {
77
getNxCoveragePaths,
88
} from './packages/plugin-coverage/src/index.js';
99
import eslintPlugin, {
10-
eslintConfigFromAllNxProjects,
1110
eslintConfigFromNxProject,
1211
} from './packages/plugin-eslint/src/index.js';
12+
import type { ESLintTarget } from './packages/plugin-eslint/src/lib/config.js';
13+
import { nxProjectsToConfig } from './packages/plugin-eslint/src/lib/nx/projects-to-config.js';
1314
import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js';
1415
import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js';
1516
import type { JsDocsPluginTransformedConfig } from './packages/plugin-jsdocs/src/lib/config.js';
@@ -156,14 +157,25 @@ export const jsDocsCoreConfig = (
156157
),
157158
});
158159

160+
export async function eslintConfigFromPublishableNxProjects(): Promise<
161+
ESLintTarget[]
162+
> {
163+
const { createProjectGraphAsync } = await import('@nx/devkit');
164+
const projectGraph = await createProjectGraphAsync({ exitOnError: false });
165+
return nxProjectsToConfig(
166+
projectGraph,
167+
project => project.tags?.includes('publishable') ?? false,
168+
);
169+
}
170+
159171
export const eslintCoreConfigNx = async (
160172
projectName?: string,
161173
): Promise<CoreConfig> => ({
162174
plugins: [
163175
await eslintPlugin(
164176
await (projectName
165177
? eslintConfigFromNxProject(projectName)
166-
: eslintConfigFromAllNxProjects()),
178+
: eslintConfigFromPublishableNxProjects()),
167179
),
168180
],
169181
categories: eslintCategories,

nx.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,30 @@
4949
"outputs": ["{options.outputFile}"],
5050
"cache": true,
5151
"options": {
52+
"errorOnUnmatchedPattern": false,
5253
"maxWarnings": 0,
5354
"lintFilePatterns": [
5455
"{projectRoot}/**/*.ts",
5556
"{projectRoot}/package.json"
5657
]
5758
}
5859
},
60+
"lint-report": {
61+
"inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"],
62+
"outputs": ["{projectRoot}/.eslint/eslint-report*.json"],
63+
"cache": true,
64+
"executor": "@nx/linter:eslint",
65+
"options": {
66+
"errorOnUnmatchedPattern": false,
67+
"maxWarnings": 0,
68+
"format": "json",
69+
"outputFile": "{projectRoot}/.eslint/eslint-report.json",
70+
"lintFilePatterns": [
71+
"{projectRoot}/**/*.ts",
72+
"{projectRoot}/package.json"
73+
]
74+
}
75+
},
5976
"nxv-pkg-install": {
6077
"parallelism": false
6178
},

packages/ci/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"targets": {
77
"build": {},
88
"lint": {},
9+
"lint-report": {},
910
"unit-test": {},
1011
"int-test": {}
1112
},

packages/cli/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"targets": {
77
"build": {},
88
"lint": {},
9+
"lint-report": {},
910
"unit-test": {},
1011
"int-test": {},
1112
"run-help": {

packages/core/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"targets": {
77
"build": {},
88
"lint": {},
9+
"lint-report": {},
910
"unit-test": {},
1011
"int-test": {}
1112
},

packages/create-cli/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"targets": {
77
"build": {},
88
"lint": {},
9+
"lint-report": {},
910
"unit-test": {},
1011
"exec-node": {
1112
"dependsOn": ["build"],

packages/models/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
]
1919
},
2020
"lint": {},
21+
"lint-report": {},
2122
"unit-test": {}
2223
},
2324
"tags": ["scope:shared", "type:util", "publishable"]

packages/nx-plugin/project.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
]
4242
}
4343
},
44+
"lint-report": {
45+
"options": {
46+
"lintFilePatterns": [
47+
"packages/nx-plugin/**/*.ts",
48+
"packages/nx-plugin/package.json",
49+
"packages/nx-plugin/generators.json"
50+
]
51+
}
52+
},
4453
"unit-test": {},
4554
"int-test": {}
4655
},

packages/plugin-coverage/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"targets": {
77
"build": {},
88
"lint": {},
9+
"lint-report": {},
910
"unit-test": {},
1011
"int-test": {}
1112
},

0 commit comments

Comments
 (0)