Skip to content

docs: Add common use case scenario for Vue CLI lint command #4583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: docs
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/guide/cli-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,32 @@ There are a few useful flags:

- `--report` and `--report-json` will generate reports based on your build stats that can help you analyze the size of the modules included in your bundle.

## vue-cli-service lint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concern: I think this section of the CLI docs describes only scripts available with the basic setup, i.e. without any CLI plugins included. However, lint script is added only with @vue/cli-plugin-eslint. My suggestion would be to move this part to respective docs (i.e. @vue/cli-plugin-eslint documentation).

Also, PRs to docs should be created using master or next branch as a base (see Contributing guide).

In master ESLint plugin docs are located here

In next we changed them to be the part of the main documentation rather than standalone READMEs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa that's weird. I just used the "Edit" link on the page to do this. That's interesting that it made the destination vuejs:docs rather than master (which is what I assumed).

Shall I just make the PR for next then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's a great catch! I will fix the Vuepress links to the repo! 🙇‍♀

Yes, I think a PR for next should work 😉


```
Usage: vue-cli-service lint [options] [...files]

Options:

--format [formatter] specify formatter (default: codeframe)
--no-fix do not fix errors or warnings
--no-fix-warnings fix errors, but do not fix warnings
--max-errors [limit] specify number of errors to make build failed (default: 0)
--max-warnings [limit] specify number of warnings to make build failed (default: Infinity)
```

### What if my project is not in the same directory as the Vue CLI scaffold?

For those looking to specify directory will be impacted by their `vue-cli-service lint` command, you can pass it a regex pattern for whichever directory you desire. For example:

1. Vue CLI projects lives in `/src/webapp/`
2. `package.json` lives in root directory (`/`)

You will need to define your lint command as:

`"lint": "vue-cli-service lint ./src/webapp/**/*.js ./src/webapp/**/*.vue`


## vue-cli-service inspect

```
Expand Down