Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed May 1, 2020
1 parent ed4c400 commit e91c078
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@babel/eslint-plugin-internal",
"name": "@babel/eslint-plugin-development-internal",
"version": "0.0.0",
"description": "The Babel Team's ESLint custom rules plugin. Since it's internal, it might not respect semver.",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/babel/babel.git",
"directory": "eslint/babel-eslint-plugin-internal"
"directory": "eslint/babel-eslint-plugin-development-internal"
},
"keywords": [
"babel",
Expand All @@ -24,7 +24,7 @@
"bugs": {
"url": "https://github.com/babel/babel/issues"
},
"homepage": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-plugin-internal",
"homepage": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-plugin-development-internal",
"peerDependencies": {
"@babel/eslint-parser": "0.0.0",
"eslint": ">=6.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ export default {
}
}
},
"ThrowStatement[argument.type='CallExpression'] [callee.type='MemberExpression']"(
node,
) {
"ThrowStatement > CallExpression[callee.type='MemberExpression']"(node) {
if (
node.callee.object?.type !== "ThisExpression" ||
node.callee.property?.name !== "raise"
node.callee.object.type !== "ThisExpression" ||
node.callee.property.name !== "raise"
) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ ruleTester.run("dry-error-messages", rule, {
"this.raise(() => { throw new Error('Uh oh') });",
"throw new Error('Uh oh')",
"throw this.createError('Uh oh')",
"throw this.error",
"throw this.raise",
"throw obj.error",
"throw obj.raise",
{
filename: FILENAME,
code:
Expand Down

0 comments on commit e91c078

Please sign in to comment.