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

no-deprecated: Cannot read property 'name' of undefined #3016

Closed
AriPerkkio opened this issue Jul 1, 2021 · 0 comments
Closed

no-deprecated: Cannot read property 'name' of undefined #3016

AriPerkkio opened this issue Jul 1, 2021 · 0 comments
Assignees

Comments

@AriPerkkio
Copy link
Contributor

Hello, no-deprecated rule seems to crash in certain cases. This issue was spotted by automated CI run - it is not blocking my development or anything.

AriPerkkio/eslint-remote-tester#189 (comment)

eslint-plugin-react@7.24.0
module.exports = {
    root: true,
    env: {
        es6: true,
        node: true,
    },
    parserOptions: {
        ecmaVersion: 2020,
        sourceType: "module",
        ecmaFeatures: {
            jsx: true,
        },
    },
    settings: {
        react: {
            version: "16.13.1",
        },
    plugins: ["react"],
    rules: {
        "react/no-deprecated": "error",
    },
};

Minimal repro:

import React from "react";

let { default: defaultReactExport, ...allReactExports } = React;
TypeError: Cannot read property 'name' of undefined
Occurred while linting <text>:116
    at /home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:214:79
    at Array.forEach (<anonymous>)
    at Object.VariableDeclarator (/home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:213:28)
Crash reports from real projects

Rule: no-deprecated

  • Message: Cannot read property 'name' of undefined Occurred while linting <text>:116
  • Path: reach/reach-ui/website/src/components/mdx-layout.js
  • Link
  114 |   }, []);
  115 |
> 116 |   let {
  117 |     // blerg es modules
  118 |     default: defaultReactExport,
  119 |     ...allReactExports
TypeError: Cannot read property 'name' of undefined
Occurred while linting <text>:116
    at /home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:214:79
    at Array.forEach (<anonymous>)
    at Object.VariableDeclarator (/home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:213:28)
    at updatedRuleInstructions.<computed> (/home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint-plugin-react/lib/util/Components.js:1016:45)
    at /home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint/lib/linter/node-event-generator.js:293:26)
    at NodeEventGenerator.applySelectors (/home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint/lib/linter/node-event-generator.js:322:22)
    at NodeEventGenerator.enterNode (/home/runner/work/eslint-remote-tester/eslint-remote-tester/ci/node_modules/eslint/lib/linter/node-event-generator.js:336:14)
ljharb added a commit to ljharb/eslint-plugin-react that referenced this issue Jul 2, 2021
ljharb added a commit to ljharb/eslint-plugin-react that referenced this issue Jul 2, 2021
@ljharb ljharb self-assigned this Jul 2, 2021
@ljharb ljharb closed this as completed in d0b5196 Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants