diff --git a/lib/rules/syntaxes/slot-attribute.js b/lib/rules/syntaxes/slot-attribute.js index 1ce27484d..8b4392746 100644 --- a/lib/rules/syntaxes/slot-attribute.js +++ b/lib/rules/syntaxes/slot-attribute.js @@ -23,8 +23,8 @@ module.exports = { return true } const slotName = slotAttr.value.value - // If non-Latin characters are included it can not be converted. - return !/[^a-z]/i.test(slotName) + // If other than alphanumeric, underscore and hyphen characters are included it can not be converted. + return !/[^\w\-]/u.test(slotName) } /** diff --git a/tests/lib/rules/no-deprecated-slot-attribute.js b/tests/lib/rules/no-deprecated-slot-attribute.js index 4d75508a4..ab08c4aff 100644 --- a/tests/lib/rules/no-deprecated-slot-attribute.js +++ b/tests/lib/rules/no-deprecated-slot-attribute.js @@ -348,6 +348,63 @@ tester.run('no-deprecated-slot-attribute', rule, { line: 4 } ] + }, + { + code: ` + `, + output: ` + `, + errors: ['`slot` attributes are deprecated.'] + }, + { + code: ` + `, + output: ` + `, + errors: ['`slot` attributes are deprecated.'] + }, + { + code: ` + `, + output: ` + `, + errors: ['`slot` attributes are deprecated.'] } ] })