Skip to content

Commit

Permalink
Add prettier into the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolen committed May 4, 2023
1 parent 7dd86ef commit 6aafa15
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended'],
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended', 'prettier'],
plugins: ['react-hooks'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', '.git/**'],
Expand Down
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
tabWidth: 4,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,
arrowParens: 'always',
printWidth: 190,
singleAttributePerLine: true,
};
130 changes: 115 additions & 15 deletions package-lock.json

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

25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"scripts": {
"postinstall": "npx patch-package && cd desktop && npm install",
"clean": "npx react-native clean-project-auto",
"android": "scripts/set-pusher-suffix.sh && npx react-native run-android --port=8083",
"ios": "scripts/set-pusher-suffix.sh && npx react-native run-ios --port=8082",
"ipad": "npx react-native run-ios --port=8082 --simulator=\"iPad Pro (12.9-inch) (4th generation)\"",
"ipad-sm": "npx react-native run-ios --port=8082 --simulator=\"iPad Pro (9.7-inch)\"",
"android": "scripts/set-pusher-suffix.sh && concurrently \"npx react-native run-android --port=8083\" npm:prettier-watch",
"ios": "scripts/set-pusher-suffix.sh && concurrently \"npx react-native run-ios --port=8082\" npm:prettier-watch",
"ipad": " concurrently \"npx react-native run-ios --port=8082 --simulator=\"iPad Pro (12.9-inch) (4th generation)\"\" npm:prettier-watch",
"ipad-sm": " concurrently \"npx react-native run-ios --port=8082 --simulator=\"iPad Pro (9.7-inch)\"\" npm:prettier-watch",
"start": "npx react-native start",
"web": "scripts/set-pusher-suffix.sh && concurrently npm:web-proxy npm:web-server",
"web": "scripts/set-pusher-suffix.sh && concurrently npm:web-proxy npm:web-server npm:prettier-watch",
"web-proxy": "node web/proxy.js",
"web-server": "webpack-dev-server --open --config config/webpack/webpack.dev.js",
"build": "webpack --config config/webpack/webpack.common.js --env envFile=.env.production",
"build-staging": "webpack --config config/webpack/webpack.common.js --env envFile=.env.staging",
"build-adhoc": "webpack --config config/webpack/webpack.common.js --env envFile=.env.adhoc",
"desktop": "scripts/set-pusher-suffix.sh && node desktop/start.js",
"desktop": "scripts/set-pusher-suffix.sh && concurrently \"node desktop/start.js\" npm:prettier-watch",
"desktop-build": "scripts/build-desktop.sh production",
"desktop-build-staging": "scripts/build-desktop.sh staging",
"createDocsRoutes": "node .github/scripts/createDocsRoutes.js",
Expand All @@ -29,9 +29,11 @@
"android-build": "fastlane android build",
"android-build-e2e": "bundle exec fastlane android build_e2e",
"test": "TZ=utc jest",
"lint": "eslint . --max-warnings=0",
"lint": "eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/eslint",
"lint-watch": "npx eslint-watch --watch --changed",
"shellcheck": "./scripts/shellCheck.sh",
"prettier": "prettier --write \"**/*.js\"",
"prettier-watch": "onchange \"**/*.js\" -- prettier --write --ignore-unknown {{changed}}",
"print-version": "echo $npm_package_version",
"storybook": "start-storybook -p 6006",
"storybook-build": "build-storybook -o dist/docs",
Expand Down Expand Up @@ -178,6 +180,7 @@
"electron-notarize": "^1.2.1",
"eslint": "^7.6.0",
"eslint-config-expensify": "^2.0.36",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react-hooks": "^4.6.0",
Expand All @@ -191,6 +194,8 @@
"jest-environment-jsdom": "^29.4.1",
"metro-react-native-babel-preset": "^0.73.3",
"mock-fs": "^4.13.0",
"onchange": "^7.1.0",
"prettier": "^2.8.8",
"portfinder": "^1.0.28",
"pusher-js-mock": "^0.3.3",
"react-native-clean-project": "^4.0.0-alpha4.0",
Expand All @@ -215,11 +220,5 @@
"engines": {
"node": "16.15.1",
"npm": "8.11.0"
},
"prettier": {
"bracketSpacing": false,
"jsxBracketSameLine": true,
"singleQuote": true,
"trailingComma": "all"
}
}

0 comments on commit 6aafa15

Please sign in to comment.