Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lu Nguyen committed Feb 16, 2023
1 parent e46a939 commit f154570
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Format

on:
pull_request:

jobs:
code:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install dependencies
run: yarn install

- name: Run Prettier
run: yarn run format:check
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"source": "src/index.js",
"dependencies": {
"axios": "^0.21.0",
"babel-plugin-module-resolver": "^4.1.0",
"bowser": "^2.11.0",
"cross-env": "^7.0.3",
"dotenv": "^16.0.3",
Expand All @@ -31,7 +30,9 @@
"lint": "eslint --fix \"src/**/\"",
"lint:check": "eslint \"src/**/\"",
"lint:nowarns": "eslint --quiet \"src/**/\"",
"prepublishOnly": "yarn run build"
"prepublishOnly": "yarn run build",
"format:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx}'",
"format:write": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'"
},
"eslintConfig": {
"extends": [
Expand Down Expand Up @@ -67,8 +68,10 @@
"@rollup/plugin-json": "^5.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^4.0.0",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^8.17",
"eslint-plugin-react": "^7.31.10",
"prettier": "^2.8.4",
"rollup": "^2.79.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.34.1",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2942,6 +2942,11 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==

prettier@^2.8.4:
version "2.8.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3"
integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==

prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
Expand Down

0 comments on commit f154570

Please sign in to comment.