Closed constgen closed 4 years ago
Is this rule forbids using the name of a different class in another, e.g. let someObject = 1
or let anyArray = function() {}
?
No. It disallows using this redundant words for any type of value
Something similar from TypeScript world https://palantir.github.io/tslint/rules/variable-name/
How hard is it prohibiting native class names? For example, we got Map
and
Set
prohibited, but will be and
prohibited too?
Here is my forbidden classes list:
NaN
undefined
null
Object
Function
Boolean
Symbol
Error
Number
Date
String
RegExp
Array
Map
Set
Promise
Generator
Here is source
@constgen What would you say about my last comment with prohibited classes in identifiers? Is it looking ok, or I'm going the wrong way?
@PyTechMike We definitely need to exclude Error
, Date
, RegExp
Forbid class names in variables. eg
varNameArray
,varNameObject
. Variables should be namedvarNames
if it is a collection of items.