Registry / testing / tslint-react-perf

tslint-react-perf

JSON →
library0.3.1jsnpmunverified

Supplemental TSLint rules for React performance best practices. Version 0.3.1 (latest). Inactive project; author recommends using React hooks (useMemo, useCallback) instead. Provides rules to prevent binding, lambdas, array/object literals in JSX props, enforce pure component patterns. Requires TypeScript and TSLint. No releases or updates since 2019.

npm install tslint-react-perf
INSTALL
IMPORT
SIG · TSLINT-REACT-PERF
T
tslint-react-perf
testingjavascriptv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rules
{ "extends": ["tslint-react-perf"] }
import { rules } from 'tslint-react-perf'
This is a TSLint rules package; you use it via configuration, not import. Extend in tslint.json.
jsx-no-bind-props
{ "rules": { "jsx-no-bind-props": true } }
import { jsx-no-bind-props } from 'tslint-react-perf'
Rules are enabled via tslint.json configuration, not imported.
react-pure-components-have-simple-attributes
{ "rules": { "react-pure-components-have-simple-attributes": true } }
const rule = require('tslint-react-perf')
Common mistake: trying to require the package directly instead of configuring via extends.

Enable all react-perf rules via tslint.json configuration inheritance and rule settings.

{ "extends": ["tslint:latest", "tslint-react", "tslint-react-perf"], "rules": { "jsx-no-lambda": true, "jsx-no-bind": true, "jsx-no-bind-props": true, "jsx-no-lambda-props": true, "jsx-no-array-literal-props": true, "jsx-no-object-literal-props": true, "react-component-classes-should-implement-scu": true, "react-pure-components-have-simple-attributes": true } }
Debug
Known issues
deprecatedProject is abandoned; author recommends using React hooks (useMemo, useCallback) instead.
fix
Migrate to eslint-plugin-react-hooks or rely on hooks for performance optimization.
affects: >=0.0.0
gotchatslint-react is also deprecated; TSLint is deprecated in favor of ESLint.
fix
Switch to ESLint with @typescript-eslint/parser and eslint-plugin-react.
affects: >=0.1.0
gotchaRules only work with TSLint; they do not work with ESLint or other linters.
fix
Do not attempt to use with ESLint; only applicable in TSLint-based projects.
affects: >=0.3.1
Errors
Common errors & fixes
Cannot find module 'tslint-react-perf'
Package not installed or not in node_modules.
fix
Run 'npm install tslint-react-perf --save-dev' or 'yarn add tslint-react-perf --dev'.
Could not find rule: 'jsx-no-bind-props'
Rule not enabled in tslint.json configuration or package not extended properly.
fix
Add 'tslint-react-perf' to your extends array in tslint.json.
Upgrade
Version history
0.3.1latest on npm
Audit
Dependencies
tslintrequiredpeer dependency; required to load and run rules
typescriptrequiredpeer dependency; required for TSLint to parse TypeScript code
Agent activity
8 hits · last 30 days
node
8
Resources
tslint-react-perf — npm install tslint-react-perf · libregistry