eslint-plugin-css-modules
eslint-plugin-css-modules copied to clipboard
Support for .vue files
The .vue file
<style lang="scss" scoped>
.unused-class {
background: red;
}
</style>
My eslintrc.js config:
module.exports = {
root: true,
env: {
browser: true,
node: true
},
extends: [
'plugin:vue/recommended',
'plugin:css-modules/recommended'
],
plugins: [
'vue',
'eslint-plugin-css-modules'
]
};
Expected: eslint should throws a warning/error for the unused class
scoped
attribute for <style>
tag doesn't use css modules.
You should use module
attribute for <style>
tag to use css modules ( https://vue-loader.vuejs.org/guide/css-modules.html )