Add prettier support

+ CI to check formatting, and fix the couple of instances that
were not in prettier format (case in HTML clour codes).
This commit is contained in:
David Baker 2022-05-03 14:24:04 +01:00
parent ae13814449
commit b3e88d33a7
7 changed files with 33 additions and 5 deletions

18
.github/workflows/prettier.yaml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Prettier
on:
pull_request: {}
jobs:
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Yarn cache
uses: actions/setup-node@v3
with:
cache: 'yarn'
- name: Install dependencies
run: "yarn install"
- name: Check code style
run: "yarn run prettier:check"

2
.prettierignore Normal file
View file

@ -0,0 +1,2 @@
node_modules
dist

1
.prettierrc.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -5,7 +5,9 @@
"build": "vite build", "build": "vite build",
"serve": "vite preview", "serve": "vite preview",
"storybook": "start-storybook -p 6006", "storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook" "build-storybook": "build-storybook",
"prettier:check": "prettier -c src",
"prettier:format": "prettier -w src"
}, },
"dependencies": { "dependencies": {
"@juggle/resize-observer": "^3.3.1", "@juggle/resize-observer": "^3.3.1",
@ -50,6 +52,7 @@
"@babel/core": "^7.16.5", "@babel/core": "^7.16.5",
"@storybook/react": "^6.5.0-alpha.5", "@storybook/react": "^6.5.0-alpha.5",
"babel-loader": "^8.2.3", "babel-loader": "^8.2.3",
"prettier": "^2.6.2",
"sass": "^1.42.1", "sass": "^1.42.1",
"storybook-builder-vite": "^0.1.12", "storybook-builder-vite": "^0.1.12",
"vite": "^2.4.2", "vite": "^2.4.2",

View file

@ -4,4 +4,3 @@
flex: 1; flex: 1;
touch-action: none; touch-action: none;
} }

View file

@ -85,7 +85,7 @@
.videoMutedOverlay { .videoMutedOverlay {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #21262C; background-color: #21262c;
} }
.presenterLabel { .presenterLabel {
@ -93,7 +93,7 @@
top: 20px; top: 20px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
background-color: #17191C; background-color: #17191c;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -110,4 +110,4 @@
width: 25%; width: 25%;
max-width: 360px; max-width: 360px;
border-radius: 20px; border-radius: 20px;
} }

View file

@ -9427,6 +9427,11 @@ prettier@<=2.3.0, "prettier@>=2.2.1 <=2.3.0":
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
prettier@^2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032"
integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==
pretty-error@^2.1.1: pretty-error@^2.1.1:
version "2.1.2" version "2.1.2"
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6"