diff --git a/.changeset/perfect-cycles-fry.md b/.changeset/perfect-cycles-fry.md new file mode 100644 index 00000000..4affaead --- /dev/null +++ b/.changeset/perfect-cycles-fry.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/eslint-plugin": patch +--- + +Update error message for `aphrodite-add-style-variable-name` rule diff --git a/packages/eslint-plugin-khan/src/rules/aphrodite-add-style-variable-name.ts b/packages/eslint-plugin-khan/src/rules/aphrodite-add-style-variable-name.ts index 10afefad..25f6545b 100644 --- a/packages/eslint-plugin-khan/src/rules/aphrodite-add-style-variable-name.ts +++ b/packages/eslint-plugin-khan/src/rules/aphrodite-add-style-variable-name.ts @@ -10,7 +10,7 @@ const createRule = ESLintUtils.RuleCreator( type Options = []; type MessageIds = "errorString"; -const message = `Variable name "{{ variableName }}" does not match tag name "{{ tagName }}". Variable name should be "{{ expectedName }}"`; +const message = `Variable name "{{ variableName }}" does not match the expected naming convention. Expected: "{{ expectedName }}"`; /** * Converts a string into PascalCase. @@ -99,7 +99,6 @@ export default createRule({ messageId: "errorString", data: { variableName, - tagName, expectedName, }, }); diff --git a/packages/eslint-plugin-khan/test/rules/aphrodite-add-style-variable-name.test.ts b/packages/eslint-plugin-khan/test/rules/aphrodite-add-style-variable-name.test.ts index 721bf41a..76168827 100644 --- a/packages/eslint-plugin-khan/test/rules/aphrodite-add-style-variable-name.test.ts +++ b/packages/eslint-plugin-khan/test/rules/aphrodite-add-style-variable-name.test.ts @@ -80,7 +80,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "foo", - tagName: "div", expectedName: "StyledDiv", }, }, @@ -93,7 +92,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "div", - tagName: "div", expectedName: "StyledDiv", }, }, @@ -106,7 +104,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "span", - tagName: "span", expectedName: "StyledSpan", }, }, @@ -119,7 +116,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "p", - tagName: "p", expectedName: "StyledP", }, }, @@ -132,7 +128,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "styledDiv", - tagName: "div", expectedName: "StyledDiv", }, }, @@ -145,7 +140,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "FooBar", - tagName: "foo-bar", expectedName: "StyledFooBar", }, }, @@ -158,7 +152,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "FooBar", - tagName: "foo_bar", expectedName: "StyledFooBar", }, }, @@ -171,7 +164,6 @@ ruleTester.run(ruleName, rule, { messageId: "errorString", data: { variableName: "FooBar", - tagName: "FooBar", expectedName: "StyledFooBar", }, },