b1c454f779
- Upgrade eslint from v8 to v9.18.0 - Migrate from .eslintrc.js to eslint.config.mjs (flat config) - Upgrade typescript-eslint to v8.20.0 (unified package) - Replace eslint-plugin-import with eslint-plugin-import-x for flat config support - Add globals package for environment globals - Update eslint-plugin-bsky-internal with proper meta objects for ESLint v9 - Fix deprecated context.getScope() API usage - Update bskyembed to use flat config - Remove deprecated --ext flag from lint scripts - Configure rules to maintain previous behavior while using new ESLint version
42 lines
1007 B
JavaScript
42 lines
1007 B
JavaScript
'use strict'
|
|
|
|
module.exports = {
|
|
meta: {
|
|
type: 'suggestion',
|
|
docs: {
|
|
description:
|
|
'Enforce using internal statsig wrapper instead of npm package',
|
|
},
|
|
schema: [],
|
|
},
|
|
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
|
|
if (source.startsWith('statsig') || source.startsWith('@statsig')) {
|
|
context.report({
|
|
node,
|
|
message:
|
|
"Use useGate() from '#/lib/statsig/statsig' instead of the one on npm.",
|
|
})
|
|
}
|
|
// TODO: Verify gate() call results aren't stored in variables.
|
|
},
|
|
}
|
|
},
|
|
}
|