-
-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
Description
Nodes in an AST generally have duplicated range information: start and end properties from acorn, and range array properties. This rule would enforce the usage of one or the other.
// (this isn't a very good rule name, there should probably be a better one.)
/* eslint eslint-plugin/use-range-property: ["error", "always"] */
// Invalid:
foo.start;
foo.end;
// Valid:
foo.range[0];
foo.range[1];/* eslint eslint-plugin/use-range-property: ["error", "never"] */
// Invalid:
foo.range[0];
foo.range[1];
// Valid:
foo.start;
foo.end;