aladdin-add / eslint-plugin

autofix some errors reported by eslint rules.
107 stars 10 forks source link

no-unused-var rule creates invalid code #56

Open laurent22 opened 5 years ago

laurent22 commented 5 years ago

Tell us about your environment

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".