eslint-plugin
eslint-plugin copied to clipboard
no-unused-var rule creates invalid code
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".