1.1.1 • Published 7 months ago

@palastri/eslint-plugin-react v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

eslint-plugin-react

Build Status

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:

One or more default rules from those plugins are overridden such as:

NameDescriptionRules
@typescript-eslint/array-typeRequire consistently using either T[] or Array<T> for arrays.["error", { default: "array-simple" }]
@typescript-eslint/member-orderingRequire a consistent member declaration order.["error", { default: { optionallyOrder: "required-first", order: "alphabetically" } }]
react/prop-typesDisallow missing props validation in a React component definition"off"

Changelog

Detailed changes for each release are documented in CHANGELOG.md