Skip to content

Commit 2877a89

Browse files
committed
docs(plugin-eslint): add artifacts docs
1 parent dfeecab commit 2877a89

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

packages/plugin-eslint/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,38 @@ export default {
129129
};
130130
```
131131
132+
### Using artifacts for better performance
133+
134+
For better performance in CI environments or when dealing with large codebases, you can use pre-generated ESLint report files instead of running ESLint during Code PushUp execution. This is especially useful for separating linting from analysis, caching results, or integrating with existing CI pipelines. Use the `artifacts` option to specify paths to ESLint JSON report files:
135+
136+
```js
137+
// with artifacts
138+
await eslintPlugin(
139+
{ eslintrc: '.eslintrc.js', patterns: ['src/**/*.js'] },
140+
{
141+
artifacts: {
142+
artifactsPaths: ['reports/eslint.json'],
143+
},
144+
},
145+
);
146+
147+
// with artifact generation
148+
await eslintPlugin(
149+
{ eslintrc: '.eslintrc.js', patterns: ['src/**/*.js'] },
150+
{
151+
artifacts: {
152+
// Optional: generate reports first
153+
generateArtifactsCommand: 'npm run lint:json',
154+
// Single file or array of files
155+
artifactsPaths: ['reports/eslint.json'],
156+
},
157+
},
158+
);
159+
```
160+
161+
If no artifacts are provided, the plugin will run ESLint during Code PushUp analysis.
162+
It generates the required JSON reports, use ESLint's `--format=json --output-file=report.json` options. When using artifacts, the `eslintrc` (not `patterns`) configuration is still required for audit metadata, but ESLint won't be executed during Code PushUp analysis.
163+
132164
### Optionally set up categories
133165
134166
1. Reference audits (or groups) which you wish to include in custom categories (use `npx code-pushup print-config` to list audits and groups).

0 commit comments

Comments
 (0)