Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update eslint #3356

Merged
merged 18 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"browser": true
},

"extends": ["@callstack"],

"plugins": ["react-native"],
thymikee marked this conversation as resolved.
Show resolved Hide resolved
"extends": "@callstack",

"rules": {
"one-var": "off",
Expand All @@ -19,7 +17,8 @@

"react-native/no-unused-styles": "error",
"react-native/split-platform-components": "off",
"react-native/no-raw-text": "off"
"react-native/no-raw-text": "off",
"react-native-a11y/has-valid-accessibility-descriptors": "off"
},

"settings": {
Expand Down
8 changes: 6 additions & 2 deletions docs/pages/src/Showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Header } from 'component-docs/components';

import GooglePlayIcon from '../../components/google-play-icon';
import IphoneIcon from '../../components/iphone-icon';
import Content from './components/Content';
import GithubIcon from '../../components/github-icon';
import Content from './components/Content';

type Data = {
color: string,
Expand Down Expand Up @@ -190,7 +190,11 @@ export default class Showcase extends React.Component<{}> {
return (
<div key={item.image}>
<ImageContainer>
<Image src={item.image} alt="" />
<Image
src={item.image}
alt=""
accessibilityIgnoresInvertColors={true}
jaworek marked this conversation as resolved.
Show resolved Hide resolved
/>
<Info style={{ backgroundColor: item.color }}>
<AppName
style={{
Expand Down
2 changes: 1 addition & 1 deletion example/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../.eslintrc",

"settings": {
"import/core-modules": [ "react-native-paper" ]
"import/core-modules": ["react-native-paper"]
},

"rules": {
Expand Down
6 changes: 3 additions & 3 deletions example/src/DrawerItems.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import * as React from 'react';
import { View, StyleSheet, I18nManager } from 'react-native';
import { DrawerContentScrollView } from '@react-navigation/drawer';
import {
Badge,
Drawer,
Expand All @@ -11,6 +8,9 @@ import {
useTheme,
MD3Colors,
} from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet, I18nManager } from 'react-native';
import { DrawerContentScrollView } from '@react-navigation/drawer';
Drakeoon marked this conversation as resolved.
Show resolved Hide resolved
import * as Updates from 'expo-updates';
import { isWeb } from '../utils';
import { PreferencesContext } from './';
Expand Down
2 changes: 1 addition & 1 deletion example/src/ExampleList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { List, Divider, useTheme } from 'react-native-paper';
import * as React from 'react';
import { FlatList } from 'react-native';
import { List, Divider, useTheme } from 'react-native-paper';
import { useSafeArea } from 'react-native-safe-area-context';
import type { StackNavigationProp } from '@react-navigation/stack';

Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/ActivityIndicatorExample.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import {
ActivityIndicator,
MD2Colors,
FAB,
useTheme,
MD3Colors,
} from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import ScreenWrapper from '../ScreenWrapper';

const ActivityIndicatorExample = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import * as React from 'react';
import { View, StyleSheet, FlatList, Animated, Platform } from 'react-native';
import type { NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
import {
MD2Colors,
MD3Colors,
Expand All @@ -9,6 +6,9 @@ import {
Paragraph,
Text,
} from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet, FlatList, Animated, Platform } from 'react-native';
import type { NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { animatedFABExampleData } from '../../../utils';
import CustomFAB from './CustomFAB';
Expand Down
2 changes: 1 addition & 1 deletion example/src/Examples/AnimatedFABExample/CustomFAB.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AnimatedFAB, useTheme } from 'react-native-paper';
import React from 'react';
import {
StyleProp,
Expand All @@ -6,7 +7,6 @@ import {
StyleSheet,
Platform,
} from 'react-native';
import { AnimatedFAB, useTheme } from 'react-native-paper';

type CustomFABProps = {
animatedValue: Animated.Value;
Expand Down
5 changes: 3 additions & 2 deletions example/src/Examples/AnimatedFABExample/CustomFABControls.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { StyleSheet, View, FlatList } from 'react-native';
import { Paragraph, RadioButton, Text, useTheme } from 'react-native-paper';
import type {
AnimatedFABAnimateFrom,
AnimatedFABIconMode,
} from 'react-native-paper';
import React from 'react';
import { StyleSheet, View, FlatList } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler';

export type Controls = {
Expand Down Expand Up @@ -45,6 +45,7 @@ const CustomControl = ({

return (
<TouchableOpacity
accessibilityRole="button"
onPress={() => onChange(item)}
style={styles.controlItem}
>
Expand Down
8 changes: 4 additions & 4 deletions example/src/Examples/AppbarExample.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import * as React from 'react';
import { View, Platform, StyleSheet } from 'react-native';
import type { StackNavigationProp } from '@react-navigation/stack';
import {
Appbar,
FAB,
Expand All @@ -11,9 +8,12 @@ import {
RadioButton,
List,
} from 'react-native-paper';
import * as React from 'react';
import { View, Platform, StyleSheet } from 'react-native';
import type { StackNavigationProp } from '@react-navigation/stack';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import ScreenWrapper from '../ScreenWrapper';
import { yellowA200 } from '../../../src/styles/themes/v2/colors';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

type Props = {
navigation: StackNavigationProp<{}>;
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/AvatarExample.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import {
Avatar,
List,
MD2Colors,
MD3Colors,
useTheme,
} from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import ScreenWrapper from '../ScreenWrapper';

const AvatarExample = () => {
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/BadgeExample.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import {
Badge,
IconButton,
Expand All @@ -10,6 +8,8 @@ import {
useTheme,
MD3Colors,
} from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import ScreenWrapper from '../ScreenWrapper';

const BadgeExample = () => {
Expand Down
10 changes: 7 additions & 3 deletions example/src/Examples/BannerExample.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { View, StyleSheet, Image, Dimensions, Platform } from 'react-native';
import {
Banner,
FAB,
useTheme,
MD2Colors,
MD3Colors,
} from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet, Image, Dimensions, Platform } from 'react-native';
import ScreenWrapper from '../ScreenWrapper';

const PHOTOS = Array.from({ length: 24 }).map(
Expand Down Expand Up @@ -67,7 +67,11 @@ const BannerExample = () => {
<View style={styles.grid}>
{PHOTOS.map((uri) => (
<View key={uri} style={styles.item}>
<Image source={{ uri }} style={styles.photo} />
<Image
source={{ uri }}
style={styles.photo}
accessibilityIgnoresInvertColors={true}
jaworek marked this conversation as resolved.
Show resolved Hide resolved
/>
</View>
))}
</View>
Expand Down
10 changes: 7 additions & 3 deletions example/src/Examples/BottomNavigationExample.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Appbar, BottomNavigation, Menu, useTheme } from 'react-native-paper';
import * as React from 'react';
import {
View,
Expand All @@ -7,10 +8,9 @@ import {
Platform,
Easing,
} from 'react-native';
import { Appbar, BottomNavigation, Menu, useTheme } from 'react-native-paper';
import ScreenWrapper from '../ScreenWrapper';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import type { StackNavigationProp } from '@react-navigation/stack';
import ScreenWrapper from '../ScreenWrapper';

type RoutesState = Array<{
key: string;
Expand Down Expand Up @@ -40,7 +40,11 @@ const PhotoGallery = ({ route }: Route) => {
<ScreenWrapper contentContainerStyle={styles.content}>
{PHOTOS.map((uri) => (
<View key={uri} style={styles.item}>
<Image source={{ uri }} style={styles.photo} />
<Image
source={{ uri }}
style={styles.photo}
accessibilityIgnoresInvertColors={true}
jaworek marked this conversation as resolved.
Show resolved Hide resolved
/>
</View>
))}
</ScreenWrapper>
Expand Down
3 changes: 2 additions & 1 deletion example/src/Examples/ButtonExample.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, List, useTheme } from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet, Image } from 'react-native';
import { Button, List, useTheme } from 'react-native-paper';
import ScreenWrapper from '../ScreenWrapper';

const ButtonExample = () => {
Expand Down Expand Up @@ -263,6 +263,7 @@ const ButtonExample = () => {
<Image
source={require('../../assets/images/chameleon.jpg')}
style={{ width: size, height: size, borderRadius: size / 2 }}
accessibilityIgnoresInvertColors={true}
/>
)}
onPress={() => {}}
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/CardExample.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from 'react';
import { Alert, ScrollView, StyleSheet, View } from 'react-native';
import {
Avatar,
Paragraph,
Expand All @@ -10,6 +8,8 @@ import {
Chip,
Text,
} from 'react-native-paper';
import * as React from 'react';
import { Alert, ScrollView, StyleSheet, View } from 'react-native';
import { PreferencesContext } from '..';
import ScreenWrapper from '../ScreenWrapper';
import { isWeb } from '../../utils';
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/CheckboxExample.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import {
Paragraph,
Text,
Expand All @@ -9,6 +7,8 @@ import {
TouchableRipple,
useTheme,
} from 'react-native-paper';
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import ScreenWrapper from '../ScreenWrapper';

const CheckboxExample = () => {
Expand Down
2 changes: 1 addition & 1 deletion example/src/Examples/CheckboxItemExample.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Checkbox, useTheme } from 'react-native-paper';
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { Checkbox, useTheme } from 'react-native-paper';
import ScreenWrapper from '../ScreenWrapper';

const CheckboxExample = () => {
Expand Down
Loading