-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginhas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
I would like to enforce that variables and properties with a boolean use the prefix is, has, can, did, and will. For example: .visible → .isVisible.
I often see .visible, .open, etc, in code, and it's not clear whether they are booleans, contain something visible/open, or whether they contain a function that makes something visible or opens something.
Fail
const visible = true;
const rainbow = false;Pass
const isVisible = true;
const hasRainbow = false;j-f1, otofu-square, Daniel15, ldrick, kripod and 15 more
Metadata
Metadata
Assignees
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginhas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin