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-var rule creates invalid code #56

Open
laurent22 opened this issue Jul 29, 2019 · 0 comments
Open

no-unused-var rule creates invalid code #56

laurent22 opened this issue Jul 29, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@laurent22
Copy link

Tell us about your environment

  • eslint version: 6.1.0
  • eslint-plugin-autofix version: 0.0.8
  • eslint config:

It changes this:

static delete(id, options = null) {
	if (!id) throw new Error('Cannot delete object without an ID');
	options = this.modOptions(options);
	return this.db().exec('DELETE FROM ' + this.tableName() + ' WHERE id = ?', [id]);
}

to this:

static delete(id) {
	if (!id) throw new Error('Cannot delete object without an ID');
	options = this.modOptions(options);
	return this.db().exec('DELETE FROM ' + this.tableName() + ' WHERE id = ?', [id]);
}

Thus removing the needed variable "options".

@laurent22 laurent22 added the bug Something isn't working label Jul 29, 2019
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