Skip to content

Commit

Permalink
added import sort rules for eslint (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
mylesdomingo authored Oct 7, 2021
1 parent 598ed36 commit be69293
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 19 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@
"ts": "never",
"tsx": "never"
}
],
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
}
}
7 changes: 4 additions & 3 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';

import { StatusBar } from 'expo-status-bar';
import { Provider as PaperProvider } from 'react-native-paper';
import { SafeAreaProvider } from 'react-native-safe-area-context';

import Navigation from 'navigation/index';
import useCachedResources from 'hooks/useCachedResources';
import useTheme from 'hooks/useTheme';
import Navigation from 'navigation/index';

export default function App() {
const isLoadingComplete = useCachedResources();
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/EditScreenInfo.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';

import { cleanup, render } from '@testing-library/react-native';

import EditScreenInfo from 'components/EditScreenInfo';
Expand Down
3 changes: 2 additions & 1 deletion src/components/EditScreenInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as WebBrowser from 'expo-web-browser';
import React from 'react';

import * as WebBrowser from 'expo-web-browser';
import { StyleSheet, TouchableOpacity, View } from 'react-native';
import { Text } from 'react-native-paper';

Expand Down
1 change: 1 addition & 0 deletions src/components/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import { FontAwesome } from '@expo/vector-icons';
import { StyleSheet, Pressable } from 'react-native';

Expand Down
1 change: 1 addition & 0 deletions src/components/StyledText.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import { Text } from 'react-native-paper';

interface TextProps {
Expand Down
1 change: 1 addition & 0 deletions src/components/ViewContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import { StyleSheet, View } from 'react-native';

const styles = StyleSheet.create({
Expand Down
5 changes: 3 additions & 2 deletions src/database/firebase.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import firebase from 'firebase';
import 'firebase/firestore';
import {
API_KEY,
AUTH_DOMAIN,
Expand All @@ -8,6 +6,9 @@ import {
MESSAGING_SENDER_ID,
APP_ID,
} from '@env';
import firebase from 'firebase';
import 'firebase/firestore';

import { Tree, Comment, Additional } from '@types';

const config = {
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useCachedResources.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from 'react';

import { FontAwesome } from '@expo/vector-icons';
import * as Font from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import * as React from 'react';

const spaceMono = require('assets/fonts/SpaceMono-Regular.ttf');

Expand Down
13 changes: 6 additions & 7 deletions src/navigation/TabNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import * as React from 'react';

import Colors from 'constants/Colors';
import HomeScreen from 'src/screens/HomeScreen';
import TreeScreen from 'src/screens/TreeScreen';
import LoginScreen from 'src/screens/LoginScreen';
import AddScreen from 'src/screens/AddScreen';
import { RootTabParamList, RootTabScreenProps } from '@types';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';

import { RootTabParamList, RootTabScreenProps } from '@types';
import Icon from 'components/Icon';
import AddScreen from 'src/screens/AddScreen';
import HomeScreen from 'src/screens/HomeScreen';
import LoginScreen from 'src/screens/LoginScreen';
import TreeScreen from 'src/screens/TreeScreen';

/**
* A bottom tab navigator displays tab buttons on the bottom of the display to switch screens.
Expand Down
5 changes: 3 additions & 2 deletions src/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
*
*/
import * as React from 'react';

import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

import { RootStackParamList } from '@types';
import ModalScreen from 'screens/ModalScreen';
import NotFoundScreen from 'screens/NotFoundScreen';
import { RootStackParamList } from '@types';
import LinkingConfiguration from './LinkingConfiguration';

import LinkingConfiguration from './LinkingConfiguration';
import TabNavigator from './TabNavigator';

/**
Expand Down
1 change: 1 addition & 0 deletions src/screens/AddScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import { StyleSheet, View } from 'react-native';
import { Title } from 'react-native-paper';

Expand Down
1 change: 1 addition & 0 deletions src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import { StyleSheet, View } from 'react-native';
import { Title } from 'react-native-paper';

Expand Down
1 change: 1 addition & 0 deletions src/screens/LoginScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import { StyleSheet, View } from 'react-native';
import { Title } from 'react-native-paper';

Expand Down
3 changes: 2 additions & 1 deletion src/screens/ModalScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { StatusBar } from 'expo-status-bar';
import * as React from 'react';

import { StatusBar } from 'expo-status-bar';
import { Platform, StyleSheet, View } from 'react-native';
import { Title } from 'react-native-paper';

Expand Down
5 changes: 3 additions & 2 deletions src/screens/NotFoundScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from 'react';
import { StyleSheet, TouchableOpacity } from 'react-native';
import { Title, Text } from 'react-native-paper';

import PropTypes from 'prop-types';
import { StyleSheet, TouchableOpacity } from 'react-native';
import { Text, Title } from 'react-native-paper';

import { RootStackScreenProps } from '@types';
import ViewContainer from 'src/components/ViewContainer';
Expand Down
1 change: 1 addition & 0 deletions src/screens/TreeScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import { StyleSheet, View } from 'react-native';
import { Title } from 'react-native-paper';

Expand Down

0 comments on commit be69293

Please sign in to comment.