Skip to content

ESLint --output-file option not supported in @vue/cli-plugin-eslint #4849

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

Closed
ataylorme opened this issue Nov 15, 2019 · 4 comments · Fixed by #4850
Closed

ESLint --output-file option not supported in @vue/cli-plugin-eslint #4849

ataylorme opened this issue Nov 15, 2019 · 4 comments · Fixed by #4850

Comments

@ataylorme
Copy link
Contributor

Version

4.0.5

Reproduction link

https://github.com/ataylorme/vue-cli-lint-output-file-issue

Environment info

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
  Binaries:
    Node: 12.13.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.13.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 78.0.3904.97
    Firefox: Not Found
    Safari: 13.0.3
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  4.0.5
    @vue/babel-preset-jsx:  1.1.2
    @vue/babel-sugar-functional-vue:  1.1.2
    @vue/babel-sugar-inject-h:  1.1.2
    @vue/babel-sugar-v-model:  1.1.2
    @vue/babel-sugar-v-on:  1.1.2
    @vue/cli-overlay:  4.0.5
    @vue/cli-plugin-babel: ^4.0.0 => 4.0.5
    @vue/cli-plugin-eslint: ^4.0.0 => 4.0.5
    @vue/cli-plugin-router:  4.0.5
    @vue/cli-plugin-vuex:  4.0.5
    @vue/cli-service: ^4.0.0 => 4.0.5
    @vue/cli-shared-utils:  4.0.5
    @vue/component-compiler-utils:  3.0.2
    @vue/preload-webpack-plugin:  1.1.1
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.3
    vue: ^2.6.10 => 2.6.10
    vue-eslint-parser:  5.0.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.7.2
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: 4.0.5

Steps to reproduce

Clone the ataylorme/vue-cli-lint-output-file-issue repository
Run npm install to download dependencies
Run npm run lint, which is an npm script alias for vue-cli-service lint --format json --output-file lint_results.json

What is expected?

The results of vue-cli-service lint are saved to the file lint_results.json in JSON format

What is actually happening?

The results of vue-cli-service lint are displayed as terminal output and the lint_results.json is not created


The Vue CLI ESLint plugin documentation says "Other ESLint CLI options are also supported."

--output-file is a valid ESLint CLI option.

My end goal is to save the Vue lint results in JSON format to a file, which can then be analyzed.

@LinusBorg
Copy link
Member

We shouldake clear in the docs that CLI-only options are not supported since we don't run the eslint CLI, we import and run the CLIEngine in our node process which doesn't support CLI-only flags.

@ataylorme
Copy link
Contributor Author

@LinusBorg I opened #4850 which adds the output-file option. It also changes the documentation to say:

Other ESLint CLI options are not supported.

so that it is clear options not listed in the README aren't supported

@mttmccb
Copy link

mttmccb commented Nov 27, 2019

Also ran into this problem and have a bit of a hacky method of piping the output to a file, however when it's successful then the format is invalid (in my case XML) so that needs to be handled. Would be so much easier if it could support this as we use the output in Jenkins.

@ataylorme
Copy link
Contributor Author

@mttmccb can you test my work in #4850? It should work with XML if you specify --format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants