From d5178be7683123e9ec1a108cc09a761ca7acffe0 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 15 Aug 2023 13:10:10 -0700 Subject: [PATCH] [Tests] add disambiguators to tests with multiple errors --- tests/lib/rules/jsx-equals-spacing.js | 32 ++++---- tests/lib/rules/jsx-no-useless-fragment.js | 49 +++++++---- tests/lib/rules/no-deprecated.js | 32 +++++++- tests/lib/rules/no-invalid-html-attribute.js | 85 ++++++++++++++++++++ tests/lib/rules/no-typos.js | 27 +++++++ 5 files changed, 188 insertions(+), 37 deletions(-) diff --git a/tests/lib/rules/jsx-equals-spacing.js b/tests/lib/rules/jsx-equals-spacing.js index 78c97898c6..ec3fec93d0 100644 --- a/tests/lib/rules/jsx-equals-spacing.js +++ b/tests/lib/rules/jsx-equals-spacing.js @@ -91,8 +91,8 @@ ruleTester.run('jsx-equals-spacing', rule, { code: '', output: '', errors: [ - { messageId: 'noSpaceBefore' }, - { messageId: 'noSpaceAfter' }, + { messageId: 'noSpaceBefore', type: 'JSXAttribute' }, + { messageId: 'noSpaceAfter', type: 'JSXAttribute' }, ], }, { @@ -100,30 +100,30 @@ ruleTester.run('jsx-equals-spacing', rule, { output: '', options: ['never'], errors: [ - { messageId: 'noSpaceBefore' }, - { messageId: 'noSpaceAfter' }, + { messageId: 'noSpaceBefore', type: 'JSXAttribute' }, + { messageId: 'noSpaceAfter', type: 'JSXAttribute' }, ], }, { code: '', output: '', options: ['never'], - errors: [{ messageId: 'noSpaceBefore' }], + errors: [{ messageId: 'noSpaceBefore', type: 'JSXAttribute' }], }, { code: '', output: '', options: ['never'], - errors: [{ messageId: 'noSpaceAfter' }], + errors: [{ messageId: 'noSpaceAfter', type: 'JSXAttribute' }], }, { code: '', output: '', options: ['never'], errors: [ - { messageId: 'noSpaceAfter' }, - { messageId: 'noSpaceBefore' }, - { messageId: 'noSpaceAfter' }, + { messageId: 'noSpaceAfter', type: 'JSXAttribute' }, + { messageId: 'noSpaceBefore', type: 'JSXAttribute' }, + { messageId: 'noSpaceAfter', type: 'JSXAttribute' }, ], }, { @@ -131,30 +131,30 @@ ruleTester.run('jsx-equals-spacing', rule, { output: '', options: ['always'], errors: [ - { messageId: 'needSpaceBefore' }, - { messageId: 'needSpaceAfter' }, + { messageId: 'needSpaceBefore', type: 'JSXAttribute' }, + { messageId: 'needSpaceAfter', type: 'JSXAttribute' }, ], }, { code: '', output: '', options: ['always'], - errors: [{ messageId: 'needSpaceAfter' }], + errors: [{ messageId: 'needSpaceAfter', type: 'JSXAttribute' }], }, { code: '', output: '', options: ['always'], - errors: [{ messageId: 'needSpaceBefore' }], + errors: [{ messageId: 'needSpaceBefore', type: 'JSXAttribute' }], }, { code: '', output: '', options: ['always'], errors: [ - { messageId: 'needSpaceBefore' }, - { messageId: 'needSpaceAfter' }, - { messageId: 'needSpaceAfter' }, + { messageId: 'needSpaceBefore', type: 'JSXAttribute' }, + { messageId: 'needSpaceAfter', type: 'JSXAttribute' }, + { messageId: 'needSpaceAfter', type: 'JSXAttribute' }, ], }, ]), diff --git a/tests/lib/rules/jsx-no-useless-fragment.js b/tests/lib/rules/jsx-no-useless-fragment.js index d9a5e15c31..d794d2d157 100644 --- a/tests/lib/rules/jsx-no-useless-fragment.js +++ b/tests/lib/rules/jsx-no-useless-fragment.js @@ -102,7 +102,10 @@ ruleTester.run('jsx-no-useless-fragment', rule, { { code: '

moo<>foo

', output: '

moofoo

', - errors: [{ messageId: 'NeedsMoreChildren' }, { messageId: 'ChildOfHtmlElement' }], + errors: [ + { messageId: 'NeedsMoreChildren', type: 'JSXFragment' }, + { messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }, + ], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { @@ -114,13 +117,16 @@ ruleTester.run('jsx-no-useless-fragment', rule, { { code: '

<>{meow}

', output: '

{meow}

', - errors: [{ messageId: 'NeedsMoreChildren' }, { messageId: 'ChildOfHtmlElement' }], + errors: [ + { messageId: 'NeedsMoreChildren', type: 'JSXFragment' }, + { messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }, + ], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { code: '<>
', output: '
', - errors: [{ messageId: 'NeedsMoreChildren' }], + errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { @@ -132,12 +138,12 @@ ruleTester.run('jsx-no-useless-fragment', rule, { output: `
`, - errors: [{ messageId: 'NeedsMoreChildren' }], + errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { code: '', - errors: [{ messageId: 'NeedsMoreChildren' }], + errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXElement' }], }, { code: ` @@ -148,7 +154,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, { output: ` `, - errors: [{ messageId: 'NeedsMoreChildren' }], + errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXElement' }], }, { code: ` @@ -162,31 +168,34 @@ ruleTester.run('jsx-no-useless-fragment', rule, { fragment: 'SomeFragment', }, }, - errors: [{ messageId: 'NeedsMoreChildren' }], + errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXElement' }], }, { // Not safe to fix this case because `Eeee` might require child be ReactElement code: '<>foo', output: null, - errors: [{ messageId: 'NeedsMoreChildren' }], + errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { code: '
<>foo
', output: '
foo
', - errors: [{ messageId: 'NeedsMoreChildren' }, { messageId: 'ChildOfHtmlElement' }], + errors: [ + { messageId: 'NeedsMoreChildren', type: 'JSXFragment' }, + { messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }, + ], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { code: '
<>{"a"}{"b"}
', output: '
{"a"}{"b"}
', - errors: [{ messageId: 'ChildOfHtmlElement' }], + errors: [{ messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old and next test case }, { code: '
<>{"a"}{"b"}
', output: '
<>{"a"}{"b"}
', - errors: [{ messageId: 'ChildOfHtmlElement' }], + errors: [{ messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }], features: ['fragment', 'ts-old', 'no-ts-new', 'no-babel', 'no-default'], }, { @@ -202,13 +211,13 @@ ruleTester.run('jsx-no-useless-fragment', rule, { {"a"}{"b"} `, - errors: [{ messageId: 'ChildOfHtmlElement' }], + errors: [{ messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { code: '
{"a"}{"b"}
', output: '
{"a"}{"b"}
', - errors: [{ messageId: 'ChildOfHtmlElement' }], + errors: [{ messageId: 'ChildOfHtmlElement', type: 'JSXElement' }], }, { // whitepace tricky case @@ -226,13 +235,16 @@ ruleTester.run('jsx-no-useless-fragment', rule, { git hub `, - errors: [{ messageId: 'ChildOfHtmlElement' }, { messageId: 'ChildOfHtmlElement' }], + errors: [ + { messageId: 'ChildOfHtmlElement', type: 'JSXFragment', line: 3 }, + { messageId: 'ChildOfHtmlElement', type: 'JSXFragment', line: 7 }, + ], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { code: '
a <>{""}{""} a
', output: '
a {""}{""} a
', - errors: [{ messageId: 'ChildOfHtmlElement' }], + errors: [{ messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }], features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, { @@ -250,13 +262,16 @@ ruleTester.run('jsx-no-useless-fragment', rule, { ); `, - errors: [{ messageId: 'NeedsMoreChildren' }, { messageId: 'ChildOfHtmlElement' }], + errors: [ + { messageId: 'NeedsMoreChildren', type: 'JSXElement', line: 4 }, + { messageId: 'ChildOfHtmlElement', type: 'JSXElement', line: 4 }, + ], }, // Ensure allowExpressions still catches expected violations { code: '<>{moo}', options: [{ allowExpressions: true }], - errors: [{ messageId: 'NeedsMoreChildren' }], + errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }], output: '{moo}', features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old }, diff --git a/tests/lib/rules/no-deprecated.js b/tests/lib/rules/no-deprecated.js index cf91991cec..dc93e99012 100644 --- a/tests/lib/rules/no-deprecated.js +++ b/tests/lib/rules/no-deprecated.js @@ -231,8 +231,20 @@ ruleTester.run('no-deprecated', rule, { { code: 'var {createClass, PropTypes} = require(\'react\');', errors: [ - errorMessage('React.createClass', '15.5.0', 'the npm module create-react-class'), - errorMessage('React.PropTypes', '15.5.0', 'the npm module prop-types'), + errorMessage( + 'React.createClass', + '15.5.0', + 'the npm module create-react-class', + null, + { type: 'VariableDeclarator', column: 5 } + ), + errorMessage( + 'React.PropTypes', + '15.5.0', + 'the npm module prop-types', + null, + { type: 'VariableDeclarator', column: 5 } + ), ], }, { @@ -252,8 +264,20 @@ ruleTester.run('no-deprecated', rule, { const {createClass, PropTypes} = React; `, errors: [ - errorMessage('React.createClass', '15.5.0', 'the npm module create-react-class'), - errorMessage('React.PropTypes', '15.5.0', 'the npm module prop-types'), + errorMessage( + 'React.createClass', + '15.5.0', + 'the npm module create-react-class', + null, + { type: 'VariableDeclarator', line: 3, column: 13 } + ), + errorMessage( + 'React.PropTypes', + '15.5.0', + 'the npm module prop-types', + null, + { type: 'VariableDeclarator', line: 3, column: 13 } + ), ], }, { diff --git a/tests/lib/rules/no-invalid-html-attribute.js b/tests/lib/rules/no-invalid-html-attribute.js index cde601ba31..03e000bd66 100644 --- a/tests/lib/rules/no-invalid-html-attribute.js +++ b/tests/lib/rules/no-invalid-html-attribute.js @@ -250,6 +250,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -268,6 +269,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: 'React.createElement("a", { rel: "" })', }, ], + type: 'Literal', }, ], }, @@ -286,6 +288,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: 'React.createElement("a", { rel: [""] })', }, ], + type: 'Literal', }, ], }, @@ -304,6 +307,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -322,6 +326,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: 'React.createElement("a", { rel: "" })', }, ], + type: 'Literal', }, ], }, @@ -340,6 +345,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: 'React.createElement("a", { rel: [""] })', }, ], + type: 'Literal', }, ], }, @@ -358,6 +364,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -376,6 +383,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: 'React.createElement("a", { rel: "" })', }, ], + type: 'Literal', }, ], }, @@ -394,6 +402,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: 'React.createElement("a", { rel: [""] })', }, ], + type: 'Literal', }, ], }, @@ -412,6 +421,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'JSXAttribute', }, ], }, @@ -430,6 +440,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { // output: 'React.createElement("html", { })', // }, // ], + type: 'CallExpression', }, ], }, @@ -445,6 +456,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'JSXAttribute', }, ], }, @@ -463,6 +475,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { // output: 'React.createElement("a", { })', // }, // ], + type: 'Literal', }, ], }, @@ -472,6 +485,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { { messageId: 'noMethod', data: { attributeName: 'rel' }, + type: 'Property', }, ], }, @@ -490,6 +504,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'JSXAttribute', }, ], }, @@ -505,6 +520,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -520,6 +536,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -535,6 +552,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -550,6 +568,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'JSXAttribute', }, ], }, @@ -565,6 +584,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'JSXAttribute', }, ], }, @@ -583,6 +603,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -598,6 +619,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -613,6 +635,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -628,6 +651,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -646,6 +670,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -664,6 +689,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: 'React.createElement("a", { rel: ["noreferrer", "noopener", "" ] })', }, ], + type: 'Literal', }, ], }, @@ -682,6 +708,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -700,6 +727,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, { messageId: 'neverValid', @@ -713,6 +741,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, { messageId: 'spaceDelimited', @@ -732,6 +761,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -747,6 +777,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -765,6 +796,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, { messageId: 'spaceDelimited', @@ -787,6 +819,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -802,6 +835,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -821,6 +855,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -840,6 +875,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -859,6 +895,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -871,6 +908,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { reportingValue: 'shortcut', missingValue: 'icon', }, + type: 'Literal', }, ], }, @@ -889,6 +927,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, { messageId: 'notPaired', @@ -897,6 +936,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { secondValue: 'foo', missingValue: 'icon', }, + type: 'Literal', }, ], }, @@ -912,6 +952,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -930,6 +971,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, { messageId: 'notAlone', @@ -947,6 +989,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -966,6 +1009,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -985,6 +1029,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1004,6 +1049,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1023,6 +1069,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1042,6 +1089,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1061,6 +1109,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1080,6 +1129,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1099,6 +1149,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1118,6 +1169,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1137,6 +1189,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1156,6 +1209,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1175,6 +1229,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1194,6 +1249,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1213,6 +1269,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1232,6 +1289,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1251,6 +1309,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1270,6 +1329,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1289,6 +1349,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1308,6 +1369,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1327,6 +1389,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1346,6 +1409,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1365,6 +1429,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1384,6 +1449,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1402,6 +1468,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1421,6 +1488,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1440,6 +1508,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '', }, ], + type: 'Literal', }, ], }, @@ -1459,6 +1528,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1478,6 +1548,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1497,6 +1568,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1516,6 +1588,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1535,6 +1608,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1554,6 +1628,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1573,6 +1648,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1592,6 +1668,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1611,6 +1688,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1630,6 +1708,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1649,6 +1728,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1668,6 +1748,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1687,6 +1768,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1706,6 +1788,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1725,6 +1808,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, @@ -1744,6 +1828,7 @@ ruleTester.run('no-invalid-html-attribute', rule, { output: '
', }, ], + type: 'Literal', }, ], }, diff --git a/tests/lib/rules/no-typos.js b/tests/lib/rules/no-typos.js index e0c854d110..6342563128 100644 --- a/tests/lib/rules/no-typos.js +++ b/tests/lib/rules/no-typos.js @@ -855,6 +855,7 @@ ruleTester.run('no-typos', rule, { expected: 'getDerivedStateFromProps', }, type: 'MethodDefinition', + line: 3, }, { messageId: 'typoLifecycleMethod', @@ -863,6 +864,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillMount', }, type: 'MethodDefinition', + line: 4, }, { messageId: 'typoLifecycleMethod', @@ -871,6 +873,7 @@ ruleTester.run('no-typos', rule, { expected: 'UNSAFE_componentWillMount', }, type: 'MethodDefinition', + line: 5, }, { messageId: 'typoLifecycleMethod', @@ -879,6 +882,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentDidMount', }, type: 'MethodDefinition', + line: 6, }, { messageId: 'typoLifecycleMethod', @@ -887,6 +891,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillReceiveProps', }, type: 'MethodDefinition', + line: 7, }, { messageId: 'typoLifecycleMethod', @@ -895,6 +900,7 @@ ruleTester.run('no-typos', rule, { expected: 'UNSAFE_componentWillReceiveProps', }, type: 'MethodDefinition', + line: 8, }, { messageId: 'typoLifecycleMethod', @@ -903,6 +909,7 @@ ruleTester.run('no-typos', rule, { expected: 'shouldComponentUpdate', }, type: 'MethodDefinition', + line: 9, }, { messageId: 'typoLifecycleMethod', @@ -911,6 +918,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillUpdate', }, type: 'MethodDefinition', + line: 10, }, { messageId: 'typoLifecycleMethod', @@ -919,6 +927,7 @@ ruleTester.run('no-typos', rule, { expected: 'UNSAFE_componentWillUpdate', }, type: 'MethodDefinition', + line: 11, }, { messageId: 'typoLifecycleMethod', @@ -927,6 +936,7 @@ ruleTester.run('no-typos', rule, { expected: 'getSnapshotBeforeUpdate', }, type: 'MethodDefinition', + line: 12, }, { messageId: 'typoLifecycleMethod', @@ -935,6 +945,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentDidUpdate', }, type: 'MethodDefinition', + line: 13, }, { messageId: 'typoLifecycleMethod', @@ -943,6 +954,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentDidCatch', }, type: 'MethodDefinition', + line: 14, }, { messageId: 'typoLifecycleMethod', @@ -951,6 +963,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillUnmount', }, type: 'MethodDefinition', + line: 15, }, ], }, @@ -984,6 +997,7 @@ ruleTester.run('no-typos', rule, { expected: 'getDerivedStateFromProps', }, type: 'MethodDefinition', + line: 3, }, { messageId: 'typoLifecycleMethod', @@ -992,6 +1006,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillMount', }, type: 'MethodDefinition', + line: 4, }, { messageId: 'typoLifecycleMethod', @@ -1000,6 +1015,7 @@ ruleTester.run('no-typos', rule, { expected: 'UNSAFE_componentWillMount', }, type: 'MethodDefinition', + line: 5, }, { messageId: 'typoLifecycleMethod', @@ -1008,6 +1024,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentDidMount', }, type: 'MethodDefinition', + line: 6, }, { messageId: 'typoLifecycleMethod', @@ -1016,6 +1033,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillReceiveProps', }, type: 'MethodDefinition', + line: 7, }, { messageId: 'typoLifecycleMethod', @@ -1024,6 +1042,7 @@ ruleTester.run('no-typos', rule, { expected: 'UNSAFE_componentWillReceiveProps', }, type: 'MethodDefinition', + line: 8, }, { messageId: 'typoLifecycleMethod', @@ -1032,6 +1051,7 @@ ruleTester.run('no-typos', rule, { expected: 'shouldComponentUpdate', }, type: 'MethodDefinition', + line: 9, }, { messageId: 'typoLifecycleMethod', @@ -1040,6 +1060,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillUpdate', }, type: 'MethodDefinition', + line: 10, }, { messageId: 'typoLifecycleMethod', @@ -1048,6 +1069,7 @@ ruleTester.run('no-typos', rule, { expected: 'UNSAFE_componentWillUpdate', }, type: 'MethodDefinition', + line: 11, }, { messageId: 'typoLifecycleMethod', @@ -1056,6 +1078,7 @@ ruleTester.run('no-typos', rule, { expected: 'getSnapshotBeforeUpdate', }, type: 'MethodDefinition', + line: 12, }, { messageId: 'typoLifecycleMethod', @@ -1064,6 +1087,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentDidUpdate', }, type: 'MethodDefinition', + line: 13, }, { messageId: 'typoLifecycleMethod', @@ -1072,6 +1096,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentDidCatch', }, type: 'MethodDefinition', + line: 14, }, { messageId: 'typoLifecycleMethod', @@ -1080,6 +1105,7 @@ ruleTester.run('no-typos', rule, { expected: 'componentWillUnmount', }, type: 'MethodDefinition', + line: 15, }, { messageId: 'typoLifecycleMethod', @@ -1088,6 +1114,7 @@ ruleTester.run('no-typos', rule, { expected: 'render', }, type: 'MethodDefinition', + line: 16, }, ], },