vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

`vue-cli-service serve` lints plugin on save #3979

Open parml opened 5 years ago

parml commented 5 years ago

Version

3.7.0

Reproduction link

https://github.com/iovuio/so-vue-lint-issue-001

Environment info

System:
    OS: macOS Mojave 10.14.4
    CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
  Binaries:
    Node: 10.15.3 - /usr/local/opt/node@10/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/opt/node@10/bin/npm
  Browsers:
    Chrome: 74.0.3729.131
    Firefox: Not Found
    Safari: 12.1
  npmPackages:
    vue-cli-plugin-vuetify:  0.5.0
  npmGlobalPackages:
    @vue/cli: 3.7.0

Steps to reproduce

1. On the command line

$ vue create so-vue-lint-issue-001

Select options as below

Vue CLI v3.7.0
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, Linter
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript for auto-detected polyfills? Yes
? Pick a linter / formatter config: TSLint
? Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection)Lint on save
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? (y/N) N

2. On the command-line

$ vue add vuetify

Choose the Default preset.


3. On the command-line

$ npm run serve

What is expected?

No tslint warning or errors due to source code in plugin

What is actually happening?

vuetify related warnings and errors like the one below:

WARNING in /private/tmp/testing-017/src/plugins/vuetify.ts
3:37 Missing semicolon
    1 | import Vue from 'vue'
    2 | import Vuetify from 'vuetify/lib'
  > 3 | import 'vuetify/src/stylus/app.styl'
      |                                     ^
    4 |
    5 | Vue.use(Vuetify, {
    6 |   iconfont: 'md',

adding src/plugins to the exclude list in tslint.json does not fix the problem.

haoqunjiang commented 5 years ago

For now you can run npm run lint -- --fix manually after adding the plugin.