0.0.1 • Published 2 years ago

eslint-plugin-tss-unused-makestyles v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Detect unused tss-react makestyles

This eslint plugin lets you detect unused tss-react makestyles:

Usage

  1. Add the dependency:
yarn add --dev eslint-plugin-tss-unused-makestyles
  1. Enable it in you ESLint config

Case 1: You are in a create-react-app project:
Edit your package.json:

{
  //...
  "eslintConfig": {
    "plugins": [
      //...
      "tss-unused-makestyles"
    ],
    "rules": {
      "tss-unused-makestyles/unused-makestyles": "warn"
    }
  }
  //...
}

Example projet

Case 2: You have installed ESLint manually:
Edit your .eslintrc.js file:

module.exports = {
  // ...
  plugins: [
    // ...
    "tss-unused-makestyles",
  ],
  rules: {
    // ...
    "tss-unused-makestyles/unused-makestyles": "warn",
  },
};

Disabling warnings

In case of false positive, disabling the warning:

  • For a line: // eslint-disable-next-line tss-unused-makestyles/unused-makestyles
  • For the entire file: // eslint-disable-next-line tss-unused-makestyles/unused-makestyles