Skip to content

Instantly share code, notes, and snippets.

@3846masa
Last active June 6, 2022 07:27
Show Gist options
  • Save 3846masa/425887e280190c572252969b81f07ec8 to your computer and use it in GitHub Desktop.
Save 3846masa/425887e280190c572252969b81f07ec8 to your computer and use it in GitHub Desktop.

Code that reproduces the bug

Usage

yarn install
npx stylelint index.css

Actual

No error.

Expected

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': {},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment