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
🕵️ **Code PushUp plugin for measuring web performance and quality with Lighthouse.** 🔥
7
+
🕵️ **Code PushUp plugin for measuring TypeScript quality with compiler diagnostics.** 🔥
8
8
9
9
---
10
10
11
-
The plugin parses your Lighthouse configuration and lints all audits of the official [Lighthouse](https://github.com/GoogleChrome/typescript/blob/main/readme.md#typescript-------) CLI.
12
-
13
-
Detected Lighthouse audits are mapped to Code PushUp audits. Audit reports are calculated based on the [original implementation](https://googlechrome.github.io/typescript/scorecalc/).
14
-
Additionally, Lighthouse categories are mapped to Code PushUp groups which can make it easier to assemble the categories.
11
+
The plugin parses your TypeScript and JavaScript code and lints all audits of the official [TypeScript Compiler]().
15
12
16
13
For more infos visit the [official docs](https://developer.chrome.com/docs/typescript/overview).
17
14
@@ -44,7 +41,9 @@ For more infos visit the [official docs](https://developer.chrome.com/docs/types
44
41
// ...
45
42
plugins: [
46
43
// ...
47
-
awaittypescriptPlugin('https://example.com'),
44
+
awaittypescriptPlugin({
45
+
tsConfigPath: './tsconfig.json'
46
+
}),
48
47
],
49
48
};
50
49
```
@@ -66,39 +65,14 @@ import { typescriptGroupRef } from './utils';
66
65
exportdefault {
67
66
// ...
68
67
categories: [
69
-
{
70
-
slug: 'performance',
71
-
title: 'Performance',
72
-
refs: [typescriptGroupRef('performance')],
73
-
},
74
-
{
75
-
slug: 'a11y',
76
-
title: 'Accessibility',
77
-
refs: [typescriptGroupRef('accessibility')],
78
-
},
79
-
{
80
-
slug: 'best-practices',
81
-
title: 'Best Practices',
82
-
refs: [typescriptGroupRef('best-practices')],
83
-
},
84
-
{
85
-
slug: 'seo',
86
-
title: 'SEO',
87
-
refs: [typescriptGroupRef('seo')],
88
-
},
89
-
{
90
-
slug: 'pwa',
91
-
title: 'PWA',
92
-
isBinary: true,
93
-
refs: [typescriptGroupRef('pwa')],
94
-
},
68
+
95
69
],
96
70
};
97
71
```
98
72
99
73
#### Reference groups with `typescriptAuditRef`
100
74
101
-
The Lighthouse categories are reflected as groups.
75
+
The TypeScript categories are reflected as groups.
102
76
Referencing individual audits offers more granularity. However, keep maintenance costs of a higher number of audits in mind as well.
103
77
104
78
```ts
@@ -116,124 +90,3 @@ export default {
116
90
],
117
91
};
118
92
```
119
-
120
-
## Flags
121
-
122
-
The plugin accepts an optional second argument, `flags`.
123
-
124
-
`flags` is a JavaScript object containing Lighthouse [CLI flags](https://github.com/GoogleChrome/typescript/blob/7d80178c37a1b600ea8f092fc0b098029799a659/cli/cli-flags.js#L80).
125
-
126
-
Within the `flags` object, external configuration files can be referenced using options like `configPath` , `preset`, or `budgetPath`. These options allow Lighthouse to load custom configurations, audit presets, or performance budgets from external `json` or JavaScript files.
127
-
128
-
For a complete list of available options, refer to [the official Lighthouse documentation](https://github.com/GoogleChrome/typescript/blob/main/readme.md#cli-options).
129
-
130
-
> [!TIP]
131
-
> If you are new to working with the Lighthouse CLI, flags can be passed like this:
> The following flags are **not supported** in the current implementation:
147
-
>
148
-
> - `list-all-audits` - Prints a list of all available audits and exits. Alternative: `npxcode-pushupprint-config--onlyPluginstypescript`
149
-
> - `list-locales` - Prints a list of all supported locales and exits.
150
-
> - `list-trace-categories` - Prints a list of all required trace categories and exits.
151
-
> - `view` - Open HTML report in your browser
152
-
153
-
## Chrome Flags for Tooling
154
-
155
-
We recommend using Chrome flags for more stable runs in a tooling environment. The [`chrome-launcher`](https://www.npmjs.com/package/chrome-launcher) package offers a well-documented set of flags specifically designed to ensure reliable execution.
156
-
157
-
The latest version of `@code-pushup/typescript-plugin` provides `DEFAULT_CHROME_FLAGS`, a pre-configured constant that includes Chrome’s default flags for stable, headless execution out of the box. This means you do not need to specify `chromeFlags` manually unless you want to modify them.
158
-
159
-
### Default Usage
160
-
161
-
If no `chromeFlags` are provided, the plugin automatically applies the default configuration:
The plugin accepts a third optional argument, `config`.
201
-
202
-
`config` is the Lighthouse [configuration](https://github.com/GoogleChrome/typescript/blob/7d80178c37a1b600ea8f092fc0b098029799a659/types/config.d.ts#L21) as a JS object.
203
-
204
-
For a complete guide on Lighthouse configuration read the [official documentation on configuring](https://github.com/GoogleChrome/typescript/blob/main/docs/configuration.md)
205
-
206
-
> [!TIP]
207
-
> If you are not used to work with the Lighthouse CLI you would pass a config like this:
0 commit comments