eslint-plugin icon indicating copy to clipboard operation
eslint-plugin copied to clipboard

no-unused-var rule creates invalid code

Open laurent22 opened this issue 6 years ago • 0 comments

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 avatar Jul 29 '19 18:07 laurent22