Skip to content

Commit ca9a77a

Browse files
committed
feat(ci): add prettier to ci
1 parent dafcb4b commit ca9a77a

File tree

6 files changed

+37
-32
lines changed

6 files changed

+37
-32
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
lib/

.eslintrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"@react-native-community",
5+
"prettier"
6+
],
7+
"rules": {
8+
"prettier/prettier": [
9+
"error",
10+
{
11+
"quoteProps": "consistent",
12+
"singleQuote": true,
13+
"tabWidth": 2,
14+
"trailingComma": "es5",
15+
"useTabs": false
16+
}
17+
],
18+
"no-alert": "off"
19+
}
20+
}

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: ./.github/actions/setup
1919

2020
- name: Lint files
21-
run: yarn lint
21+
run: yarn lint --max-warnings=0
2222

2323
- name: Typecheck files
2424
run: |
@@ -28,6 +28,9 @@ jobs:
2828
run: |
2929
yarn expo:typecheck
3030
31+
- name: Format check
32+
run: yarn prettier --check
33+
3134
# no tests yet 😥
3235
# test:
3336
# runs-on: ubuntu-latest

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
plugin/build
1+
plugin/build
2+
lib/

example/src/MalwareItem.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ export const MalwareItem: React.FC<{ app: SuspiciousAppInfo }> = ({ app }) => {
4545
<View style={styles.buttonView}>
4646
<Image
4747
source={expanded ? ArrowUp : ArrowDown}
48-
style={{
49-
tintColor: Colors.grey,
50-
width: 30,
51-
height: 30,
52-
}}
48+
style={styles.expandArrow}
5349
/>
5450
</View>
5551
</HStack>
@@ -88,8 +84,8 @@ export const MalwareItem: React.FC<{ app: SuspiciousAppInfo }> = ({ app }) => {
8884
<Button
8985
title={'Add to whitelist'}
9086
onPress={() => whitelistApp(app.packageInfo.packageName)}
91-
></Button>
92-
<Button title={'Uninstall'} onPress={appUninstall}></Button>
87+
/>
88+
<Button title={'Uninstall'} onPress={appUninstall} />
9389
</HStack>
9490
</>
9591
)}
@@ -154,4 +150,9 @@ const styles = StyleSheet.create({
154150
marginTop: 10,
155151
justifyContent: 'space-between',
156152
},
153+
expandArrow: {
154+
tintColor: Colors.grey,
155+
width: 30,
156+
height: 30,
157+
},
157158
});

package.json

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"typecheck": "tsc --noEmit",
1212
"expo:typecheck": "cd plugin && tsc --noEmit",
1313
"lint": "eslint \"**/*.{js,ts,tsx}\"",
14+
"prettier": "prettier \"**/*.{ts,js}\"",
1415
"prepack": "bob build && yarn build:plugin",
1516
"build": "bob build",
1617
"example": "yarn --cwd example",
@@ -94,29 +95,6 @@
9495
}
9596
}
9697
},
97-
"eslintConfig": {
98-
"root": true,
99-
"extends": [
100-
"@react-native-community",
101-
"prettier"
102-
],
103-
"rules": {
104-
"prettier/prettier": [
105-
"error",
106-
{
107-
"quoteProps": "consistent",
108-
"singleQuote": true,
109-
"tabWidth": 2,
110-
"trailingComma": "es5",
111-
"useTabs": false
112-
}
113-
]
114-
}
115-
},
116-
"eslintIgnore": [
117-
"node_modules/",
118-
"lib/"
119-
],
12098
"prettier": {
12199
"quoteProps": "consistent",
122100
"singleQuote": true,

0 commit comments

Comments
 (0)