File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,19 @@ module.exports = {
71
71
'simple-import-sort/exports' : 'warn' ,
72
72
// TODO: Reenable when we figure out why it gets stuck on CI.
73
73
// 'react-compiler/react-compiler': 'error',
74
+ 'no-restricted-imports' : [
75
+ 'error' ,
76
+ {
77
+ paths : [
78
+ {
79
+ name : '@atproto/api' ,
80
+ importNames : [ 'moderatePost' ] ,
81
+ message :
82
+ 'Please use `moderatePost_wrapped` from `#/lib/moderatePost_wrapped` instead.' ,
83
+ } ,
84
+ ] ,
85
+ } ,
86
+ ] ,
74
87
} ,
75
88
ignorePatterns : [
76
89
'**/__mocks__/*.ts' ,
Original file line number Diff line number Diff line change 1
- import { moderatePost , BSKY_LABELER_DID } from '@atproto/api'
1
+ /* eslint-disable-next-line no-restricted-imports */
2
+ import { BSKY_LABELER_DID , moderatePost } from '@atproto/api'
2
3
3
4
type ModeratePost = typeof moderatePost
4
5
type Options = Parameters < ModeratePost > [ 1 ]
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import {
13
13
AppBskyEmbedRecordWithMedia ,
14
14
AppBskyFeedDefs ,
15
15
AppBskyFeedPost ,
16
- moderatePost ,
17
16
ModerationDecision ,
18
17
RichText as RichTextAPI ,
19
18
} from '@atproto/api'
@@ -24,6 +23,7 @@ import {useLingui} from '@lingui/react'
24
23
import { useQueryClient } from '@tanstack/react-query'
25
24
26
25
import { HITSLOP_20 } from '#/lib/constants'
26
+ import { moderatePost_wrapped } from '#/lib/moderatePost_wrapped'
27
27
import { s } from '#/lib/styles'
28
28
import { useModerationOpts } from '#/state/preferences/moderation-opts'
29
29
import { useSession } from '#/state/session'
@@ -122,7 +122,7 @@ function QuoteEmbedModerated({
122
122
const moderationOpts = useModerationOpts ( )
123
123
const moderation = React . useMemo ( ( ) => {
124
124
return moderationOpts
125
- ? moderatePost ( viewRecordToPostView ( viewRecord ) , moderationOpts )
125
+ ? moderatePost_wrapped ( viewRecordToPostView ( viewRecord ) , moderationOpts )
126
126
: undefined
127
127
} , [ viewRecord , moderationOpts ] )
128
128
Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-restricted-imports */
1
2
import React from 'react'
2
3
import { View } from 'react-native'
3
4
import {
You can’t perform that action at this time.
0 commit comments