Skip to content

Conversation

tgvrssanthosh
Copy link
Contributor

Summary

Added auto-fixer for no-array-prototype-extensions which replaces compact with filter.

Description

Recently, the proposal to deprecate array prototype extensions has been approved and got merged. The plan is to add autoFixers to replace ember array prototype extensions with the native array methods. In this PR, an auto fixer has been added which will replace the ember array method compact with the native array method filter.

Testing

Modified test case to check if the right output is generated after the fix.

@tgvrssanthosh
Copy link
Contributor Author

@bmish Can you please review?

Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, love this!

@bmish bmish merged commit 7efb2ab into ember-cli:master Oct 7, 2022
@tgvrssanthosh tgvrssanthosh deleted the autoFix-compact branch October 7, 2022 13:26
bmish added a commit that referenced this pull request Oct 7, 2022
…orn-44.0.0

* master:
  Add `compact` to `filter` autofixer for `no-array-prototype-extensions` rule (#1611)
  build(deps-dev): bump release-it from 15.4.2 to 15.5.0 (#1612)
  build(deps-dev): bump @babel/plugin-proposal-decorators from 7.19.1 to 7.19.3 (#1602)
  build(deps-dev): bump @typescript-eslint/parser from 5.38.0 to 5.38.1 (#1604)
  build(deps-dev): bump jsdom from 20.0.0 to 20.0.1 (#1607)
  build(deps-dev): bump sort-package-json from 1.57.0 to 2.0.0 (#1606)
  Add `filterBy` to `filter` autofixer for `no-array-prototype-extensions` rule (#1610)
  Add `any` to `some` autofixer for `no-array-prototype-extensions` rule (#1609)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants