Skip to content

Commit

Permalink
Also update eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Nov 4, 2022
1 parent 90c131f commit 335e1bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .eslintplugin/code-no-unexternalized-strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,16 @@ export = new class NoUnexternalizedStrings implements eslint.Rule.RuleModule {
return {
['Literal']: (node: any) => collectDoubleQuotedStrings(node),
['ExpressionStatement[directive] Literal:exit']: (node: any) => doubleQuotedStringLiterals.delete(node),

// localize(...)
['CallExpression[callee.type="MemberExpression"][callee.object.name="nls"][callee.property.name="localize"]:exit']: (node: any) => visitLocalizeCall(node),

// vscode.l10n.t(...)
['CallExpression[callee.type="MemberExpression"][callee.object.property.name="l10n"][callee.property.name="t"]:exit']: (node: any) => visitL10NCall(node),

// l10n.t(...)
['CallExpression[callee.object.name="l10n"][callee.property.name="t"]:exit']: (node: any) => visitL10NCall(node),

['CallExpression[callee.name="localize"][arguments.length>=2]:exit']: (node: any) => visitLocalizeCall(node),
['Program:exit']: reportBadStringsAndBadKeys,
};
Expand Down

0 comments on commit 335e1bd

Please sign in to comment.