quasarframework / quasar-template-default

[DEPRECATED] Quasar App Boilerplate / Starter kit

Home Page:http://quasar-framework.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request] - TypeScript - Integrate linting into vue-loader

Jackson3195 opened this issue · comments

Feature request

Would it be possible to incorporate the ts-loader & tslint-loader into the vue-loader for the quasar typescript template?
I'm relatively new to webpack and still actively learning but I managed to create my own template for the TypeScript library Vuety. If my understanding is correct, all I did was switch vue-class-component for vuety thus I'd imagine this working for both. In the template, I managed to add linting for single file '.vue' files, such that when the user compiles the component, it provides linting in the console. This will allow users to create single file '.vue' files without the need to have a '*.ts' file imported into each component.
Screenshot examples:
Screenshot of App.vue (Notice: import HelloComponent from './components/Hello.vue')
screen shot 2017-07-17 at 22 50 47
Screenshot of console running in dev, providing linting warnings/errors.
screen shot 2017-07-17 at 22 50 36

An argument can be made that developing in the '.ts' file provides real-time linting which is far more beneficial but I guess it's down to personal taste?
I have attempted to add both loaders to the webpack.base.config.js but to no avail, resulting in many errors/issues thus I am unsure how to integrate the loaders into the existing template.
What mine look's like:
screen shot 2017-07-17 at 22 51 04
What the template's look's like:
screen shot 2017-07-17 at 23 12 58
EDIT: Example of what I attempted
screen shot 2017-07-19 at 13 34 41

This works

  {
    test: /\.vue$/,
    loader: 'vue-loader',
    options: {
      esModule: true,
      postcss: cssUtils.postcss,
      loaders: merge(cssUtils.styleLoaders({
        sourceMap: useCssSourceMap,
        extract: env.prod
      }), {ts: 'ts-loader!tslint-loader'})
    }
  },