yarn install
npx stylelint index.css
No error.
index.css
5:1 ✖ .Component__root--unused is defined but doesn't match any elements in index.jsx. plugin/no-unused-selectors
/node_modules | |
/yarn.lock |
.Component__root { | |
background: black; | |
} | |
.Component__root--unused { | |
background: red; | |
} |
import React from 'react'; | |
const Component = () => { | |
return <div className="Component__root"></div>; | |
}; | |
export { Component }; |
{ | |
"private": "true", | |
"devDependencies": { | |
"stylelint": "14.8.5", | |
"stylelint-no-unused-selectors": "1.0.40" | |
} | |
} |
module.exports = { | |
plugins: ['stylelint-no-unused-selectors'], | |
rules: { | |
'plugin/no-unused-selectors': {}, | |
}, | |
}; |