Plugin: react-featuresRules
no-is-prefix-prop
Boolean props must not be prefixed with `is` (R8)
Part of:
componentApipreset (opt-in — not inrecommended)
Boolean props default to false and their name should describe the true state directly. The is prefix is redundant noise: looped reads naturally, isLooped does not. This follows the same convention flagged by MUI's component API guidelines.
Why This Matters
| Issue | Impact | Solution |
|---|---|---|
| Redundant prefix | isOpen, isDisabled are wordier than necessary | Rename to open, disabled |
| Inconsistency | HTML uses disabled, checked, open — no is prefix | Match the platform convention |
Examples
Incorrect
interface ButtonProps {
isDisabled: boolean; // ❌ R8 — rename to `disabled`
isLoading: boolean; // ❌ R8 — rename to `loading`
}Correct
interface ButtonProps {
disabled?: boolean;
loading?: boolean;
}Suggestions
This rule provides a rename suggestion (not an auto-fix) because renaming the prop has consumer-side blast radius — call sites must be updated manually.
Configuration
// eslint.config.mjs
export default [
{
rules: {
"react-features/no-is-prefix-prop": "error",
},
},
];This rule is part of eslint-plugin-react-features.