@samitouri / QOS-React-2 / commits / aecc48d877

Fix wording of warning-and-invariant-args linter

The wording for an incorrect number of arguments based on counting %s substitutions. The previous wording was backwards and a bit yoda-like leading to possible ambiguity.

Benjamin Woodruff committed Jun 4, 2015 at 10:44 UTC aecc48d8772bce610dd1dd50fc0258e29b2fdfa2
2 files changed +8 -6
eslint-rules/__tests__/warning-and-invariant-args-test.js
+6 -4
@@ -51,8 +51,9 @@ eslintTester.addRuleTest('eslint-rules/warning-and-invariant-args', {
51 code: "warning(true, 'expected %s, got %s');",
52 errors: [
53 {
54 - message: 'Expected 4 arguments in call to warning, but got 2 ' +
55 - 'based on the number of "%s" substitutions',
54 + message:
55 + 'Expected 4 arguments in call to warning based on the number of ' +
56 + '"%s" substitutions, but got 2',
57 },
58 ],
59 },
@@ -60,8 +61,9 @@ eslintTester.addRuleTest('eslint-rules/warning-and-invariant-args', {
61 code: "warning(true, 'foobar', 'junk argument');",
62 errors: [
63 {
63 - message: 'Expected 2 arguments in call to warning, but got 3 ' +
64 - 'based on the number of "%s" substitutions',
64 + message:
65 + 'Expected 2 arguments in call to warning based on the number of ' +
66 + '"%s" substitutions, but got 3',
67 },
68 ],
69 },
eslint-rules/warning-and-invariant-args.js
+2 -2
@@ -63,8 +63,8 @@ module.exports = function(context) {
63 if (node.arguments.length !== expectedNArgs) {
64 context.report(
65 node,
66 - 'Expected {{expectedNArgs}} arguments in call to {{name}}, but ' +
67 - 'got {{length}} based on the number of "%s" substitutions',
66 + 'Expected {{expectedNArgs}} arguments in call to {{name}} based on ' +
67 + 'the number of "%s" substitutions, but got {{length}}',
68 {
69 expectedNArgs: expectedNArgs,
70 name: node.callee.name,