[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'
)
Screenshot of console running in dev, providing linting warnings/errors.
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:
What the template's look's like:
EDIT: Example of what I attempted
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'})
}
},