Skip to content

Commit af8b026

Browse files
committed
docs(cli): use typed config in examples
1 parent 9dd8706 commit af8b026

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

packages/cli/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,15 @@ _If you're looking for programmatic usage, then refer to the underlying [@code-p
4343
2. Create a `code-pushup.config.ts` configuration file (`.js` or `.mjs` extensions are also supported).
4444

4545
```ts
46-
export default {
46+
import type { CoreConfig } from '@code-pushup/models';
47+
48+
const config: CoreConfig = {
4749
plugins: [
4850
// ...
4951
],
5052
};
53+
54+
export default config;
5155
```
5256

5357
3. Add plugins as per your project needs (e.g. [@code-pushup/eslint-plugin](../plugin-eslint/README.md)).
@@ -58,14 +62,17 @@ _If you're looking for programmatic usage, then refer to the underlying [@code-p
5862

5963
```ts
6064
import eslintPlugin from '@code-pushup/eslint-plugin';
65+
import type { CoreConfig } from '@code-pushup/models';
6166

62-
export default {
67+
const config: CoreConfig = {
6368
// ...
6469
plugins: [
6570
// ...
6671
await eslintPlugin({ eslintrc: '.eslintrc.js', patterns: ['src/**/*.js'] }),
6772
],
6873
};
74+
75+
export default config;
6976
```
7077

7178
4. Run the CLI with `npx code-pushup` (see `--help` for list of commands and arguments).
@@ -77,7 +84,7 @@ _If you're looking for programmatic usage, then refer to the underlying [@code-p
7784
1. Define your custom categories.
7885

7986
```ts
80-
export default {
87+
const config: CoreConfig = {
8188
// ...
8289
categories: [
8390
{
@@ -108,7 +115,7 @@ _If you're looking for programmatic usage, then refer to the underlying [@code-p
108115
If you have access to the Code PushUp portal, provide credentials in order to upload reports.
109116

110117
```ts
111-
export default {
118+
const config: CoreConfig = {
112119
// ...
113120
upload: {
114121
server: 'https://ip-or-domain/path/to/portal/api/graphql',

0 commit comments

Comments
 (0)