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

Upgrade jsx-ast-utils to support Optional Chaining (tracking issue) #747

Closed
junoatwork opened this issue Oct 5, 2020 · 2 comments · Fixed by #754
Closed

Upgrade jsx-ast-utils to support Optional Chaining (tracking issue) #747

junoatwork opened this issue Oct 5, 2020 · 2 comments · Fixed by #754

Comments

@junoatwork
Copy link

junoatwork commented Oct 5, 2020

I opened an issue upstream on jsx-ast-utils: jsx-eslint/jsx-ast-utils#103 . The fix will have to occur there, and then this package should be updated to depend on (or at least accept in the semver range) the new version.

Symptom:

Began seeing The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately. in eslint output after upgrading.

ECMAscript Optional Chaining shipped, resulting in various changes to parsers and javascript/typescript tools to support it. Initially there were different, non-standard names for the AST nodes to represent it. Over this year, consensus has settled out, including in the parser that eslint uses, estree (see estree/estree#204 ).

Versions:

eslint@7.10.0
jsx-ast-utils@2.4.1 (via eslint-plugin-react@7.21.3, eslint-plugin-jsx-a11y@6.3.1)

Minimal test case

Component.jsx

import React from 'react';

export function Component() {
  const x = {};
  return (
    <div role="button" key={x.y?.z}>
      hi
    </div>
  );
}

.eslintrc

module.exports = {
  extends: [
    'plugin:react/recommended',
    'plugin:jsx-a11y/recommended'
  ],
  plugins: ['react', 'jsx-a11y'],
}

run

eslint ./Component.jsx
@junoatwork junoatwork changed the title Upgrade jsx-ast-utils to support (tracking issue) Upgrade jsx-ast-utils to support Optional Chaining (tracking issue) Oct 5, 2020
@ljharb
Copy link
Member

ljharb commented Oct 5, 2020

jsx-eslint/jsx-ast-utils#102 will fix this.

@jessebeach
Copy link
Collaborator

@junoatscroll this issue should be resolved in v6.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants