@palastri/eslint-plugin-react v1.1.1
eslint-plugin-react
Installation
yarn add --dev eslint @palastri/eslint-plugin-react
Usage
Add @palastri/eslint-plugin-react
to the plugins section of your .eslintrc
configuration file. You
can omit the eslint-plugin-
prefix:
{
"extends": ["@palastri/react/recommended"],
"plugins": ["@palastri/react"]
}
Shareable configurations
Recommended
This plugin exports a recommended configuration that enforces good testing practices.
To enable this configuration, please use the extends
property in the .eslintrc
config file:
{
"extends": ["plugin:@palastri/react/recommended"]
}
Stylistic
This plugin also exports a configuration named stylistic
, which adds some stylistic rules. The rules considered to be best practice for modern TypeScript codebase, but that do not impact program logic.
To enable this configuration, please use the extends
property in the .eslintrc
config file:
{
"extends": ["plugin:@palastri/react/stylistic"]
}
Next.js
This plugin is ready to integrate with Next.js. Instead of using recommended
, it must use next
for the configuration. To enable this configuration, please use the extends
property in the .eslintrc
config file:
{
"extends": ["plugin:@palastri/react/next", "next"]
}
Recommended plugin ruleset
This plugin includes the following plugins:
- @typescript-eslint/eslint-plugin
- eslint-config-prettier
- eslint-plugin-import
- eslint-plugin-jsx-a11y
- eslint-plugin-prettier
- eslint-plugin-react
- eslint-plugin-react-hooks
One or more default rules from those plugins are overridden such as:
Name | Description | Rules |
---|---|---|
@typescript-eslint/array-type | Require consistently using either T[] or Array<T> for arrays. | ["error", { default: "array-simple" }] |
@typescript-eslint/member-ordering | Require a consistent member declaration order. | ["error", { default: { optionallyOrder: "required-first", order: "alphabetically" } }] |
react/prop-types | Disallow missing props validation in a React component definition | "off" |
Changelog
Detailed changes for each release are documented in CHANGELOG.md