Skip to content

Commit

Permalink
Improve error message for no-new-array (#2459)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Sep 29, 2024
1 parent 6a043c2 commit e39ae89
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion rules/no-new-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const MESSAGE_ID_LENGTH = 'array-length';
const MESSAGE_ID_ONLY_ELEMENT = 'only-element';
const MESSAGE_ID_SPREAD = 'spread';
const messages = {
[MESSAGE_ID_ERROR]: 'Do not use `new Array()`.',
[MESSAGE_ID_ERROR]: '`new Array()` is unclear in intent; use either `[x]` or `Array.from({length: x})`',
[MESSAGE_ID_LENGTH]: 'The argument is the length of array.',
[MESSAGE_ID_ONLY_ELEMENT]: 'The argument is the only element of array.',
[MESSAGE_ID_SPREAD]: 'Spread the argument.',
Expand Down
Loading

0 comments on commit e39ae89

Please sign in to comment.