Skip to content

Commit 74f3f8a

Browse files
committed
Merge branch 'main' into add-plugin-targets
# Conflicts: # code-pushup.preset.ts # nx.json
2 parents 2881f07 + e03d92b commit 74f3f8a

File tree

16 files changed

+55
-1
lines changed

16 files changed

+55
-1
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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import coveragePlugin, {
99
import eslintPlugin, {
1010
eslintConfigFromAllNxProjects,
1111
} 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';
1214
import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js';
1315
import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js';
1416
import type { JsDocsPluginTransformedConfig } from './packages/plugin-jsdocs/src/lib/config.js';
@@ -155,6 +157,17 @@ export const jsDocsCoreConfig = (
155157
),
156158
});
157159

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+
158171
export const eslintCoreConfigNx = async (
159172
projectName?: string,
160173
): Promise<CoreConfig> => ({

nx.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,30 @@
101101
"outputs": ["{options.outputFile}"],
102102
"cache": true,
103103
"options": {
104+
"errorOnUnmatchedPattern": false,
104105
"maxWarnings": 0,
105106
"lintFilePatterns": [
106107
"{projectRoot}/**/*.ts",
107108
"{projectRoot}/package.json"
108109
]
109110
}
110111
},
112+
"lint-report": {
113+
"inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"],
114+
"outputs": ["{projectRoot}/.eslint/eslint-report*.json"],
115+
"cache": true,
116+
"executor": "@nx/linter:eslint",
117+
"options": {
118+
"errorOnUnmatchedPattern": false,
119+
"maxWarnings": 0,
120+
"format": "json",
121+
"outputFile": "{projectRoot}/.eslint/eslint-report.json",
122+
"lintFilePatterns": [
123+
"{projectRoot}/**/*.ts",
124+
"{projectRoot}/package.json"
125+
]
126+
}
127+
},
111128
"nxv-pkg-install": {
112129
"parallelism": false
113130
},

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)