From 4e98318cd95a0543565cd2955ee3b7132e3dd2c0 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Thu, 1 Jul 2021 11:27:27 +0900 Subject: [PATCH] eslint/prettier --- .eslintrc.js | 4 + .prettierrc.js | 3 +- .watchmanconfig | 2 +- app.json | 2 +- .../AppIcon.appiconset/Contents.json | 46 ++--- ios/SubSonify/Images.xcassets/Contents.json | 6 +- react-native.config.js | 2 +- src/components/ArtistsList.tsx | 29 ++- src/components/FocusableIcon.tsx | 8 +- src/components/NowPlayingLayout.tsx | 149 ++++++++------- src/components/Settings.tsx | 27 +-- src/components/SplashPage.tsx | 25 +-- src/components/common/AlbumArt.tsx | 26 +-- src/components/common/AlbumView.tsx | 153 ++++++++------- src/components/common/ArtistArt.tsx | 71 ++++--- src/components/common/ArtistView.tsx | 9 +- src/components/common/BottomTabBar.tsx | 68 +++---- src/components/common/Button.tsx | 5 +- src/components/common/CoverArt.tsx | 28 ++- src/components/common/GradientBackground.tsx | 5 +- src/components/common/GradientFlatList.tsx | 6 +- src/components/common/GradientScrollView.tsx | 7 +- src/components/common/TopTabContainer.tsx | 5 +- src/components/library/AlbumsTab.tsx | 30 ++- src/components/library/ArtistsTab.tsx | 34 ++-- src/components/library/PlaylistsTab.tsx | 4 +- .../navigation/BottomTabNavigator.tsx | 30 +-- .../navigation/LibraryTopTabNavigator.tsx | 100 ++++------ src/components/navigation/RootNavigator.tsx | 12 +- src/hooks/player.ts | 24 +-- src/hooks/subsonic.ts | 10 +- src/models/music.ts | 8 +- src/models/settings.ts | 2 +- src/playback/service.ts | 8 +- src/state/music.ts | 180 ++++++++++-------- src/state/settings.ts | 4 +- src/storage/asyncstorage.ts | 8 +- src/storage/atomWithAsyncStorage.ts | 4 +- src/storage/music.ts | 13 +- src/styles/colors.ts | 2 +- src/subsonic/api.ts | 46 +++-- src/subsonic/params.ts | 61 +++--- src/subsonic/responses.ts | 18 +- tsconfig.json | 29 ++- 44 files changed, 649 insertions(+), 664 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 40c6dcd..c5ec5e3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,8 @@ module.exports = { root: true, extends: '@react-native-community', + rules: { + 'react-native/no-inline-styles': 0, + radix: 0, + }, }; diff --git a/.prettierrc.js b/.prettierrc.js index 84196d9..c026d20 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,7 +1,8 @@ module.exports = { - bracketSpacing: false, + bracketSpacing: true, jsxBracketSameLine: true, singleQuote: true, trailingComma: 'all', arrowParens: 'avoid', + printWidth: 120, }; diff --git a/.watchmanconfig b/.watchmanconfig index 9e26dfe..0967ef4 100644 --- a/.watchmanconfig +++ b/.watchmanconfig @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/app.json b/app.json index 2aef187..bcfcb1d 100644 --- a/app.json +++ b/app.json @@ -1,4 +1,4 @@ { "name": "SubSonify", "displayName": "SubSonify" -} \ No newline at end of file +} diff --git a/ios/SubSonify/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/SubSonify/Images.xcassets/AppIcon.appiconset/Contents.json index 118c98f..48e64ae 100644 --- a/ios/SubSonify/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/SubSonify/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,38 +1,38 @@ { - "images" : [ + "images": [ { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "idiom": "iphone", + "size": "29x29", + "scale": "2x" }, { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "idiom": "iphone", + "size": "29x29", + "scale": "3x" }, { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "idiom": "iphone", + "size": "40x40", + "scale": "2x" }, { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "idiom": "iphone", + "size": "40x40", + "scale": "3x" }, { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "idiom": "iphone", + "size": "60x60", + "scale": "2x" }, { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "idiom": "iphone", + "size": "60x60", + "scale": "3x" } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" } -} \ No newline at end of file +} diff --git a/ios/SubSonify/Images.xcassets/Contents.json b/ios/SubSonify/Images.xcassets/Contents.json index 2d92bd5..97a8662 100644 --- a/ios/SubSonify/Images.xcassets/Contents.json +++ b/ios/SubSonify/Images.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" } } diff --git a/react-native.config.js b/react-native.config.js index 3d4e0f5..ef09f5b 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -3,5 +3,5 @@ module.exports = { ios: {}, android: {}, }, - assets: ['./assets/fonts'] + assets: ['./assets/fonts'], }; diff --git a/src/components/ArtistsList.tsx b/src/components/ArtistsList.tsx index 2d6eb52..8715682 100644 --- a/src/components/ArtistsList.tsx +++ b/src/components/ArtistsList.tsx @@ -4,31 +4,26 @@ import { useAtomValue } from 'jotai/utils'; import { Artist } from '../models/music'; import { artistsAtom } from '../state/music'; -const ArtistItem: React.FC<{ item: Artist } > = ({ item }) => ( +const ArtistItem: React.FC<{ item: Artist }> = ({ item }) => ( {item.id} - {item.name} + + {item.name} + ); const List = () => { const artists = useAtomValue(artistsAtom); - const renderItem: React.FC<{ item: Artist }> = ({ item }) => ( - - ); + const renderItem: React.FC<{ item: Artist }> = ({ item }) => ; - return ( - item.id} - /> - ); -} + return item.id} />; +}; const ArtistsList = () => ( @@ -36,6 +31,6 @@ const ArtistsList = () => ( -) +); export default ArtistsList; diff --git a/src/components/FocusableIcon.tsx b/src/components/FocusableIcon.tsx index 9705e5e..658add3 100644 --- a/src/components/FocusableIcon.tsx +++ b/src/components/FocusableIcon.tsx @@ -3,21 +3,21 @@ import { Image, ImageSourcePropType } from 'react-native'; import colors from '../styles/colors'; export type FocusableIconProps = { - focused: boolean, + focused: boolean; source: ImageSourcePropType; focusedSource?: ImageSourcePropType; width?: number; height?: number; }; -const FocusableIcon: React.FC = (props) => { +const FocusableIcon: React.FC = props => { props.focusedSource = props.focusedSource || props.source; props.width = props.width || 26; props.height = props.height || 26; return ( = (props) => { source={props.focused ? props.focusedSource : props.source} /> ); -} +}; export default FocusableIcon; diff --git a/src/components/NowPlayingLayout.tsx b/src/components/NowPlayingLayout.tsx index fc6648a..a03086f 100644 --- a/src/components/NowPlayingLayout.tsx +++ b/src/components/NowPlayingLayout.tsx @@ -1,96 +1,103 @@ import React from 'react'; -import { Image, StyleSheet, Text, View } from 'react-native'; +import { StyleSheet, Text, View } from 'react-native'; const NowPlayingLayout = () => { return ( - - - - {/* top bar */} - - - - + {/* top bar */} + + + + Playing from Your Library Songs - + - + - {/* album art */} - - - - + + + + - {/* song/album/artist title */} - - Name of the Song + + Name of the Song Cool Artist - {/* seek bar */} - - - + + - - + + 00:00 00:00 - + - {/* main player controls */} - + @@ -100,13 +107,13 @@ const NowPlayingLayout = () => { - {/* extra controls */} - + @@ -115,7 +122,7 @@ const NowPlayingLayout = () => { ); -} +}; const styles = StyleSheet.create({ text: { diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index cb39dc7..fb48a25 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -14,21 +14,15 @@ const TestControls = () => { const removeAllKeys = async () => { const allKeys = await getAllKeys(); await multiRemove(allKeys); - } + }; return ( -