Skip to content

Commit

Permalink
chore: add prettier CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jamsch committed Aug 31, 2024
1 parent d34c165 commit a65e756
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 13 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Prettier check

on:
pull_request:

jobs:
prettier-check:
name: Prettier check
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 📦 Install dependencies
run: npm install

- name: ✨ Run Prettier check
run: npm run prettier:check
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
example/android/
example/ios/
android/
ios/
.expo/
2 changes: 1 addition & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function App() {
// When a final result is received, any following recognized transcripts will omit the previous final result
const transcriptTally = ev.isFinal
? (current?.transcriptTally ?? "") + transcript
: current?.transcriptTally ?? "";
: (current?.transcriptTally ?? "");

return {
transcriptTally,
Expand Down
4 changes: 2 additions & 2 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"expo-speech-recognition": ["../src/index"],
"expo-speech-recognition/*": ["../src/*"]
},
"types": ["@types/dom-speech-recognition"],
},
"types": ["@types/dom-speech-recognition"]
}
}
12 changes: 6 additions & 6 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const createConfigAsync = require('@expo/webpack-config');
const path = require('path');
const createConfigAsync = require("@expo/webpack-config");
const path = require("path");

module.exports = async (env, argv) => {
const config = await createConfigAsync(
{
...env,
babel: {
dangerouslyAddModulePathsToTranspile: ['expo-speech-recognition'],
dangerouslyAddModulePathsToTranspile: ["expo-speech-recognition"],
},
},
argv
argv,
);
config.resolve.modules = [
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, '../node_modules'),
path.resolve(__dirname, "./node_modules"),
path.resolve(__dirname, "../node_modules"),
];

return config;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"expo-module": "expo-module",
"open:ios": "open -a \"Xcode\" example/ios",
"open:android": "open -a \"Android Studio\" example/android",
"ts:check": "tsc -p . --noEmit"
"ts:check": "tsc -p . --noEmit",
"prettier:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
"prettier:write": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,scss,md}\""
},
"keywords": [
"react-native",
Expand All @@ -35,7 +37,8 @@
"@types/dom-speech-recognition": "^0.0.4",
"@types/react": "^18.3.3",
"expo-module-scripts": "^3.5.2",
"expo-modules-core": "^1.12.21"
"expo-modules-core": "^1.12.21",
"prettier": "^3.3.3"
},
"prettier": {
"trailingComma": "all"
Expand Down

0 comments on commit a65e756

Please sign in to comment.