Skip to content
Permalink
Browse files

Upgrade: @eslint/eslintrc to fix rule schema validation (fixes #13793) (

#13794)

* Chore: Repro missing built-in rule validation (refs #13793)

The bulk of our tests for rule schemas are isolated unit tests of
`ConfigValidator`. This is a single test to be sure we actually run rule
schema validation end-to-end and prevent cases like #13793.

After I run a patch release of `@eslint/eslintrc`, I'll push a second
commit on this branch to bump the dependency version and fix the test.

* Upgrade: @eslint/eslintrc for rule validation (fixes #13793)
  • Loading branch information
btmills committed Oct 27, 2020
1 parent aeef485 commit 08f33e8b9a353c3183be6f937785db7a30fb90eb
Showing with 21 additions and 1 deletion.
  1. +1 −1 package.json
  2. +20 −0 tests/lib/eslint/eslint.js
@@ -47,7 +47,7 @@
"bugs": "https://github.com/eslint/eslint/issues/",
"dependencies": {
"@babel/code-frame": "^7.0.0",
"@eslint/eslintrc": "^0.2.0",
"@eslint/eslintrc": "^0.2.1",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
"cross-spawn": "^7.0.2",
@@ -3919,6 +3919,26 @@ describe("ESLint", () => {

await assert.rejects(() => eslint.calculateConfigForFile(null), /'filePath' must be a non-empty string/u);
});

// https://github.com/eslint/eslint/issues/13793
it("should throw with an invalid built-in rule config", async () => {
const options = {
baseConfig: {
rules: {
"no-alert": ["error", {
thisDoesNotExist: true
}]
}
}
};
const engine = new ESLint(options);
const filePath = getFixturePath("single-quoted.js");

await assert.rejects(
() => engine.calculateConfigForFile(filePath),
/Configuration for rule "no-alert" is invalid:/u
);
});
});

describe("isPathIgnored", () => {

0 comments on commit 08f33e8

Please sign in to comment.
You can’t perform that action at this time.