Reputation: 1728
I'm looking for a way to enforce that everyone working on our code base use TypeScript for Single File Components. All the components use TypeScript, so disabling JavaScript is also an option.
I thought that this could be done with an ESLint rule, but I can’t find it.
Upvotes: 2
Views: 1941
Reputation: 710
This feature is now available in eslint-plugin-vue
. Use the vue/block-lang
rule.
// .eslintrc.json
{
"vue/block-lang": ["error",
{
"script": {
"lang": "ts"
}
}
]
}
https://eslint.vuejs.org/rules/block-lang.html#vue-block-lang
Upvotes: 8