Skip to content
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

Support tslint's '--out' option in @vue/cli-plugin-typescript #2360

Closed
jerry88kim opened this issue Aug 26, 2018 · 7 comments
Closed

Support tslint's '--out' option in @vue/cli-plugin-typescript #2360

jerry88kim opened this issue Aug 26, 2018 · 7 comments

Comments

@jerry88kim
Copy link

Version

3.0.1

Node and OS info

Node 10.9.0 / yarn 1.9.4 / MacOS 10.13.6

Steps to reproduce

yarn add @vue/cli-plugin-typescript

vue-cli-service lint --format junit --out tslint.xml

What is expected?

Save tslint's output in file using '--out' option.

What is actually happening?

'tslint.xml' file does not produce.

'--out' option supported in existing tslint(https://palantir.github.io/tslint/usage/cli/) does not work with tslint in @vue/cli-plugin-typescript.

@chriszrc
Copy link

Is the cli lint command even running tslint? Or is it running eslint? I get no errors when running vue-cli-service lint but plenty of tslint errors when running vue-cli-service serve?

@LinusBorg
Copy link
Member

LinusBorg commented Jan 10, 2019

Is the cli lint command even running tslint? Or is it running eslint?

If you have installed the eslint plugin as well, lint will use eslint. If you haven't, it will use tslint:

https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-typescript/index.js#L81-L93

This behaviour isn't really what the README says:

If opted to use TSLint during project creation, vue-cli-service lint will be injected.

I get no errors when running vue-cli-service lint but plenty of tslint errors when running vue-cli-service serve?

tslint is used by the fork-ts-checker plugin if lintOnServe: true is set in the config and a tslint.json is found.

https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-typescript/index.js#L73

I think we really need to better document this behaviour, but it's unrelated to the current issue.

Please consider opening a separate issue to track improvment of docs for this.

@chriszrc
Copy link

chriszrc commented Jan 10, 2019

Happy to make a new issue, but where I was going with my question, is like the original issue, I was hoping to be able to provide command line arguments to the lint command, specifically, to change the formatter to the verbose version, because otherwise I can't see which rules to modify in order to customize the tslinting. Is that possible? Or is there a better way?

@LinusBorg
Copy link
Member

Well then it's two things:

  1. to use tslint with the lint command, uninstall the eslint plugin
  2. If you have additional requests for tslint options, we can consider extending this issue to mean: forward all additional args to tslint.

@anders-wind
Copy link

anders-wind commented Apr 11, 2019

2. If you have additional requests for tslint options, we can consider extending this issue to mean: forward all additional args to tslint.

This would be very helpful :)

@haoqunjiang
Copy link
Member

Now that TSLint is officially deprecated, TSLint support will be fully dropped in the next major version; as for the current major version, no more bug fixes or features will be implemented except for security reasons. So I'm closing this issue now.

@cawoodm
Copy link

cawoodm commented Nov 16, 2020

Any idea why --out is ignored by the vue cli?

vue-cli-service lint --max-warnings 0 --no-fix --format junit --out lint-junit.xml

The following should produce the results in lint-junit.xml but writes to stdout instead.

Also the options -o or --output-file for the ESLint plugin are ignored and output is on stdout instead of to the file.

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

No branches or pull requests

6 participants