@channel.io/eslint-plugin
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -7,2 +7,3 @@ const hooksDepsElementNewline = require('./rules/hooks-deps-element-newline') | ||
const pascalCaseTypeName = require('./rules/pascal-case-type-name') | ||
const preventDestructuredArgumentCallbackInIntersectionObserver = require('./rules/prevent-destructured-argument-callback-in-intersection-observer') | ||
@@ -17,3 +18,4 @@ module.exports = { | ||
'pascal-case-type-name': pascalCaseTypeName, | ||
'prevent-destructured-argument-callback-in-intersection-observer': preventDestructuredArgumentCallbackInIntersectionObserver, | ||
}, | ||
} |
{ | ||
"name": "@channel.io/eslint-plugin", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "eslint plugin for channel.io web", | ||
@@ -5,0 +5,0 @@ "author": "Channel Corp.", |
@@ -23,9 +23,10 @@ module.exports = { | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const translateFuncNames = context.options[0]?.translateFuncNames || ['translate'] | ||
return { | ||
CallExpression(node) { | ||
const { callee, arguments: args } = node | ||
const { callee } = node | ||
if ( | ||
translateFuncNames.includes(callee.name) && | ||
args[0].type === 'TemplateLiteral' | ||
sourceCode.getTokens(node).some(token => token.type === 'Template') | ||
) { | ||
@@ -32,0 +33,0 @@ context.report({ |
13595
297