You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/plugin-eslint/README.md
+144-1Lines changed: 144 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,86 @@ Detected ESLint rules are mapped to Code PushUp audits. Audit reports are calcul
93
93
94
94
5. Run the CLIwith`npx code-pushup collect` and view or upload report (refer to [CLI docs](../cli/README.md)).
95
95
96
+
## Artifacts generation and loading
97
+
98
+
In addition to running ESLint from the plugin implementation, you can configure the plugin to consume pre-generated ESLint reports (artifacts). This is particularly useful for:
99
+
100
+
-**CI/CD pipelines**: Use cached lint results from your build system
101
+
-**Monorepo setups**: Aggregate results from multiple projects or targets
102
+
-**Performance optimization**: Skip ESLint execution when reports are already available
103
+
-**Custom workflows**: Integrate with existing linting infrastructure
104
+
105
+
The artifacts feature supports loading ESLint JSON reports that follow the standard `ESLint.LintResult[]` format.
106
+
107
+
### Basic artifact configuration
108
+
109
+
Specify the path(s) to your ESLint JSON report files:
110
+
111
+
```js
112
+
import eslintPlugin from '@code-pushup/eslint-plugin';
113
+
114
+
export default {
115
+
plugins: [
116
+
await eslintPlugin({
117
+
artifacts: {
118
+
artifactsPaths: './eslint-report.json',
119
+
},
120
+
}),
121
+
],
122
+
};
123
+
```
124
+
125
+
### Multiple artifact files
126
+
127
+
Use glob patterns to aggregate results from multiple files:
You can extend the plugin configuration with custom groups to categorize ESLint rules according to your project's specific needs. Custom groups allow you to assign weights to individual rules, influencing their impact on the report. Rules can be defined as an object with explicit weights or as an array where each rule defaults to a weight of 1. Additionally, you can use wildcard patterns (`*`) to include multiple rules with similar prefixes.
@@ -228,4 +308,67 @@ export default {
228
308
229
309
## Nx Monorepo Setup
230
310
231
-
Find all details in our [Nx setup guide](https://github.com/code-pushup/cli/wiki/Code-PushUp-integration-guide-for-Nx-monorepos#eslint-config).
311
+
### Caching artifact generation
312
+
313
+
To leverage Nx's caching capabilities, you need to generate a JSON artifact for caching while still being able to see the eslint violations in the terminal, to fix them.
0 commit comments