Skip to content

Commit

Permalink
more prettier and lint cleanup (bluesky-social#82)
Browse files Browse the repository at this point in the history
* more prettier and lint cleanup

* Fixes more lint issues

* lint

* ignore more files

* remove todos

* lint
  • Loading branch information
arrygoo authored Jan 24, 2023
1 parent 9027882 commit 3a90114
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 25 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ module.exports = {
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
ignorePatterns: ['**/__mocks__/*.ts', 'src/third-party', 'ios', 'android'],
ignorePatterns: [
'**/__mocks__/*.ts',
'src/third-party',
'ios',
'android',
'coverage',
],
overrides: [
{
files: ['*.js', '*.mjs', '*.ts', '*.tsx'],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
- name: Yarn install
run: yarn
- name: Run tests
run: |
run: |
yarn test --forceExit
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ios
android
src/third-party
src/app.json
public
8 changes: 1 addition & 7 deletions src/state/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ import {AtUri} from '../../third-party/uri'
import {RootStoreModel} from '../models/root-store'
import {extractEntities} from '../../lib/strings'
import {isNetworkError} from '../../lib/errors'
import {downloadAndResize} from '../../lib/images'
import {
getLikelyType,
LikelyType,
getLinkMeta,
LinkMeta,
} from '../../lib/link-meta'
import {LinkMeta} from '../../lib/link-meta'
import {Image} from '../../lib/images'

const TIMEOUT = 10e3 // 10s
Expand Down
1 change: 0 additions & 1 deletion src/view/com/composer/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from 'react-native'
import {useAnimatedValue} from '../../lib/hooks/useAnimatedValue'
import {Text} from '../util/text/Text'
import {colors} from '../../lib/styles'
import {usePalette} from '../../lib/hooks/usePalette'

interface AutocompleteItem {
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/modals/ReportAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ITEMS: RadioGroupItem[] = [

export const snapPoints = ['50%']

export function Component({did}: {did: string}) {
export function Component() {
const store = useStores()
const [isProcessing, setIsProcessing] = useState<boolean>(false)
const [error, setError] = useState<string>('')
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/modals/ReportPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ITEMS: RadioGroupItem[] = [

export const snapPoints = ['50%']

export function Component({postUrl}: {postUrl: string}) {
export function Component() {
const store = useStores()
const [isProcessing, setIsProcessing] = useState<boolean>(false)
const [error, setError] = useState<string>('')
Expand Down
8 changes: 1 addition & 7 deletions src/view/com/modals/ServerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ import {LOGIN_INCLUDE_DEV_SERVERS} from '../../../build-flags'

export const snapPoints = ['80%']

export function Component({
initialService,
onSelect,
}: {
initialService: string
onSelect: (url: string) => void
}) {
export function Component({onSelect}: {onSelect: (url: string) => void}) {
const store = useStores()
const [customUrl, setCustomUrl] = useState<string>('')

Expand Down
2 changes: 0 additions & 2 deletions src/view/com/util/UserBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import {
} from 'react-native-image-crop-picker'

export function UserBanner({
handle,
banner,
onSelectNewBanner,
}: {
handle: string
banner?: string | null
onSelectNewBanner?: (img: PickedImage) => void
}) {
Expand Down
2 changes: 0 additions & 2 deletions src/view/com/util/UserInfoText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function UserInfoText({
type = 'md',
did,
attr,
loading,
failed,
prefix,
style,
Expand All @@ -27,7 +26,6 @@ export function UserInfoText({
asLink?: boolean
}) {
attr = attr || 'handle'
loading = loading || '...'
failed = failed || 'user'

const store = useStores()
Expand Down
2 changes: 1 addition & 1 deletion src/view/screens/Contacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ScreenParams} from '../routes'
import {useStores} from '../../state'
import {useAnimatedValue} from '../lib/hooks/useAnimatedValue'

export const Contacts = ({navIdx, visible, params}: ScreenParams) => {
export const Contacts = ({navIdx, visible}: ScreenParams) => {
const store = useStores()
const selectorInterp = useAnimatedValue(0)

Expand Down
1 change: 0 additions & 1 deletion src/view/shell/mobile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export const MobileShell: React.FC = observer(() => {
const scrollElRef = useRef<FlatList | undefined>()
const winDim = useWindowDimensions()
const [menuSwipingDirection, setMenuSwipingDirection] = useState(0)
const constZeroInterp = useAnimatedValue(0)
const swipeGestureInterp = useAnimatedValue(0)
const minimalShellInterp = useAnimatedValue(0)
const tabMenuInterp = useAnimatedValue(0)
Expand Down

0 comments on commit 3a90114

Please sign in to comment.