Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ESLint v8 by switching from ESLint's internal traverser to estraverse #1333

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

bmish
Copy link
Member

@bmish bmish commented Oct 12, 2021

Fixes #1332. A few rules did not work with ESLint v8 because it has been converted to ESM which disallows us from accessing ESLint's internal files including its traverser class.

Note: I had to rewrite one of the traversals in require-computed-property-dependencies because estraverse does not appear to support ClassProperty:

  ● require-computed-property-dependencies › invalid › 
        import { computed } from '@ember/object';
        class Test {
          @computed('firstName', {
            get() {
              return this.firstName + ' ' + this.lastName;
            },
            set(key, value) {}
          })
          fullName
        }
      

    Unknown node type ClassProperty.
    Occurred while linting <input>:2

      141 |   let importedInjectName;
      142 |
    > 143 |   Extraverse.traverse(node, {
          |              ^
      144 |     enter(child) {
      145 |       if (types.isImportDeclaration(child)) {
      146 |         if (child.source.value === 'ember') {

      at Controller.traverse (node_modules/estraverse/estraverse.js:465:31)

@bmish bmish added the Bug label Oct 12, 2021
@bmish bmish merged commit 0589719 into ember-cli:master Oct 12, 2021
@bmish bmish deleted the estraverse branch October 12, 2021 16:04
@mehulkar mehulkar mentioned this pull request Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work with ESLint v8
1 participant