mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 10:40:41 +00:00
relax and allow double quoted strings appearing inside localize call
This commit is contained in:
parent
c9179d1e6a
commit
9fefd2b6fb
|
@ -39,6 +39,7 @@ module.exports = new (_a = class NoUnexternalizedStrings {
|
|||
// extract key so that it can be checked later
|
||||
let key;
|
||||
if (isStringLiteral(keyNode)) {
|
||||
doubleQuotedStringLiterals.delete(keyNode); //todo@joh reconsider
|
||||
key = keyNode.value;
|
||||
}
|
||||
else if (keyNode.type === experimental_utils_1.AST_NODE_TYPES.ObjectExpression) {
|
||||
|
@ -46,6 +47,7 @@ module.exports = new (_a = class NoUnexternalizedStrings {
|
|||
if (property.type === experimental_utils_1.AST_NODE_TYPES.Property && !property.computed) {
|
||||
if (property.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier && property.key.name === 'key') {
|
||||
if (isStringLiteral(property.value)) {
|
||||
doubleQuotedStringLiterals.delete(property.value); //todo@joh reconsider
|
||||
key = property.value.value;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ export = new class NoUnexternalizedStrings implements eslint.Rule.RuleModule {
|
|||
// extract key so that it can be checked later
|
||||
let key: string | undefined;
|
||||
if (isStringLiteral(keyNode)) {
|
||||
doubleQuotedStringLiterals.delete(keyNode); //todo@joh reconsider
|
||||
key = keyNode.value;
|
||||
|
||||
} else if (keyNode.type === AST_NODE_TYPES.ObjectExpression) {
|
||||
|
@ -56,6 +57,7 @@ export = new class NoUnexternalizedStrings implements eslint.Rule.RuleModule {
|
|||
if (property.type === AST_NODE_TYPES.Property && !property.computed) {
|
||||
if (property.key.type === AST_NODE_TYPES.Identifier && property.key.name === 'key') {
|
||||
if (isStringLiteral(property.value)) {
|
||||
doubleQuotedStringLiterals.delete(property.value); //todo@joh reconsider
|
||||
key = property.value.value;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue