Skip to content

Commit f15f4f9

Browse files
authored
Explain what the autofixer covers in no-array-prototype-extensions rule doc (#1639)
1 parent 23728d8 commit f15f4f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/rules/no-array-prototype-extensions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Some alternatives:
1212
- Use lodash helper functions instead of `.uniqBy()`, `.sortBy()` in Ember modules
1313
- Use immutable update style with `@tracked` properties or `TrackedArray` from `tracked-built-ins` instead of `.pushObject`, `removeObject` in Ember modules
1414

15-
Note: this rule is not in the `recommended` configuration because of the risk of false positives.
16-
1715
## Rule Details
1816

1917
This rule will disallow method calls that match any of the forbidden `Array` prototype extension method names.
2018

21-
Note that to reduce false positives, the rule ignores some common known-non-array classes/objects whose functions overlap with the array extension function names:
19+
The rule autofixes all [EmberArray](https://api.emberjs.com/ember/release/classes/EmberArray) functions. It does not autofix the mutation functions from [MutableArray](https://api.emberjs.com/ember/release/classes/MutableArray) or `firstObject` / `lastObject`, as these involve reactivity/observability and may require a more involved change to convert to `@tracked` or `TrackedArray`.
20+
21+
To reduce false positives, the rule ignores some common known-non-array classes/objects whose functions overlap with the array extension function names:
2222

2323
- `Set.clear()`
2424
- `Map.clear()`
@@ -27,6 +27,8 @@ Note that to reduce false positives, the rule ignores some common known-non-arra
2727

2828
If you run into additional false positives, please file a bug or submit a PR to add it to the rule's hardcoded ignore list.
2929

30+
This rule is not in the `recommended` configuration because of the risk of false positives.
31+
3032
## Examples
3133

3234
Examples of **incorrect** code for this rule:

0 commit comments

Comments
 (0)