Rules for consistent usage of clsx
functions.
You'll first need to install ESLint >=8 and eslint-plugin-clsx
:
pnpm add -D eslint eslint-plugin-clsx
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-clsx
globally.
Add an override to your ESLint configuration file that specifies this plugin, eslint-plugin-clsx
and its recommended rules for your package.json
file:
module.exports = {
extends: ["plugin:eslint-plugin-clsx/recommended"],
};
Or, individually configure the rules you want to use under the rules section.
module.exports = {
{
plugins: ["clsx"],
rules: {
"clsx/no-useless-clsx": "error",
},
],
};
๐ง Automatically fixable by the --fix
CLI option.
Name | Description | ๐ง |
---|---|---|
no-useless-clsx | enforce use of "clsx" with dynamic data argument | ๐ง |