Registry /
testing / eslint-plugin-tss-unused-classes
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
plugin
✓ // In .eslintrc.js: plugins: ['tss-unused-classes'], rules: { 'tss-unused-classes/unused-classes': 'warn' }
✗ // Do not import as a module in JS; it's an ESLint plugin
This is an ESLint plugin, not a module. Configure via eslint config.
unused-classes rule
✓ 'tss-unused-classes/unused-classes': 'warn'
✗ 'tss-unused-classes': 'warn'
The rule is namespaced under the plugin name; prefix with 'tss-unused-classes/'.
// eslint-disable-next-line
✓ // eslint-disable-next-line tss-unused-classes/unused-classes
✗ // eslint-disable-next-line unused-classes
Disable comments must use the full rule name with plugin prefix.
Setup and example of detecting unused tss-react classes with ESLint.
// 1. Install: yarn add --dev eslint-plugin-tss-unused-classes
// 2. Configure .eslintrc.js:
module.exports = {
plugins: ['tss-unused-classes'],
rules: {
'tss-unused-classes/unused-classes': 'warn'
}
};
// 3. In a React component using tss-react:
import { makeStyles } from 'tss-react/mui';
const useStyles = makeStyles()((theme) => ({
root: { color: 'red' },
unusedRoot: { color: 'blue' }
}));
export function MyComponent() {
const { classes } = useStyles();
// Want to use classes.root but forgot? Plugin will warn about classes.unusedRoot
return <div className={classes.root}>Hello</div>;
}
Errors
Common errors & fixes
ESLint: Rule 'tss-unused-classes/unused-classes' was not found.
Plugin not installed or not listed in plugins array.
fixRun 'yarn add --dev eslint-plugin-tss-unused-classes' and add 'tss-unused-classes' to plugins array in .eslintrc.
Parsing error: The keyword 'import' is reserved
ESLint is not configured for ES modules.
fixSet 'sourceType': 'module' in parserOptions, or use a babel parser for JSX.
Warning: Rule 'tss-unused-classes/unused-classes' has been deprecated (note: not actually deprecated, but may appear if using old config format).
Using legacy format with @ prefix in older versions.
fixUse 'tss-unused-classes/unused-classes' without @.
Audit
Dependencies
eslintrequiredpeer dependency, plugin runs within ESLint