Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Error => TypeError #9390

Merged
merged 2 commits into from Oct 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ignored-paths.js
Expand Up @@ -184,7 +184,7 @@ class IgnoredPaths {
addPattern(this.ig.default, pattern);
});
} else {
throw new Error("Package.json eslintIgnore property requires an array of paths");
throw new TypeError("Package.json eslintIgnore property requires an array of paths");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/testers/rule-tester.js
Expand Up @@ -178,7 +178,7 @@ class RuleTester {
*/
static setDefaultConfig(config) {
if (typeof config !== "object") {
throw new Error("RuleTester.setDefaultConfig: config must be an object");
throw new TypeError("RuleTester.setDefaultConfig: config must be an object");
}
defaultConfig = config;

Expand Down Expand Up @@ -254,7 +254,7 @@ class RuleTester {
linter = this.linter;

if (lodash.isNil(test) || typeof test !== "object") {
throw new Error(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`);
throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`);
}

requiredScenarios.forEach(scenarioType => {
Expand Down
2 changes: 1 addition & 1 deletion lib/util/node-event-generator.js
Expand Up @@ -160,7 +160,7 @@ function tryParseSelector(rawSelector) {
return esquery.parse(rawSelector.replace(/:exit$/, ""));
} catch (err) {
if (typeof err.offset === "number") {
throw new Error(`Syntax error in selector "${rawSelector}" at position ${err.offset}: ${err.message}`);
throw new SyntaxError(`Syntax error in selector "${rawSelector}" at position ${err.offset}: ${err.message}`);
}
throw err;
}
Expand Down