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-unused-vars crash with spread operator and babel-eslint #48

Closed
dmnd opened this issue Jul 8, 2019 · 2 comments
Closed

no-unused-vars crash with spread operator and babel-eslint #48

dmnd opened this issue Jul 8, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@dmnd
Copy link
Contributor

dmnd commented Jul 8, 2019

command

./node_modules/.bin/eslint file.js

file contents

function f(...a) {}

stacktrace

TypeError: Cannot read property 'length' of undefined
Occurred while linting /Users/dmnd/github/flexport/test.js:1
    at Object.problem.fix.fixer [as fix] (/Users/dmnd/github/flexport/node_modules/eslint-plugin-autofix/lib/rules/no-unused-vars.js:92:42)
    at normalizeFixes (/Users/dmnd/github/flexport/node_modules/eslint/lib/util/report-translator.js:176:28)
    at args (/Users/dmnd/github/flexport/node_modules/eslint/lib/util/report-translator.js:278:18)
    at Object.report (/Users/dmnd/github/flexport/node_modules/eslint/lib/linter.js:721:41)
    at Object.value [as report] (/Users/dmnd/github/flexport/node_modules/eslint-rule-composer/lib/rule-composer.js:175:29)
    at Program:exit (/Users/dmnd/github/flexport/node_modules/eslint/lib/rules/no-unused-vars.js:643:33)
    at listeners.(anonymous function).forEach.listener (/Users/dmnd/github/flexport/node_modules/eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/dmnd/github/flexport/node_modules/eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/dmnd/github/flexport/node_modules/eslint/lib/util/node-event-generator.js:251:26)

.eslintrc.yaml

plugins:
  - autofix

parser: "babel-eslint"

rules:
  autofix/no-unused-vars: error

versions

eslint 5.16.0
babel-eslint 10.0.1
eslint-plugin-autofix 0.0.7

@aladdin-add aladdin-add added the bug Something isn't working label Jul 8, 2019
@aladdin-add
Copy link
Owner

fixed in v0.0.8 🎉

@dmnd
Copy link
Contributor Author

dmnd commented Jul 10, 2019

Nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants