3.3.3 • Published 8 months ago

eslint-plugin-react-perf v3.3.3

Weekly downloads
22,497
License
MIT
Repository
github
Last release
8 months ago

eslint-plugin-react-perf

Performance-minded React linting rules for ESLint (motivated by esamatti's post "React.js pure render performance anti-pattern").

Installation

$ npm i eslint-plugin-react-perf

Add plugins section and specify eslint-plugin-react-perf as a plugin.

{
  "plugins": ["react-perf"]
}

List of supported rules

Configuration

As of v3.3.0, each eslint-plugin-react-perf rule supports configuration to control whether native elements (lower case first letter React components) are ignored.

With this configuration, all native elements are ignored for this rule:

{
  "react-perf/jsx-no-new-object-as-prop": [
    "error",
    {
      "nativeAllowList": "all"
    }
  ]
}

With this configuration, the "style" attribute is ignored for native elements for this rule:

{
  "react-perf/jsx-no-new-object-as-prop": [
    "error",
    {
      "nativeAllowList": ["style"]
    }
  ]
}

Recommended

This plugin exports a recommended configuration that enforce React good practices.

Flat configuration

To enable this configuration add the following to your eslint.config.js:

import reactPerfPlugin from 'eslint-plugin-react-perf';

const config = [
  reactPerfPlugin.configs.flat.recommended
];

export default config;

eslintrc configuration

To enable this configuration use the extends property in your .eslintrc config file:

{
  "extends": ["plugin:react-perf/recommended"]
}

See ESLint documentation for more information about extending configuration files.

The rules enabled in this configuration are:

All

This plugin also exports an all configuration that includes every available rule.

Flat configuration

To enable this configuration add the following to your eslint.config.js:

import reactPerfPlugin from 'eslint-plugin-react-perf';

const config = [
  reactPerfPlugin.configs.flat.all
];

export default config;

eslintrc configuration

{
  "plugins": [
    "react-perf"
  ],
  "extends": ["plugin:react-perf/all"]
}

Test anti-patterns in runtime

Try out cvazac/test-ref-pattern.

License

eslint-plugin-react-perf is licensed under the MIT License.

@qualopreco/eslint-config@nataliafonseca/eslint-config@infinitebrahmanuniverse/nolb-eslint-plugin-r@everything-registry/sub-chunk-1614@babbel/eslint-config@7sne/eslint@fernando457829/eslint-config-react@hdmx/eslint-config@fxdigital/eslint-config-fxdigital@lottiefiles/eslint-plugin@lshay/eslint-config@lshay/eslint-config-flat@luizlahr-ui/eslint-config@manifest-ui/eslint-config@mozisan/eslint-config@mozisan/eslint-plugin@newsteam/eslint@newsteam/eslint-config@earlorg/eslint-config@e1011/eslint-config@modyqyw/fabric@inventi/eslint-config-tsx@inventi/eslint-ts-config@inventi/ts-eslint-config@kleros/kathari@ineedj/eslintrc@rdgomt/eslint-config@project44-manifest/vessel@radum/eslint-config@sberdevices/grail@podlipny/eslint-config@podlipny/eslint-rules@notum-cz/eslint-config-notum-react@sonnymiel/eslint-config@rogal/front-linterpatched@webpractik/eslint-config-react@trumpet/eslint-config-next@unified-tv/eslint-config-unified-tv@touchspot/eslint-plugin@topsoft4u/eslint-config@stimul/eslint-config-react@stimul/eslint-confign-react@stimul/eslint-react@sweetlikepete/eslint@tamland/eslinteslint-plugin-eigenspace-reacteslint-config-rocketeslint-config-vighnesh153eslint-config-joaopedrodcfeslint-config-niieanieslint-config-suiyobieslint-config-steeleslint-config-teccaeslint-config-brandingbrandeslint-config-atomikuieslint-config-eschadeslint-config-7sne-eslinteslint-config-besteslint-config-beemoeslint-config-current-thingeslint-config-hardcoreeslint-config-shinyeslint-config-moon@seyph.com/eslint-config
3.3.3

8 months ago

3.3.2

1 year ago

3.3.1

4 years ago

3.3.0

5 years ago

3.2.4

5 years ago

3.2.3

6 years ago

3.2.2

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago