Hello friend, if your project needs to track ts interface prefixes, this plugin is for you. There is no autofix in it, there is only a message about a violation of the spelling rule.
Rules:
eslint-plugin-interface-prefix-control-svt
supports one rule:
- enforcing prefixing
- Interfaces should start with the letter I
Valid | Invalid |
---|---|
interface IProps { className: "string"; } |
interface Props { className: "string"; } |
You'll first need to install ESLint:
npm i eslint --save-dev
install eslint-plugin-interface-prefix-control-svt
:
npm i -D eslint-plugin-interface-prefix-control-svt
Add interface-prefix-control-svt
to the plugins section of your .eslintrc
/.eslintrc.js
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["interface-prefix-control-svt"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"interface-prefix-control-svt/prefix-control": "warn" //or "error"
}
}