A collection of WXSS specific linting rules for stylelint (in a form of plugin).
npm install stylelint stylelint-wxss
Create the configuration file stylelint.config.js
:
module.exports = {
plugins: ['stylelint-wxss'],
rules: {
'wxss/selector-disallowed': ['tag']
}
}
module.exports = {
plugins: ['stylelint-wxss'],
rules: {
'wxss/selector-disallowed': [['tag'], {
exclude: {
tag: ['page']
}
}]
}
}
glob
options: multimatch
module.exports = {
plugins: ['stylelint-wxss'],
rules: {
'wxss/selector-disallowed': [['tag'], {
// skip lint files under component directory
glob: ['**', '!**/component/**']
}]
}
}
To disable specific selector types.