Skip to content

Commit

Permalink
📝 Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasonny83 committed Nov 20, 2018
1 parent 1ef1cfd commit 0c240a7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 17 deletions.
22 changes: 22 additions & 0 deletions README.md
Expand Up @@ -18,6 +18,17 @@
$ npm install -g lighthouse-ci
```

## Table of Contents

- [Lighthouse CI](#lighthouse-ci)
- [Install](#install)
- [Table of Contents](#table-of-contents)
- [Usage](#usage)
- [CLI](#cli)
- [Lighthouse flags](#lighthouse-flags)
- [Contributors](#contributors)
- [License](#license)

## Usage

```sh
Expand Down Expand Up @@ -50,6 +61,17 @@ $ lighthouse-ci --help
--seo=<threshold> Specify a minimal seo score for the CI to pass.
```

## Lighthouse flags

In addition to listed `lighthouse-ci` configuration flags, it is also possible to pass any native `lighthouse` flags.
To see the full list of available flags, please refer to the official [Gloogle Lighthouse documentation](https://github.com/GoogleChrome/lighthouse#cli-options).

eg.

```sh
$ lighthouse-ci --emulated-form-factor desktop --seo 92
```

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
Expand Down
37 changes: 20 additions & 17 deletions bin/cli
Expand Up @@ -45,6 +45,9 @@ const cli = meow(
--best-practice=<threshold> [DEPRECATED] Use best-practices instead.
--best-practices=<threshold> Specify a minimal best-practice score for the CI to pass.
--seo=<threshold> Specify a minimal seo score for the CI to pass.
In addition to listed "lighthouse-ci" configuration flags, it is also possible to pass any native "lighthouse" flag.
To see the full list of available flags, please refer to the official Gloogle Lighthouse documentation at https://github.com/GoogleChrome/lighthouse#cli-options
`,
{
flags: {
Expand All @@ -68,27 +71,27 @@ const cli = meow(
);

const {
report,
silent,
s,
score,
performance,
pwa,
accessibility,
report,
silent,
s,
score,
performance,
pwa,
accessibility,
bestPractice,
bestPractices,
seo,
seo,
...lighthouseFlags} = cli.flags;
const calculatedBestPractices = bestPractice || bestPractices;
const flags = {
report,
silent,
s,
score,
performance,
pwa,
accessibility,
...(calculatedBestPractices && { 'best-practices': calculatedBestPractices }),
const flags = {
report,
silent,
s,
score,
performance,
pwa,
accessibility,
...(calculatedBestPractices && { 'best-practices': calculatedBestPractices }),
seo
};

Expand Down

0 comments on commit 0c240a7

Please sign in to comment.