Skip to content

Commit

Permalink
fix: incorrectly-used messageId placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Jul 5, 2022
1 parent f3878c1 commit 546345f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/rules/no-hooks-from-ancestor-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
},
fixable: null,
messages: {
"noHooksFromAncestorModules": "Do not call {{usedHooksIdentifierName}}.{{hookName}} from an ancestor module."
"noHooksFromAncestorModules": "Do not call {{usedHooksIdentifierName}}.{{invokedMethodName}} from an ancestor module."
},
schema: []
},
Expand Down
5 changes: 1 addition & 4 deletions lib/rules/no-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ module.exports = {
if (utils.isOnly(node.callee)) {
context.report({
node: node,
messageId: "noQUnitOnly",
data: {
callee: node.callee.name
}
messageId: "noQUnitOnly"
});
}
}
Expand Down
5 changes: 1 addition & 4 deletions lib/rules/no-skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ module.exports = {
if (utils.isSkip(node.callee)) {
context.report({
node: node,
messageId: "noQUnitSkip",
data: {
callee: node.callee.name
}
messageId: "noQUnitSkip"
});
}
}
Expand Down
19 changes: 5 additions & 14 deletions tests/lib/rules/no-skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ const rule = require("../../../lib/rules/no-skip"),
// Tests
//------------------------------------------------------------------------------

function createError(callee) {
return {
messageId: "noQUnitSkip",
data: {
callee
}
};
}

const ruleTester = new RuleTester();

ruleTester.run("no-skip", rule, {
Expand All @@ -37,23 +28,23 @@ ruleTester.run("no-skip", rule, {
invalid: [
{
code: "QUnit.module.skip('Name', function() { });",
errors: [createError("QUnit.module.skip")]
errors: [{ messageId: "noQUnitSkip" }]
},
{
code: "QUnit.skip('Name', function() { });",
errors: [createError("QUnit.skip")]
errors: [{ messageId: "noQUnitSkip" }]
},
{
code: "module.skip('Name', function() { });",
errors: [createError("module.skip")]
errors: [{ messageId: "noQUnitSkip" }]
},
{
code: "skip('Name', function() { });",
errors: [createError("skip")]
errors: [{ messageId: "noQUnitSkip" }]
},
{
code: "test.skip('Name', function() { });",
errors: [createError("test.skip")]
errors: [{ messageId: "noQUnitSkip" }]
}
]
});

0 comments on commit 546345f

Please sign in to comment.