-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Typecheck gates * Lint against untyped useGate() * Alphabetic
- Loading branch information
Showing
6 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'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 | ||
if (source.startsWith('.') || source.startsWith('#')) { | ||
return | ||
} | ||
context.report({ | ||
node, | ||
message: | ||
"Use useGate() from '#/lib/statsig/statsig' instead of the one on npm.", | ||
}) | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import {useGate} from './statsig' | ||
|
||
export const useNewSearchGate = () => useGate('new_search') | ||
export type Gate = | ||
// Keep this alphabetic please. | ||
| 'autoexpand_suggestions_on_profile_follow' | ||
| 'disable_min_shell_on_foregrounding' | ||
| 'disable_poll_on_discover' | ||
| 'new_search' | ||
| 'show_follow_back_label' | ||
| 'start_session_with_following' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters