How to add paths to "vue-cli-service lint"

Viewed 1455

I have a Vue CLI project with some extra directories, api/ and config/storybook/, and I'd like to include them when I run yarn run lint (which is vue-cli-service lint).

Is there a way to add these extra paths to the list that vue-cli-service lints? Perhaps something I can add in vue.config.js?

I know I can specify paths as extra arguments at the commandline, like:

vue-cli-service lint src/**/*.vue src/**/*.js config/**/*.js api/**/*.js

...but then I have to also include src/ and try to include whatever else vue-cli-service was already doing. What's the cleanest way to add directories?

I tried searching the source code for the linter service, but I wasn't able to find where the defaults are defined. I would expect to see "*.vue" somewhere in the cli-plugin-eslint directory, but I must be looking in the wrong spot.

1 Answers

I later figured out that the Vue CLI service's linter is best suited lint the Vue parts of the project, and anything else can be linted by eslint itself. Here's how I'm doing it today:

vue-cli-service lint --no-fix && eslint --no-fix api config
Related