Eslint updates (#1281)

* eslint: Update eslintrc

* eslint: Strings must use singlequote  quotes

* eslint: expected { after if-condition

* eslint: update warnings

* a little cleanup

* remove conflicted file

---------

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
zio/stable
Eric Bailey 2023-08-25 10:48:38 -05:00 committed by GitHub
parent a0dca81a74
commit b15a435069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 5 deletions

View File

@ -9,6 +9,7 @@ module.exports = {
plugins: ['@typescript-eslint', 'detox'], plugins: ['@typescript-eslint', 'detox'],
ignorePatterns: [ ignorePatterns: [
'**/__mocks__/*.ts', '**/__mocks__/*.ts',
'src/platform/polyfills.ts',
'src/third-party', 'src/third-party',
'ios', 'ios',
'android', 'android',
@ -25,6 +26,7 @@ module.exports = {
files: ['*.js', '*.mjs', '*.ts', '*.tsx'], files: ['*.js', '*.mjs', '*.ts', '*.tsx'],
rules: { rules: {
semi: [2, 'never'], semi: [2, 'never'],
'react-native/no-inline-styles': 0,
}, },
}, },
], ],

View File

@ -118,10 +118,10 @@ function Modal({modal}: {modal: ModalIface}) {
} }
return ( return (
// eslint-disable-next-line // eslint-disable-next-line react-native-a11y/has-valid-accessibility-descriptors
<TouchableWithoutFeedback onPress={onPressMask}> <TouchableWithoutFeedback onPress={onPressMask}>
<View style={styles.mask}> <View style={styles.mask}>
{/* eslint-disable-next-line */} {/* eslint-disable-next-line react-native-a11y/has-valid-accessibility-descriptors */}
<TouchableWithoutFeedback onPress={onInnerPress}> <TouchableWithoutFeedback onPress={onInnerPress}>
<View <View
style={[ style={[

View File

@ -21,7 +21,7 @@ export const Component = observer(({did}: {did: string}) => {
const {screen} = useAnalytics() const {screen} = useAnalytics()
// track the navigator state to detect if a page-load occurred // track the navigator state to detect if a page-load occurred
const navState = useNavigationState(s => s) const navState = useNavigationState(state => state)
const [initNavState] = useState(navState) const [initNavState] = useState(navState)
const isLoading = initNavState !== navState const isLoading = initNavState !== navState

View File

@ -3,10 +3,12 @@ import {AlertButton, AlertStatic} from 'react-native'
class WebAlert implements Pick<AlertStatic, 'alert'> { class WebAlert implements Pick<AlertStatic, 'alert'> {
public alert(title: string, message?: string, buttons?: AlertButton[]): void { public alert(title: string, message?: string, buttons?: AlertButton[]): void {
if (buttons === undefined || buttons.length === 0) { if (buttons === undefined || buttons.length === 0) {
// eslint-disable-next-line no-alert
window.alert([title, message].filter(Boolean).join('\n')) window.alert([title, message].filter(Boolean).join('\n'))
return return
} }
// eslint-disable-next-line no-alert
const result = window.confirm([title, message].filter(Boolean).join('\n')) const result = window.confirm([title, message].filter(Boolean).join('\n'))
if (result === true) { if (result === true) {

View File

@ -174,8 +174,8 @@ export function Selector({
<View <View
style={[pal.view, styles.outer]} style={[pal.view, styles.outer]}
onLayout={e => { onLayout={e => {
const {height} = e.nativeEvent.layout const {height: layoutHeight} = e.nativeEvent.layout
setHeight(height || 60) setHeight(layoutHeight || 60)
}}> }}>
{items.map((item, i) => { {items.map((item, i) => {
const selected = i === selectedIndex const selected = i === selectedIndex