eslint-plugin-tss-unused-classes

1.0.2 • Public • Published

Detect unused tss-react classes

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

https://user-images.githubusercontent.com/6702424/167231369-4eaeb5b2-bb39-4647-9911-086572c5e212.mov

Usage

  1. Add the dependency:
yarn add --dev eslint-plugin-tss-unused-classes
  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-classes"
    ],
    "rules": {
      "tss-unused-classes/unused-classes": "warn"
    }
  },
  //...
}

Example projet

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

module.exports = {
  // ...
  plugins: [
    // ...
    'tss-unused-classes'
  ],
  rules: {
    // ...
    'tss-unused-classes/unused-classes': 'warn'
  }
}

Example project

Disabling warnings

In case of false positive, disabling the warning:

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

Package Sidebar

Install

npm i eslint-plugin-tss-unused-classes

Weekly Downloads

10,641

Version

1.0.2

License

MIT

Unpacked Size

47.9 kB

Total Files

8

Last publish

Collaborators

  • garronej