Skip to content

Commit aa3f443

Browse files
committed
fix linting
1 parent 8c5001a commit aa3f443

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

template/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
* @format
33
*/
44

5-
import { AppRegistry } from "react-native";
6-
import App from "./App";
7-
import { name as appName } from "./app.json";
8-
import { store } from "./src/app/store";
9-
import { Provider } from "react-redux";
10-
import React from "react";
5+
import {AppRegistry} from 'react-native';
6+
import App from './App';
7+
import {name as appName} from './app.json';
8+
import {store} from './src/app/store';
9+
import {Provider} from 'react-redux';
10+
import React from 'react';
1111

1212
AppRegistry.registerComponent(appName, () => () => (
1313
<Provider store={store}>

template/src/components/AsyncButton.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function AsyncButton({
3535
toValue: 0,
3636
duration: 200,
3737
useNativeDriver: false,
38-
})
38+
}),
3939
]).start();
4040
};
4141

@@ -52,10 +52,12 @@ export function AsyncButton({
5252

5353
return (
5454
<Pressable style={style} onPress={_onPress} {...restProps}>
55-
<View style={StyleSheet.absoluteFill}>
56-
<Animated.View style={[styles.progress, progressStyle]} />
57-
</View>
58-
{children}
55+
<>
56+
<View style={StyleSheet.absoluteFill}>
57+
<Animated.View style={[styles.progress, progressStyle]} />
58+
</View>
59+
{children}
60+
</>
5961
</Pressable>
6062
);
6163
}

template/src/features/counter/Counter.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function Counter() {
2121

2222
// The `state` arg is correctly typed as `RootState` already
2323
const count = useAppSelector(selectCount);
24-
const status = useAppSelector((state) => state.counter.status);
24+
const status = useAppSelector(state => state.counter.status);
2525
const dispatch = useAppDispatch();
2626

2727
return (
@@ -79,6 +79,7 @@ const styles = StyleSheet.create({
7979
fontSize: 78,
8080
paddingHorizontal: 16,
8181
marginTop: 2,
82+
color: 'rgb(112, 76, 182)',
8283
},
8384
button: {
8485
backgroundColor: 'rgba(112, 76, 182, 0.1)',
@@ -101,5 +102,6 @@ const styles = StyleSheet.create({
101102
marginRight: 8,
102103
borderWidth: 1,
103104
justifyContent: 'center',
105+
color: 'rgb(112, 76, 182)',
104106
},
105107
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function fetchCount(currentCount = 0, amount = 1) {
2-
return new Promise<{data: number}>((resolve) =>
2+
return new Promise<{data: number}>(resolve =>
33
setTimeout(() => resolve({data: currentCount + amount}), 1000),
44
);
55
}

template/src/features/counter/counterSlice.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ export const counterSlice = createSlice({
3030
name: 'counter',
3131
initialState,
3232
reducers: {
33-
increment: (state) => {
33+
increment: state => {
3434
// Redux Toolkit allows us to write "mutating" logic in reducers. It
3535
// doesn't actually mutate the state because it uses the Immer library,
3636
// which detects changes to a "draft state" and produces a brand new
3737
// immutable state based off those changes
3838
state.value += 1;
3939
},
40-
decrement: (state) => {
40+
decrement: state => {
4141
state.value -= 1;
4242
},
4343
// Use the PayloadAction type to declare the contents of `action.payload`
4444
incrementByAmount: (state, action: PayloadAction<number>) => {
4545
state.value += action.payload;
4646
},
4747
},
48-
extraReducers: (builder) => {
48+
extraReducers: builder => {
4949
builder
50-
.addCase(incrementAsync.pending, (state) => {
50+
.addCase(incrementAsync.pending, state => {
5151
state.status = 'loading';
5252
})
5353
.addCase(incrementAsync.fulfilled, (state, action) => {

0 commit comments

Comments
 (0)