From 3c888b73fdb713cc9b54e2eab65150f751426c14 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Sat, 22 Nov 2025 22:53:43 +0800 Subject: [PATCH 01/10] test: remove `type` in `errors` --- tests/lib/rules/attribute-hyphenation.js | 28 ---------- tests/lib/rules/attributes-order.js | 28 ---------- .../rules/component-definition-name-casing.js | 15 ------ tests/lib/rules/max-attributes-per-line.js | 3 -- .../multiline-html-element-content-newline.js | 2 - tests/lib/rules/no-constant-condition.js | 51 ++++++++----------- .../no-deprecated-vue-config-keycodes.js | 1 - tests/lib/rules/no-duplicate-class-names.js | 35 ------------- tests/lib/rules/no-multi-spaces.js | 20 -------- .../lib/rules/no-multiple-objects-in-class.js | 3 -- .../lib/rules/no-reserved-component-names.js | 9 ---- tests/lib/rules/no-restricted-class.js | 27 ++++------ tests/lib/rules/no-template-shadow.js | 17 +------ tests/lib/rules/prop-name-casing.js | 15 ------ tests/lib/rules/require-direct-export.js | 8 --- tests/lib/rules/require-name-property.js | 8 --- tests/lib/rules/require-render-return.js | 6 --- ...singleline-html-element-content-newline.js | 2 - tests/lib/rules/static-class-names-order.js | 6 +-- tests/lib/utils/vue-component.js | 3 +- 20 files changed, 34 insertions(+), 253 deletions(-) diff --git a/tests/lib/rules/attribute-hyphenation.js b/tests/lib/rules/attribute-hyphenation.js index eac974e4e..08c1fb695 100644 --- a/tests/lib/rules/attribute-hyphenation.js +++ b/tests/lib/rules/attribute-hyphenation.js @@ -117,7 +117,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'my-prop' can't be hyphenated.", - type: 'VIdentifier', line: 1, column: 24, endLine: 1, @@ -133,7 +132,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'MyProp' must be hyphenated.", - type: 'VIdentifier', line: 1, column: 24, endLine: 1, @@ -150,7 +148,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':my-prop' can't be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -166,7 +163,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':MyProp' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -183,7 +179,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-bind:my-prop' can't be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -199,7 +194,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-bind:MyProp' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -215,7 +209,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-bind:MyProp' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -232,7 +225,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':second-prop' can't be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 46, endLine: 1, @@ -249,7 +241,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-bind:myProp' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -266,7 +257,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-bind:propID' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -284,7 +274,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-model:my-prop' can't be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -301,7 +290,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-model:myProp' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -317,7 +305,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'v-model:MyProp' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -345,7 +332,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'third-custom' can't be hyphenated.", - type: 'VIdentifier', line: 3, column: 111, endLine: 3, @@ -373,7 +359,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'custom-hyphen' can't be hyphenated.", - type: 'VIdentifier', line: 3, column: 71, endLine: 3, @@ -381,7 +366,6 @@ ruleTester.run('attribute-hyphenation', rule, { }, { message: "Attribute 'second-custom' can't be hyphenated.", - type: 'VIdentifier', line: 3, column: 91, endLine: 3, @@ -397,7 +381,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'my-prop' can't be hyphenated.", - type: 'VIdentifier', line: 1, column: 22, endLine: 1, @@ -413,7 +396,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'MyProp' must be hyphenated.", - type: 'VIdentifier', line: 1, column: 22, endLine: 1, @@ -429,7 +411,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':attr_Gg' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -445,7 +426,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':Attr_Hh' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -461,7 +441,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':_attr_Jj' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -477,7 +456,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':_attrKk' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -493,7 +471,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':_AttrLl' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -509,7 +486,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':my-custom_prop' can't be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -525,7 +501,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':myAge.sync' must be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -541,7 +516,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute ':my-age.sync' can't be hyphenated.", - type: 'VDirectiveKey', line: 1, column: 24, endLine: 1, @@ -566,7 +540,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'my-prop' can't be hyphenated.", - type: 'VIdentifier', line: 3, column: 17, endLine: 3, @@ -591,7 +564,6 @@ ruleTester.run('attribute-hyphenation', rule, { errors: [ { message: "Attribute 'myProp' must be hyphenated.", - type: 'VIdentifier', line: 3, column: 17, endLine: 3, diff --git a/tests/lib/rules/attributes-order.js b/tests/lib/rules/attributes-order.js index edd58b23b..b5d73977e 100644 --- a/tests/lib/rules/attributes-order.js +++ b/tests/lib/rules/attributes-order.js @@ -693,7 +693,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "is" should go before "v-cloak".', - type: 'VAttribute', line: 1, column: 24, endLine: 1, @@ -708,7 +707,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-cloak" should go before "id".', - type: 'VAttribute', line: 1, column: 30, endLine: 1, @@ -737,7 +735,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-model" should go before "model".', - type: 'VAttribute', line: 4, column: 15, endLine: 4, @@ -745,7 +742,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute ":id" should go before "propOne".', - type: 'VAttribute', line: 6, column: 15, endLine: 6, @@ -776,7 +772,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-model" should go before "v-on".', - type: 'VAttribute', line: 6, column: 15, endLine: 6, @@ -784,7 +779,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "propOne" should go before "v-on".', - type: 'VAttribute', line: 7, column: 15, endLine: 7, @@ -800,7 +794,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "is" should go before "aria-test".', - type: 'VAttribute', line: 1, column: 46, endLine: 1, @@ -833,7 +826,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "is" should go before "propone".', - type: 'VAttribute', line: 1, column: 44, endLine: 1, @@ -856,7 +848,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "is" should go before "v-cloak".', - type: 'VAttribute', line: 3, column: 15, endLine: 3, @@ -899,7 +890,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-for" should go before "v-if".', - type: 'VAttribute', line: 4, column: 15, endLine: 4, @@ -907,7 +897,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "is" should go before "v-once".', - type: 'VAttribute', line: 6, column: 15, endLine: 6, @@ -915,7 +904,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "ref" should go before "v-on:click".', - type: 'VAttribute', line: 8, column: 15, endLine: 8, @@ -923,7 +911,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute ":prop" should go before "v-on:click".', - type: 'VAttribute', line: 9, column: 15, endLine: 9, @@ -931,7 +918,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "id" should go before "v-text".', - type: 'VAttribute', line: 11, column: 15, endLine: 11, @@ -939,7 +925,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "myProp" should go before "v-text".', - type: 'VAttribute', line: 12, column: 15, endLine: 12, @@ -999,7 +984,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "is" should go before "v-once".', - type: 'VAttribute', line: 6, column: 15, endLine: 6, @@ -1007,7 +991,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "v-on:click" should go before "v-once".', - type: 'VAttribute', line: 7, column: 15, endLine: 7, @@ -1015,7 +998,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "ref" should go before "v-once".', - type: 'VAttribute', line: 8, column: 15, endLine: 8, @@ -1023,7 +1005,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "id" should go before "v-text".', - type: 'VAttribute', line: 11, column: 15, endLine: 11, @@ -1031,7 +1012,6 @@ tester.run('attributes-order', rule, { }, { message: 'Attribute "myProp" should go before "v-text".', - type: 'VAttribute', line: 12, column: 15, endLine: 12, @@ -1076,7 +1056,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-if" should go before "class".', - type: 'VAttribute', line: 4, column: 15, endLine: 4, @@ -1104,7 +1083,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-slot" should go before "v-model".', - type: 'VAttribute', line: 5, column: 15, endLine: 5, @@ -1130,7 +1108,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "a-prop" should go before "z-prop".', - type: 'VAttribute', line: 4, column: 13, endLine: 4, @@ -1156,7 +1133,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute ":a-prop" should go before ":z-prop".', - type: 'VAttribute', line: 4, column: 13, endLine: 4, @@ -1182,7 +1158,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "@change" should go before "@input".', - type: 'VAttribute', line: 4, column: 13, endLine: 4, @@ -1208,7 +1183,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "boolean-prop" should go before "z-prop".', - type: 'VAttribute', line: 4, column: 13, endLine: 4, @@ -1234,7 +1208,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-on:[c]" should go before "v-on:click".', - type: 'VAttribute', line: 4, column: 13, endLine: 4, @@ -1260,7 +1233,6 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-on:click" should go before "v-text".', - type: 'VAttribute', line: 4, column: 13, endLine: 4, diff --git a/tests/lib/rules/component-definition-name-casing.js b/tests/lib/rules/component-definition-name-casing.js index 323461729..94d5347d8 100644 --- a/tests/lib/rules/component-definition-name-casing.js +++ b/tests/lib/rules/component-definition-name-casing.js @@ -191,7 +191,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo-bar" is not PascalCase.', - type: 'Literal', line: 3, column: 17, endLine: 3, @@ -211,7 +210,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo bar" is not PascalCase.', - type: 'Literal', line: 3, column: 17, endLine: 3, @@ -231,7 +229,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo!bar" is not PascalCase.', - type: 'Literal', line: 3, column: 17, endLine: 3, @@ -251,7 +248,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo!bar" is not PascalCase.', - type: 'Literal', line: 3, column: 17, endLine: 3, @@ -275,7 +271,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo_bar" is not PascalCase.', - type: 'Literal', line: 3, column: 17, endLine: 3, @@ -300,7 +295,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo_bar" is not PascalCase.', - type: 'Literal', line: 3, column: 17, endLine: 3, @@ -325,7 +319,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo_bar" is not kebab-case.', - type: 'Literal', line: 3, column: 17, endLine: 3, @@ -341,7 +334,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo-bar" is not PascalCase.', - type: 'Literal', line: 1, column: 15, endLine: 1, @@ -357,7 +349,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo-bar" is not PascalCase.', - type: 'Literal', line: 1, column: 15, endLine: 1, @@ -376,7 +367,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo-bar" is not PascalCase.', - type: 'Literal', line: 1, column: 40, endLine: 1, @@ -392,7 +382,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo-bar" is not PascalCase.', - type: 'Literal', line: 1, column: 15, endLine: 1, @@ -408,7 +397,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo-bar" is not PascalCase.', - type: 'Literal', line: 1, column: 15, endLine: 1, @@ -425,7 +413,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo_bar" is not PascalCase.', - type: 'Literal', line: 1, column: 15, endLine: 1, @@ -442,7 +429,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo_bar" is not kebab-case.', - type: 'Literal', line: 1, column: 15, endLine: 1, @@ -459,7 +445,6 @@ ruleTester.run('component-definition-name-casing', rule, { errors: [ { message: 'Property name "foo_bar" is not kebab-case.', - type: 'TemplateLiteral', line: 1, column: 15, endLine: 1, diff --git a/tests/lib/rules/max-attributes-per-line.js b/tests/lib/rules/max-attributes-per-line.js index 5b88f7857..8fd176be2 100644 --- a/tests/lib/rules/max-attributes-per-line.js +++ b/tests/lib/rules/max-attributes-per-line.js @@ -146,7 +146,6 @@ job="Vet">`, errors: [ { message: "'job' should be on a new line.", - type: 'VAttribute', line: 1, column: 47, endLine: 1, @@ -170,7 +169,6 @@ age="30" errors: [ { message: "'age' should be on a new line.", - type: 'VAttribute', line: 2, column: 25, endLine: 2, @@ -194,7 +192,6 @@ age="30" errors: [ { message: "'age' should be on a new line.", - type: 'VAttribute', line: 2, column: 25, endLine: 2, diff --git a/tests/lib/rules/multiline-html-element-content-newline.js b/tests/lib/rules/multiline-html-element-content-newline.js index 372d277fc..8d7d648c4 100644 --- a/tests/lib/rules/multiline-html-element-content-newline.js +++ b/tests/lib/rules/multiline-html-element-content-newline.js @@ -282,7 +282,6 @@ content 'Expected 1 line break after opening tag (`
`), but no line breaks found.', line: 5, column: 12, - type: 'HTMLTagClose', endLine: 5, endColumn: 12 }, @@ -291,7 +290,6 @@ content 'Expected 1 line break before closing tag (`
`), but no line breaks found.', line: 5, column: 19, - type: 'HTMLEndTagOpen', endLine: 5, endColumn: 19 } diff --git a/tests/lib/rules/no-constant-condition.js b/tests/lib/rules/no-constant-condition.js index 489944a11..38b2f94f7 100644 --- a/tests/lib/rules/no-constant-condition.js +++ b/tests/lib/rules/no-constant-condition.js @@ -23,7 +23,6 @@ tester.run('no-constant-condition', rule, { errors: [ { messageId: 'unexpected', - type: 'UnaryExpression', line: 1, column: 31, endLine: 1, @@ -36,7 +35,6 @@ tester.run('no-constant-condition', rule, { errors: [ { messageId: 'unexpected', - type: 'Literal', line: 1, column: 36, endLine: 1, @@ -49,7 +47,6 @@ tester.run('no-constant-condition', rule, { errors: [ { messageId: 'unexpected', - type: 'Literal', line: 1, column: 31, endLine: 1, @@ -62,7 +59,6 @@ tester.run('no-constant-condition', rule, { errors: [ { messageId: 'unexpected', - type: 'ObjectExpression', line: 1, column: 33, endLine: 1, @@ -75,7 +71,6 @@ tester.run('no-constant-condition', rule, { errors: [ { messageId: 'unexpected', - type: 'BinaryExpression', line: 1, column: 31, endLine: 1, @@ -88,37 +83,33 @@ tester.run('no-constant-condition', rule, { errors: [ { messageId: 'unexpected', - type: 'LogicalExpression', line: 1, column: 31, endLine: 1, endColumn: 37 } ] - } + }, - // failing in Node.js v8, because template literals are not supported there: - // { - // code: '', - // errors: [ - // { - // messageId: 'unexpected', - // type: 'TemplateLiteral', - // column: 31, - // endColumn: 36 - // } - // ] - // }, - // { - // code: '', - // errors: [ - // { - // messageId: 'unexpected', - // type: 'TemplateLiteral', - // column: 31, - // endColumn: 33 - // } - // ] - // } + { + code: '', + errors: [ + { + messageId: 'unexpected', + column: 31, + endColumn: 36 + } + ] + }, + { + code: '', + errors: [ + { + messageId: 'unexpected', + column: 31, + endColumn: 33 + } + ] + } ] }) diff --git a/tests/lib/rules/no-deprecated-vue-config-keycodes.js b/tests/lib/rules/no-deprecated-vue-config-keycodes.js index 1a00c1c86..b0494f24d 100644 --- a/tests/lib/rules/no-deprecated-vue-config-keycodes.js +++ b/tests/lib/rules/no-deprecated-vue-config-keycodes.js @@ -36,7 +36,6 @@ ruleTester.run('no-deprecated-vue-config-keycodes', rule, { message: '`Vue.config.keyCodes` are deprecated.', line: 1, column: 1, - type: 'MemberExpression', // messageId: 'unexpected', endLine: 1, endColumn: 20 diff --git a/tests/lib/rules/no-duplicate-class-names.js b/tests/lib/rules/no-duplicate-class-names.js index 2384350cc..778986cf8 100644 --- a/tests/lib/rules/no-duplicate-class-names.js +++ b/tests/lib/rules/no-duplicate-class-names.js @@ -66,7 +66,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VLiteral', line: 1, column: 22, endLine: 1, @@ -81,7 +80,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class names 'foo', 'bar'.", - type: 'VLiteral', line: 1, column: 22, endLine: 1, @@ -96,7 +94,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 24, endLine: 1, @@ -111,7 +108,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'TemplateElement', line: 1, column: 24, endLine: 1, @@ -126,7 +122,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 26, endLine: 1, @@ -141,7 +136,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 26, endLine: 1, @@ -149,7 +143,6 @@ tester.run('no-duplicate-class-names', rule, { }, { message: "Duplicate class name 'bar'.", - type: 'Literal', line: 1, column: 47, endLine: 1, @@ -164,7 +157,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 25, endLine: 1, @@ -179,7 +171,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 25, endLine: 1, @@ -187,7 +178,6 @@ tester.run('no-duplicate-class-names', rule, { }, { message: "Duplicate class name 'bar'.", - type: 'Literal', line: 1, column: 36, endLine: 1, @@ -202,7 +192,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 25, endLine: 1, @@ -210,7 +199,6 @@ tester.run('no-duplicate-class-names', rule, { }, { message: "Duplicate class name 'bar'.", - type: 'Literal', line: 1, column: 38, endLine: 1, @@ -225,7 +213,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 35, endLine: 1, @@ -240,7 +227,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 24, endLine: 1, @@ -255,7 +241,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VLiteral', line: 1, column: 22, endLine: 1, @@ -270,7 +255,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VLiteral', line: 1, column: 22, endLine: 1, @@ -285,7 +269,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VLiteral', line: 1, column: 22, endLine: 1, @@ -300,7 +283,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -315,7 +297,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -330,7 +311,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -345,7 +325,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class names 'foo', 'bar'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -360,7 +339,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -375,7 +353,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -390,7 +367,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -405,7 +381,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -420,7 +395,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'VStartTag', line: 1, column: 11, endLine: 1, @@ -435,7 +409,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'ArrayExpression', line: 1, column: 24, endLine: 1, @@ -450,7 +423,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'BinaryExpression', line: 1, column: 24, endLine: 1, @@ -465,7 +437,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'ArrayExpression', line: 1, column: 24, endLine: 1, @@ -480,7 +451,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 36, endLine: 1, @@ -495,7 +465,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 36, endLine: 1, @@ -510,7 +479,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 36, endLine: 1, @@ -525,7 +493,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 55, endLine: 1, @@ -540,7 +507,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'bar'.", - type: 'Literal', line: 1, column: 44, endLine: 1, @@ -555,7 +521,6 @@ tester.run('no-duplicate-class-names', rule, { errors: [ { message: "Duplicate class name 'foo'.", - type: 'Literal', line: 1, column: 54, endLine: 1, diff --git a/tests/lib/rules/no-multi-spaces.js b/tests/lib/rules/no-multi-spaces.js index 784718270..909a5063a 100644 --- a/tests/lib/rules/no-multi-spaces.js +++ b/tests/lib/rules/no-multi-spaces.js @@ -82,7 +82,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 1, column: 15, endLine: 1, @@ -96,7 +95,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before 'class'.", - type: 'HTMLIdentifier', line: 1, column: 15, endLine: 1, @@ -104,7 +102,6 @@ ruleTester.run('no-multi-spaces', rule, { }, { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 1, column: 29, endLine: 1, @@ -118,7 +115,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before 'class'.", - type: 'HTMLIdentifier', line: 1, column: 15, endLine: 1, @@ -126,7 +122,6 @@ ruleTester.run('no-multi-spaces', rule, { }, { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 1, column: 28, endLine: 1, @@ -140,7 +135,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before ':'.", - type: 'Punctuator', line: 1, column: 15, endLine: 1, @@ -148,7 +142,6 @@ ruleTester.run('no-multi-spaces', rule, { }, { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 1, column: 30, endLine: 1, @@ -162,7 +155,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 1, column: 35, endLine: 1, @@ -176,7 +168,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 1, column: 34, endLine: 1, @@ -190,7 +181,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 1, column: 36, endLine: 1, @@ -204,7 +194,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before '/>'.", - type: 'HTMLSelfClosingTagClose', line: 2, column: 21, endLine: 2, @@ -218,7 +207,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before 'test'.", - type: 'Identifier', line: 1, column: 18, endLine: 1, @@ -226,7 +214,6 @@ ruleTester.run('no-multi-spaces', rule, { }, { message: "Multiple spaces found before '}}'.", - type: 'VExpressionEnd', line: 1, column: 24, endLine: 1, @@ -240,7 +227,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before '>'.", - type: 'HTMLTagClose', line: 1, column: 15, endLine: 1, @@ -254,7 +240,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before 'i'.", - type: 'Identifier', line: 1, column: 23, endLine: 1, @@ -262,7 +247,6 @@ ruleTester.run('no-multi-spaces', rule, { }, { message: "Multiple spaces found before 'in'.", - type: 'Keyword', line: 1, column: 30, endLine: 1, @@ -270,7 +254,6 @@ ruleTester.run('no-multi-spaces', rule, { }, { message: "Multiple spaces found before 'b'.", - type: 'Identifier', line: 1, column: 36, endLine: 1, @@ -278,7 +261,6 @@ ruleTester.run('no-multi-spaces', rule, { }, { message: "Multiple spaces found before '\"'.", - type: 'Punctuator', line: 1, column: 41, endLine: 1, @@ -310,7 +292,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before ':'.", - type: 'Punctuator', line: 5, column: 26, endLine: 5, @@ -342,7 +323,6 @@ ruleTester.run('no-multi-spaces', rule, { errors: [ { message: "Multiple spaces found before 'isExpanded'.", - type: 'Identifier', line: 5, column: 27, endLine: 5, diff --git a/tests/lib/rules/no-multiple-objects-in-class.js b/tests/lib/rules/no-multiple-objects-in-class.js index ab019f020..46805fb14 100644 --- a/tests/lib/rules/no-multiple-objects-in-class.js +++ b/tests/lib/rules/no-multiple-objects-in-class.js @@ -26,7 +26,6 @@ ruleTester.run('no-multiple-objects-in-class', rule, { errors: [ { message: 'Unexpected multiple objects. Merge objects.', - type: 'VAttribute', line: 1, column: 16, endLine: 1, @@ -39,7 +38,6 @@ ruleTester.run('no-multiple-objects-in-class', rule, { errors: [ { message: 'Unexpected multiple objects. Merge objects.', - type: 'VAttribute', line: 1, column: 16, endLine: 1, @@ -54,7 +52,6 @@ ruleTester.run('no-multiple-objects-in-class', rule, { errors: [ { message: 'Unexpected multiple objects. Merge objects.', - type: 'VAttribute', line: 1, column: 16, endLine: 1, diff --git a/tests/lib/rules/no-reserved-component-names.js b/tests/lib/rules/no-reserved-component-names.js index 809d35103..4db44fe52 100644 --- a/tests/lib/rules/no-reserved-component-names.js +++ b/tests/lib/rules/no-reserved-component-names.js @@ -608,7 +608,6 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - type: 'Literal', line: 3 } ] @@ -623,7 +622,6 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - type: 'Literal', line: 1 } ] @@ -638,7 +636,6 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - type: 'Literal', line: 1 } ] @@ -653,7 +650,6 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - type: 'TemplateLiteral', line: 1 } ] @@ -668,7 +664,6 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - type: 'TemplateLiteral', line: 1 } ] @@ -687,7 +682,6 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - type: 'Property', line: 3 } ] @@ -740,7 +734,6 @@ ruleTester.run('no-reserved-component-names', rule, { { messageId: 'reservedInVue', data: { name }, - type: 'Literal', line: 3 } ] @@ -758,7 +751,6 @@ ruleTester.run('no-reserved-component-names', rule, { { messageId: 'reservedInVue', data: { name }, - type: 'Literal', line: 3 } ] @@ -776,7 +768,6 @@ ruleTester.run('no-reserved-component-names', rule, { { messageId: 'reservedInVue3', data: { name }, - type: 'Literal', line: 3 } ] diff --git a/tests/lib/rules/no-restricted-class.js b/tests/lib/rules/no-restricted-class.js index 97cc0b4b1..1a4e606e4 100644 --- a/tests/lib/rules/no-restricted-class.js +++ b/tests/lib/rules/no-restricted-class.js @@ -48,8 +48,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'VAttribute' + message: "'forbidden' class is not allowed." } ] }, @@ -58,8 +57,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'Literal' + message: "'forbidden' class is not allowed." } ] }, @@ -68,8 +66,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'Literal' + message: "'forbidden' class is not allowed." } ] }, @@ -78,8 +75,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'Identifier' + message: "'forbidden' class is not allowed." } ] }, @@ -88,8 +84,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'TemplateElement' + message: "'forbidden' class is not allowed." } ] }, @@ -98,8 +93,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'Literal' + message: "'forbidden' class is not allowed." } ] }, @@ -108,8 +102,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'Literal' + message: "'forbidden' class is not allowed." } ] }, @@ -118,8 +111,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'Literal' + message: "'forbidden' class is not allowed." } ] }, @@ -128,8 +120,7 @@ ruleTester.run('no-restricted-class', rule, { options: ['/^for(bidden|gotten)/'], errors: [ { - message: "'forbidden' class is not allowed.", - type: 'VAttribute' + message: "'forbidden' class is not allowed." } ] } diff --git a/tests/lib/rules/no-template-shadow.js b/tests/lib/rules/no-template-shadow.js index 3cc5218d1..a0d705d75 100644 --- a/tests/lib/rules/no-template-shadow.js +++ b/tests/lib/rules/no-template-shadow.js @@ -179,8 +179,7 @@ ruleTester.run('no-template-shadow', rule, { code: '', errors: [ { - message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier' + message: "Variable 'i' is already declared in the upper scope." } ] }, @@ -199,7 +198,6 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier', line: 2 } ] @@ -220,12 +218,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier', line: 2 }, { message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier', line: 3 } ] @@ -247,12 +243,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier', line: 2 }, { message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier', line: 3 } ] @@ -274,7 +268,6 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier', line: 2 } ] @@ -298,12 +291,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - type: 'Identifier', line: 2 }, { message: "Variable 'f' is already declared in the upper scope.", - type: 'Identifier', line: 3 } ] @@ -337,12 +328,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'e' is already declared in the upper scope.", - type: 'Identifier', line: 6 }, { message: "Variable 'f' is already declared in the upper scope.", - type: 'Identifier', line: 7 } ] @@ -376,12 +365,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'e' is already declared in the upper scope.", - type: 'Identifier', line: 6 }, { message: "Variable 'f' is already declared in the upper scope.", - type: 'Identifier', line: 7 } ] @@ -413,12 +400,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'e' is already declared in the upper scope.", - type: 'Identifier', line: 6 }, { message: "Variable 'f' is already declared in the upper scope.", - type: 'Identifier', line: 7 } ] diff --git a/tests/lib/rules/prop-name-casing.js b/tests/lib/rules/prop-name-casing.js index b50ff1b02..8d7344a60 100644 --- a/tests/lib/rules/prop-name-casing.js +++ b/tests/lib/rules/prop-name-casing.js @@ -406,7 +406,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -425,7 +424,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -442,7 +440,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - type: 'Literal', line: 3 } ] @@ -461,7 +458,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greetingText" is not in snake_case.', - type: 'Property', line: 4 } ] @@ -480,7 +476,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -499,7 +494,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in snake_case.', - type: 'Property', line: 4 } ] @@ -517,7 +511,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -536,7 +529,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -555,7 +547,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -573,7 +564,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "abc-123-def" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -592,7 +582,6 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in camelCase.', - type: 'Property', line: 4 } ] @@ -733,12 +722,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "notIgnored_prop" is not in camelCase.', - type: 'Property', line: 4 }, { message: 'Prop "other-pattern" is not in camelCase.', - type: 'Property', line: 5 } ] @@ -755,12 +742,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "notIgnored_prop" is not in camelCase.', - type: 'Literal', line: 3 }, { message: 'Prop "pattern_invalid" is not in camelCase.', - type: 'Literal', line: 3 } ] diff --git a/tests/lib/rules/require-direct-export.js b/tests/lib/rules/require-direct-export.js index cec06c7a0..efeddfeb9 100644 --- a/tests/lib/rules/require-direct-export.js +++ b/tests/lib/rules/require-direct-export.js @@ -94,7 +94,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 3 } ] @@ -109,7 +108,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 5 } ] @@ -120,7 +118,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 1 } ] @@ -131,7 +128,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 1 } ] @@ -142,7 +138,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 1 } ] @@ -157,7 +152,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 1 } ] @@ -170,7 +164,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 1 } ] @@ -186,7 +179,6 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - type: 'ExportDefaultDeclaration', line: 5 } ] diff --git a/tests/lib/rules/require-name-property.js b/tests/lib/rules/require-name-property.js index c61c46759..aea710121 100644 --- a/tests/lib/rules/require-name-property.js +++ b/tests/lib/rules/require-name-property.js @@ -80,7 +80,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', @@ -104,7 +103,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', @@ -127,7 +125,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', @@ -150,7 +147,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', @@ -175,7 +171,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', @@ -201,7 +196,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', @@ -230,7 +224,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', @@ -258,7 +251,6 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', - type: 'ObjectExpression', suggestions: [ { desc: 'Add name property to component.', diff --git a/tests/lib/rules/require-render-return.js b/tests/lib/rules/require-render-return.js index d2aad3c01..99e1848e5 100644 --- a/tests/lib/rules/require-render-return.js +++ b/tests/lib/rules/require-render-return.js @@ -140,7 +140,6 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - type: 'Identifier', line: 2 } ] @@ -158,7 +157,6 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - type: 'Identifier', line: 2 } ] @@ -175,7 +173,6 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - type: 'Identifier', line: 2 } ] @@ -192,7 +189,6 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - type: 'Identifier', line: 2 } ] @@ -209,7 +205,6 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - type: 'Identifier', line: 2 } ] @@ -228,7 +223,6 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - type: 'Identifier', line: 2 } ] diff --git a/tests/lib/rules/singleline-html-element-content-newline.js b/tests/lib/rules/singleline-html-element-content-newline.js index 52c01392b..83366266b 100644 --- a/tests/lib/rules/singleline-html-element-content-newline.js +++ b/tests/lib/rules/singleline-html-element-content-newline.js @@ -251,7 +251,6 @@ content 'Expected 1 line break after opening tag (`
`), but no line breaks found.', line: 3, column: 30, - type: 'HTMLTagClose', endLine: 3, endColumn: 30 }, @@ -260,7 +259,6 @@ content 'Expected 1 line break before closing tag (`
`), but no line breaks found.', line: 3, column: 37, - type: 'HTMLEndTagOpen', endLine: 3, endColumn: 37 } diff --git a/tests/lib/rules/static-class-names-order.js b/tests/lib/rules/static-class-names-order.js index 0f293f5e9..8e3ff75d7 100644 --- a/tests/lib/rules/static-class-names-order.js +++ b/tests/lib/rules/static-class-names-order.js @@ -41,8 +41,7 @@ tester.run('static-class-names-order', rule, { output: '', errors: [ { - message: 'Classes should be ordered alphabetically.', - type: 'VAttribute' + message: 'Classes should be ordered alphabetically.' } ] }, @@ -58,8 +57,7 @@ tester.run('static-class-names-order', rule, { `, errors: [ { - message: 'Classes should be ordered alphabetically.', - type: 'VAttribute' + message: 'Classes should be ordered alphabetically.' } ] } diff --git a/tests/lib/utils/vue-component.js b/tests/lib/utils/vue-component.js index 12fcd904f..e433c2d90 100644 --- a/tests/lib/utils/vue-component.js +++ b/tests/lib/utils/vue-component.js @@ -29,8 +29,7 @@ const languageOptions = { function makeError(line) { return { message: 'Component detected.', - line, - type: 'ObjectExpression' + line } } From 4d4935b135d44221b1c1c338ec2b31fb9094e317 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 16:53:03 +0800 Subject: [PATCH 02/10] test(no-template-shadow): add `loc` info --- tests/lib/rules/no-template-shadow.js | 91 +++++++++++++++++++++------ 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/tests/lib/rules/no-template-shadow.js b/tests/lib/rules/no-template-shadow.js index a0d705d75..6cbd94c58 100644 --- a/tests/lib/rules/no-template-shadow.js +++ b/tests/lib/rules/no-template-shadow.js @@ -179,7 +179,11 @@ ruleTester.run('no-template-shadow', rule, { code: '', errors: [ { - message: "Variable 'i' is already declared in the upper scope." + message: "Variable 'i' is already declared in the upper scope.", + line: 1, + column: 43, + endLine: 1, + endColumn: 44 } ] }, @@ -198,7 +202,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - line: 2 + line: 2, + column: 21, + endLine: 2, + endColumn: 22 } ] }, @@ -218,11 +225,17 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - line: 2 + line: 2, + column: 21, + endLine: 2, + endColumn: 22 }, { message: "Variable 'i' is already declared in the upper scope.", - line: 3 + line: 3, + column: 21, + endLine: 3, + endColumn: 22 } ] }, @@ -243,11 +256,17 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - line: 2 + line: 2, + column: 21, + endLine: 2, + endColumn: 22 }, { message: "Variable 'i' is already declared in the upper scope.", - line: 3 + line: 3, + column: 23, + endLine: 3, + endColumn: 24 } ] }, @@ -268,7 +287,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - line: 2 + line: 2, + column: 21, + endLine: 2, + endColumn: 22 } ] }, @@ -291,11 +313,17 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'i' is already declared in the upper scope.", - line: 2 + line: 2, + column: 21, + endLine: 2, + endColumn: 22 }, { message: "Variable 'f' is already declared in the upper scope.", - line: 3 + line: 3, + column: 21, + endLine: 3, + endColumn: 22 } ] }, @@ -328,11 +356,17 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'e' is already declared in the upper scope.", - line: 6 + line: 6, + column: 21, + endLine: 6, + endColumn: 22 }, { message: "Variable 'f' is already declared in the upper scope.", - line: 7 + line: 7, + column: 21, + endLine: 7, + endColumn: 22 } ] }, @@ -365,11 +399,17 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'e' is already declared in the upper scope.", - line: 6 + line: 6, + column: 21, + endLine: 6, + endColumn: 22 }, { message: "Variable 'f' is already declared in the upper scope.", - line: 7 + line: 7, + column: 21, + endLine: 7, + endColumn: 22 } ] }, @@ -400,11 +440,17 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'e' is already declared in the upper scope.", - line: 6 + line: 6, + column: 21, + endLine: 6, + endColumn: 22 }, { message: "Variable 'f' is already declared in the upper scope.", - line: 7 + line: 7, + column: 21, + endLine: 7, + endColumn: 22 } ] }, @@ -430,7 +476,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'j' is already declared in the upper scope.", - line: 4 + line: 4, + column: 23, + endLine: 4, + endColumn: 24 } ] }, @@ -450,7 +499,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'j' is already declared in the upper scope.", - line: 4 + line: 4, + column: 23, + endLine: 4, + endColumn: 24 } ] }, @@ -470,7 +522,10 @@ ruleTester.run('no-template-shadow', rule, { errors: [ { message: "Variable 'j' is already declared in the upper scope.", - line: 4 + line: 4, + column: 23, + endLine: 4, + endColumn: 24 } ] } From 178d2a98cb8b969a35f0d02fa9a7624ffc3364f3 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 17:40:04 +0800 Subject: [PATCH 03/10] test: prop-name-casing --- tests/lib/rules/prop-name-casing.js | 105 ++++++++++++++++++++++------ 1 file changed, 84 insertions(+), 21 deletions(-) diff --git a/tests/lib/rules/prop-name-casing.js b/tests/lib/rules/prop-name-casing.js index 8d7344a60..5a00abc76 100644 --- a/tests/lib/rules/prop-name-casing.js +++ b/tests/lib/rules/prop-name-casing.js @@ -406,7 +406,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 34 } ] }, @@ -424,7 +427,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 34 } ] }, @@ -440,7 +446,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 3 + line: 3, + column: 19, + endLine: 3, + endColumn: 34 } ] }, @@ -458,7 +467,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greetingText" is not in snake_case.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 33 } ] }, @@ -476,7 +488,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 36 } ] }, @@ -494,7 +509,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in snake_case.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 36 } ] }, @@ -511,7 +529,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 36 } ] }, @@ -529,7 +550,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 38 } ] }, @@ -547,7 +571,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 26 } ] }, @@ -564,7 +591,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "abc-123-def" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 34 } ] }, @@ -582,7 +612,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting-text" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 40 } ] }, @@ -653,7 +686,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 4 + line: 4, + column: 9, + endLine: 4, + endColumn: 30 } ] }, @@ -671,7 +707,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 3 + line: 3, + column: 20, + endLine: 3, + endColumn: 35 } ] }, @@ -701,7 +740,10 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "greeting_text" is not in camelCase.', - line: 4 + line: 4, + column: 15, + endLine: 4, + endColumn: 36 } ] } @@ -722,11 +764,17 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "notIgnored_prop" is not in camelCase.', - line: 4 + line: 4, + column: 13, + endLine: 4, + endColumn: 36 }, { message: 'Prop "other-pattern" is not in camelCase.', - line: 5 + line: 5, + column: 13, + endLine: 5, + endColumn: 36 } ] }, @@ -742,11 +790,17 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "notIgnored_prop" is not in camelCase.', - line: 3 + line: 3, + column: 19, + endLine: 3, + endColumn: 36 }, { message: 'Prop "pattern_invalid" is not in camelCase.', - line: 3 + line: 3, + column: 38, + endLine: 3, + endColumn: 55 } ] }, @@ -761,15 +815,24 @@ ruleTester.run('prop-name-casing', rule, { errors: [ { message: 'Prop "snake_case" is not in camelCase.', - line: 5 + line: 5, + column: 19, + endLine: 5, + endColumn: 24 }, { message: 'Prop "kebab-case" is not in camelCase.', - line: 5 + line: 5, + column: 19, + endLine: 5, + endColumn: 24 }, { message: 'Prop "PascalCase" is not in camelCase.', - line: 5 + line: 5, + column: 19, + endLine: 5, + endColumn: 24 } ], ...getTypeScriptFixtureTestOptions() From c603bef371d20253f77f2746382a8040572beac7 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 17:59:26 +0800 Subject: [PATCH 04/10] test: require-name-property --- tests/lib/rules/require-name-property.js | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/lib/rules/require-name-property.js b/tests/lib/rules/require-name-property.js index aea710121..517e8df58 100644 --- a/tests/lib/rules/require-name-property.js +++ b/tests/lib/rules/require-name-property.js @@ -80,6 +80,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 24, + endLine: 3, + endColumn: 10, suggestions: [ { desc: 'Add name property to component.', @@ -103,6 +107,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 40, + endLine: 3, + endColumn: 10, suggestions: [ { desc: 'Add name property to component.', @@ -125,6 +133,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 40, + endLine: 2, + endColumn: 43, suggestions: [ { desc: 'Add name property to component.', @@ -147,6 +159,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 24, + endLine: 2, + endColumn: 27, suggestions: [ { desc: 'Add name property to component.', @@ -171,6 +187,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 24, + endLine: 4, + endColumn: 10, suggestions: [ { desc: 'Add name property to component.', @@ -196,6 +216,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 40, + endLine: 4, + endColumn: 10, suggestions: [ { desc: 'Add name property to component.', @@ -224,6 +248,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 24, + endLine: 6, + endColumn: 10, suggestions: [ { desc: 'Add name property to component.', @@ -251,6 +279,10 @@ ruleTester.run('require-name-property', rule, { errors: [ { message: 'Required name property is not set.', + line: 2, + column: 24, + endLine: 4, + endColumn: 10, suggestions: [ { desc: 'Add name property to component.', From af9ba40f6c0b965d73e99ed2c868114b0c1615d0 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 19:03:36 +0800 Subject: [PATCH 05/10] Update require-direct-export.js --- tests/lib/rules/require-direct-export.js | 40 +++++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/tests/lib/rules/require-direct-export.js b/tests/lib/rules/require-direct-export.js index efeddfeb9..0a5816e94 100644 --- a/tests/lib/rules/require-direct-export.js +++ b/tests/lib/rules/require-direct-export.js @@ -94,7 +94,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 3 + line: 3, + column: 7, + endLine: 3, + endColumn: 23 } ] }, @@ -108,7 +111,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 5 + line: 5, + column: 7, + endLine: 5, + endColumn: 23 } ] }, @@ -118,7 +124,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 1 + line: 1, + column: 1, + endLine: 1, + endColumn: 38 } ] }, @@ -128,7 +137,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 1 + line: 1, + column: 1, + endLine: 1, + endColumn: 30 } ] }, @@ -138,7 +150,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 1 + line: 1, + column: 1, + endLine: 1, + endColumn: 24 } ] }, @@ -152,7 +167,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 1 + line: 1, + column: 1, + endLine: 5, + endColumn: 8 } ] }, @@ -164,7 +182,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 1 + line: 1, + column: 1, + endLine: 3, + endColumn: 8 } ] }, @@ -179,7 +200,10 @@ ruleTester.run('require-direct-export', rule, { errors: [ { message: 'Expected the component literal to be directly exported.', - line: 5 + line: 5, + column: 7, + endLine: 5, + endColumn: 23 } ] }, From b614985803888548a53530234182e811b377cde7 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 19:04:43 +0800 Subject: [PATCH 06/10] Update require-render-return.js --- tests/lib/rules/require-render-return.js | 30 +++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/lib/rules/require-render-return.js b/tests/lib/rules/require-render-return.js index 99e1848e5..0fa628302 100644 --- a/tests/lib/rules/require-render-return.js +++ b/tests/lib/rules/require-render-return.js @@ -140,7 +140,10 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - line: 2 + line: 2, + column: 9, + endLine: 2, + endColumn: 15 } ] }, @@ -157,7 +160,10 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - line: 2 + line: 2, + column: 9, + endLine: 2, + endColumn: 15 } ] }, @@ -173,7 +179,10 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - line: 2 + line: 2, + column: 9, + endLine: 2, + endColumn: 15 } ] }, @@ -189,7 +198,10 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - line: 2 + line: 2, + column: 9, + endLine: 2, + endColumn: 15 } ] }, @@ -205,7 +217,10 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - line: 2 + line: 2, + column: 9, + endLine: 2, + endColumn: 15 } ] }, @@ -223,7 +238,10 @@ ruleTester.run('require-render-return', rule, { errors: [ { message: 'Expected to return a value in render function.', - line: 2 + line: 2, + column: 9, + endLine: 2, + endColumn: 15 } ] } From 3b79640eb8a466d804f3ec20fe31af982245bb00 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 19:05:37 +0800 Subject: [PATCH 07/10] Update static-class-names-order.js --- tests/lib/rules/static-class-names-order.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/lib/rules/static-class-names-order.js b/tests/lib/rules/static-class-names-order.js index 8e3ff75d7..748cd6603 100644 --- a/tests/lib/rules/static-class-names-order.js +++ b/tests/lib/rules/static-class-names-order.js @@ -41,7 +41,11 @@ tester.run('static-class-names-order', rule, { output: '', errors: [ { - message: 'Classes should be ordered alphabetically.' + message: 'Classes should be ordered alphabetically.', + line: 1, + column: 16, + endLine: 1, + endColumn: 27 } ] }, @@ -57,7 +61,11 @@ tester.run('static-class-names-order', rule, { `, errors: [ { - message: 'Classes should be ordered alphabetically.' + message: 'Classes should be ordered alphabetically.', + line: 2, + column: 16, + endLine: 2, + endColumn: 29 } ] } From e4be0c07536bddc53c69bc9c23fa4b71cbdc6a3b Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 19:15:53 +0800 Subject: [PATCH 08/10] Update vue-component.js --- tests/lib/utils/vue-component.js | 64 +++++++++++++++++++------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/tests/lib/utils/vue-component.js b/tests/lib/utils/vue-component.js index e433c2d90..f2cce4331 100644 --- a/tests/lib/utils/vue-component.js +++ b/tests/lib/utils/vue-component.js @@ -26,10 +26,13 @@ const languageOptions = { sourceType: 'module' } -function makeError(line) { +function makeError(line, column, endLine, endColumn) { return { message: 'Component detected.', - line + line, + column, + endLine, + endColumn } } @@ -131,37 +134,37 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(4)] + errors: [makeError(4, 19, 4, 21)] }, { filename: `test.${ext}`, code: `Vue.component({})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 15, 1, 17)] }, { filename: `test.${ext}`, code: `Vue.mixin({})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 11, 1, 13)] }, { filename: `test.${ext}`, code: `Vue.extend({})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 12, 1, 14)] }, { filename: `test.${ext}`, code: `app.component('name', {})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 23, 1, 25)] }, { filename: `test.${ext}`, code: `app.mixin({})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 11, 1, 13)] }, { filename: `test.${ext}`, @@ -170,7 +173,7 @@ function invalidTests(ext) { ...languageOptions, parser: require('@typescript-eslint/parser') }, - errors: [makeError(1)] + errors: [makeError(1, 52, 1, 54)] }, { filename: `test.${ext}`, @@ -179,7 +182,7 @@ function invalidTests(ext) { ...languageOptions, parser: require('@typescript-eslint/parser') }, - errors: [makeError(1)] + errors: [makeError(1, 27, 1, 29)] }, { filename: `test.${ext}`, @@ -188,13 +191,13 @@ function invalidTests(ext) { ...languageOptions, parser: require('@typescript-eslint/parser') }, - errors: [makeError(1)] + errors: [makeError(1, 27, 1, 29)] }, { filename: `test.${ext}`, code: `createApp({})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 11, 1, 13)] }, { filename: `test.${ext}`, @@ -204,7 +207,7 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(3)] + errors: [makeError(3, 24, 3, 27)] }, { filename: `test.${ext}`, @@ -214,7 +217,7 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(3)] + errors: [makeError(3, 24, 3, 27)] }, { filename: `test.${ext}`, @@ -227,7 +230,7 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(6)] + errors: [makeError(6, 24, 6, 27)] }, { filename: `test.${ext}`, @@ -239,7 +242,7 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(3), makeError(5)] + errors: [makeError(3, 24, 3, 27), makeError(5, 24, 5, 27)] }, { filename: `test.${ext}`, @@ -251,7 +254,7 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(3), makeError(5)] + errors: [makeError(3, 28, 3, 31), makeError(5, 24, 5, 27)] }, { filename: `test.${ext}`, @@ -262,7 +265,10 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [...(ext === 'js' ? [] : [makeError(2)]), makeError(4)] + errors: [ + ...(ext === 'js' ? [] : [makeError(2, 24, 2, 27)]), + makeError(4, 26, 4, 29) + ] }, { filename: `test.${ext}`, @@ -273,7 +279,7 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(4)] + errors: [makeError(4, 26, 4, 29)] }, { filename: `test.${ext}`, @@ -285,7 +291,7 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [makeError(4)] + errors: [makeError(4, 13, 4, 16)] }, { filename: `test.${ext}`, @@ -300,7 +306,10 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [...(ext === 'js' ? [] : [makeError(3)]), makeError(6)] + errors: [ + ...(ext === 'js' ? [] : [makeError(3, 24, 7, 10)]), + makeError(6, 16, 6, 19) + ] }, { filename: `test.${ext}`, @@ -317,19 +326,22 @@ function invalidTests(ext) { // ${ext} `, languageOptions, - errors: [...(ext === 'js' ? [] : [makeError(2)]), makeError(8)] + errors: [ + ...(ext === 'js' ? [] : [makeError(2, 24, 10, 10)]), + makeError(8, 20, 8, 22) + ] }, { filename: `test.${ext}`, code: `export default defineComponent({})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 32, 1, 34)] }, { filename: `test.${ext}`, code: `export default defineNuxtComponent({})`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 36, 1, 38)] } ] } @@ -352,13 +364,13 @@ ruleTester.run('vue-component', rule, { filename: 'test.vue', code: `export default { }`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 16, 1, 19)] }, { filename: 'test.jsx', code: `export default { }`, languageOptions, - errors: [makeError(1)] + errors: [makeError(1, 16, 1, 19)] }, ...invalidTests('js'), ...invalidTests('jsx'), From 5d6366d94a49b3d5f17ad1db2af29dbbc1b95df7 Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 19:34:31 +0800 Subject: [PATCH 09/10] Update no-restricted-class.js --- tests/lib/rules/no-restricted-class.js | 54 +++++++++++++++++++++----- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/tests/lib/rules/no-restricted-class.js b/tests/lib/rules/no-restricted-class.js index 1a4e606e4..ae94d4af1 100644 --- a/tests/lib/rules/no-restricted-class.js +++ b/tests/lib/rules/no-restricted-class.js @@ -48,7 +48,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 22, + endLine: 1, + endColumn: 41 } ] }, @@ -57,7 +61,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 24, + endLine: 1, + endColumn: 35 } ] }, @@ -66,7 +74,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 25, + endLine: 1, + endColumn: 36 } ] }, @@ -75,7 +87,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 25, + endLine: 1, + endColumn: 34 } ] }, @@ -84,7 +100,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 24, + endLine: 1, + endColumn: 37 } ] }, @@ -93,7 +113,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 24, + endLine: 1, + endColumn: 35 } ] }, @@ -102,7 +126,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 25, + endLine: 1, + endColumn: 36 } ] }, @@ -111,7 +139,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['forbidden'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 25, + endLine: 1, + endColumn: 44 } ] }, @@ -120,7 +152,11 @@ ruleTester.run('no-restricted-class', rule, { options: ['/^for(bidden|gotten)/'], errors: [ { - message: "'forbidden' class is not allowed." + message: "'forbidden' class is not allowed.", + line: 1, + column: 22, + endLine: 1, + endColumn: 41 } ] } From 49352c425063834839cc1e905caca8f31814e1ce Mon Sep 17 00:00:00 2001 From: Vida Xie Date: Thu, 27 Nov 2025 19:38:48 +0800 Subject: [PATCH 10/10] Update no-reserved-component-names.js --- .../lib/rules/no-reserved-component-names.js | 55 +++++++++++++++---- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/tests/lib/rules/no-reserved-component-names.js b/tests/lib/rules/no-reserved-component-names.js index 4db44fe52..09d9a6f64 100644 --- a/tests/lib/rules/no-reserved-component-names.js +++ b/tests/lib/rules/no-reserved-component-names.js @@ -608,7 +608,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 3 + line: 3, + column: 19, + endLine: 3, + endColumn: 19 + name.length + 2 } ] })), @@ -622,7 +625,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 1 + line: 1, + column: 15, + endLine: 1, + endColumn: 15 + name.length + 2 } ] })), @@ -636,7 +642,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 1 + line: 1, + column: 15, + endLine: 1, + endColumn: 15 + name.length + 2 } ] })), @@ -650,7 +659,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 1 + line: 1, + column: 15, + endLine: 1, + endColumn: 15 + name.length + 2 } ] })), @@ -664,7 +676,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 1 + line: 1, + column: 15, + endLine: 1, + endColumn: 15 + name.length + 2 } ] })), @@ -682,7 +697,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 3 + line: 3, + column: 13, + endLine: 3, + endColumn: 13 + name.length + 6 } ] })), @@ -699,7 +717,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 1 + line: 1, + column: 37, + endLine: 1, + endColumn: 37 + name.length + 2 } ] })), @@ -717,7 +738,10 @@ ruleTester.run('no-reserved-component-names', rule, { ? 'reservedInHtml' : 'reserved', data: { name }, - line: 1 + line: 1, + column: 37, + endLine: 1, + endColumn: 37 + name.length + 2 } ] })), @@ -734,7 +758,10 @@ ruleTester.run('no-reserved-component-names', rule, { { messageId: 'reservedInVue', data: { name }, - line: 3 + line: 3, + column: 19, + endLine: 3, + endColumn: 19 + name.length + 2 } ] })), @@ -751,7 +778,10 @@ ruleTester.run('no-reserved-component-names', rule, { { messageId: 'reservedInVue', data: { name }, - line: 3 + line: 3, + column: 19, + endLine: 3, + endColumn: 19 + name.length + 2 } ] })), @@ -768,7 +798,10 @@ ruleTester.run('no-reserved-component-names', rule, { { messageId: 'reservedInVue3', data: { name }, - line: 3 + line: 3, + column: 19, + endLine: 3, + endColumn: 19 + name.length + 2 } ] }))