Menu

My Plugin Has 14 Rules. Two of Them Found 60% of Everything.
📰

My Plugin Has 14 Rules. Two of Them Found 60% of Everything.

DEV Community: react·Ofri Peretz·18 days ago
#R1gGWFBL
#devtoreact#devto#dev#eslint#react
Reading 0:00
15s threshold

A plugin's README tells you it has fourteen rules. It does not tell you that on

your codebase, two of them will do almost all of the work and six will never

speak at all.

I measured mine. Fourteen rules in eslint-plugin-react-features that have no

counterpart in eslint-plugin-react , pointed at the 100 .tsx files of this

blog — a public tree, so the numbers below are yours to check rather than mine

to be believed on.

308 findings across 54 files.

The shape

rule findings files

react-no-inline-functions 113 38

react-render-optimization 71 27

hooks-exhaustive-deps 42 15

require-data-slot 35 14

no-unnecessary-rerenders 32 12

no-inline-style 9 1

no-raw-color-literal 4 2

no-arbitrary-token-class 2 2

six rules 0 0

Two rules are 59.7% of the total. Four are 84.7%. The mean is 22 findings per

rule, and the top rule is five times it.

That is not a rule list.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.