2024-04-10 20:36:37 +02:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
exports.create = function create(context) {
|
|
|
|
return {
|
|
|
|
ImportSpecifier(node) {
|
|
|
|
if (
|
|
|
|
!node.local ||
|
|
|
|
node.local.type !== 'Identifier' ||
|
|
|
|
node.local.name !== 'useGate'
|
|
|
|
) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
node.parent.type !== 'ImportDeclaration' ||
|
|
|
|
!node.parent.source ||
|
|
|
|
node.parent.source.type !== 'Literal'
|
|
|
|
) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
const source = node.parent.source.value
|
2024-04-12 00:59:02 +02:00
|
|
|
if (source.startsWith('statsig') || source.startsWith('@statsig')) {
|
|
|
|
context.report({
|
|
|
|
node,
|
|
|
|
message:
|
|
|
|
"Use useGate() from '#/lib/statsig/statsig' instead of the one on npm.",
|
|
|
|
})
|
2024-04-10 20:36:37 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|