Skip to content

Commit

Permalink
Merge 3c886d1 into a23cf25
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiKillertO committed May 17, 2019
2 parents a23cf25 + 3c886d1 commit 480d6b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/config.js
Expand Up @@ -154,8 +154,7 @@ Config.prototype.initOptions = function(opts) {
Object.keys(opts).forEach(
function(name) {
if (!(name in this.options)) {
issues.push(new Issue("E054", [0, 0], { name: name }));
return;
throw new Error(`Rule "${name}" does not exist`);
}
var value = opts[name];
if (value !== false) {
Expand Down
7 changes: 4 additions & 3 deletions test/unit/linter.js
Expand Up @@ -43,9 +43,10 @@ describe("linter", function() {
}
]);

it("should output an issue when given a nonexistent option", async function() {
const issues = await linter.lint("f\nfff", { nonopt: 7 }, "nodefault");
expect(issues).to.have.length(1);
it("Should throw an error when given a nonexistent option", function() {
expect(() => linter.lint("f\nfff", { nonopt: 7 }, "nodefault"))
.to
.throw(`Rule "nonopt" does not exist`);
});

it("should return correct line and column numbers", async function() {
Expand Down

0 comments on commit 480d6b1

Please sign in to comment.