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

prevent-abbreviations fixer bug on global variable #445

Closed
fisker opened this issue Nov 27, 2019 · 0 comments · Fixed by #603
Closed

prevent-abbreviations fixer bug on global variable #445

fisker opened this issue Nov 27, 2019 · 0 comments · Fixed by #603

Comments

@fisker
Copy link
Collaborator

fisker commented Nov 27, 2019

found this duration #444 , it's in our test

{
code: outdent`
function unicorn(unicorn) {
const {prop = {}} = unicorn;
return property;
}
`,
output: outdent`
function unicorn(unicorn) {
const {prop: property = {}} = unicorn;
return property;
}
`,
errors: createErrors()
},

but, property in first one could be a global variable.

--- FYI: I've checked this code bellow is right

const property = 'outer';
function unicorn(unicorn) {
	const {prop = {}} = unicorn;
	return property;
}

fix to

const property = 'outer';
function unicorn(unicorn) {
	const {prop: property_ = {}} = unicorn;
	return property;
}
@fisker fisker changed the title prevent-abbreviations fixer bug prevent-abbreviations fixer bug on global variable Nov 27, 2019
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.

1 participant