0.1.8 • Published 5 years ago

@fabriece/eslint-plugin-react-typescript v0.1.8

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

eslint-plugin-react-typescript

Enforce Interface when creating react components with typescript

Installation

$ npm i eslint @fabriece/eslint-plugin-react-typescript --save-dev
$ yarn add eslint @fabriece/eslint-plugin-react-typescript -D

Note: If you installed ESLint globally (using the -g flag) then you must also install @fabriece/eslint-plugin-react-typescript globally.

Usage

Add @fabriece/react-typescript to the plugins section of your .eslintrc configuration file.

{
  "plugins": ["@fabriece/react-typescript"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "@fabriece/react-typescript/require-props-suffix": "error",
    "@fabriece/react-typescript/require-component-props-interface": "error"
  }
}

Supported Rules

NameDescription
@fabriece/react-typescript/require-props-suffixRequire a props interface to be provided to a react component
@fabriece/react-typescript/require-component-props-interfaceRequire a props interface to have a Props suffix