Skip to content

Commit a65e756

Browse files
committed
chore: add prettier CI workflow
1 parent d34c165 commit a65e756

File tree

7 files changed

+39
-13
lines changed

7 files changed

+39
-13
lines changed

.github/workflows/prettier.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Prettier check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
prettier-check:
8+
name: Prettier check
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 🏗 Setup repo
12+
uses: actions/checkout@v4
13+
14+
- name: 📦 Install dependencies
15+
run: npm install
16+
17+
- name: ✨ Run Prettier check
18+
run: npm run prettier:check

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
example/android/
2+
example/ios/
3+
android/
4+
ios/
5+
.expo/

example/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default function App() {
8686
// When a final result is received, any following recognized transcripts will omit the previous final result
8787
const transcriptTally = ev.isFinal
8888
? (current?.transcriptTally ?? "") + transcript
89-
: current?.transcriptTally ?? "";
89+
: (current?.transcriptTally ?? "");
9090

9191
return {
9292
transcriptTally,

example/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"expo-speech-recognition": ["../src/index"],
77
"expo-speech-recognition/*": ["../src/*"]
88
},
9-
"types": ["@types/dom-speech-recognition"],
10-
},
9+
"types": ["@types/dom-speech-recognition"]
10+
}
1111
}

example/webpack.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
const createConfigAsync = require('@expo/webpack-config');
2-
const path = require('path');
1+
const createConfigAsync = require("@expo/webpack-config");
2+
const path = require("path");
33

44
module.exports = async (env, argv) => {
55
const config = await createConfigAsync(
66
{
77
...env,
88
babel: {
9-
dangerouslyAddModulePathsToTranspile: ['expo-speech-recognition'],
9+
dangerouslyAddModulePathsToTranspile: ["expo-speech-recognition"],
1010
},
1111
},
12-
argv
12+
argv,
1313
);
1414
config.resolve.modules = [
15-
path.resolve(__dirname, './node_modules'),
16-
path.resolve(__dirname, '../node_modules'),
15+
path.resolve(__dirname, "./node_modules"),
16+
path.resolve(__dirname, "../node_modules"),
1717
];
1818

1919
return config;

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"expo-module": "expo-module",
1515
"open:ios": "open -a \"Xcode\" example/ios",
1616
"open:android": "open -a \"Android Studio\" example/android",
17-
"ts:check": "tsc -p . --noEmit"
17+
"ts:check": "tsc -p . --noEmit",
18+
"prettier:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
19+
"prettier:write": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,scss,md}\""
1820
},
1921
"keywords": [
2022
"react-native",
@@ -35,7 +37,8 @@
3537
"@types/dom-speech-recognition": "^0.0.4",
3638
"@types/react": "^18.3.3",
3739
"expo-module-scripts": "^3.5.2",
38-
"expo-modules-core": "^1.12.21"
40+
"expo-modules-core": "^1.12.21",
41+
"prettier": "^3.3.3"
3942
},
4043
"prettier": {
4144
"trailingComma": "all"

0 commit comments

Comments
 (0)