Skip to content

Commit

Permalink
Merge pull request #61 from philip-gai/users/philip-gai/fix-lint
Browse files Browse the repository at this point in the history
Update to use eslint auto fix in CI
  • Loading branch information
philip-gai authored Dec 1, 2021
2 parents 27c0d7a + db20413 commit d973064
Show file tree
Hide file tree
Showing 7 changed files with 829 additions and 48 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/Update-DevContainer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env pwsh

# Post devcontainer create script to run

git config --global pull.rebase true
cd web-app && npm install && cd -
88 changes: 44 additions & 44 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/typescript-node
{
"name": "Node.js & TypeScript",
"runArgs": ["--init"],
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"args": {
"VARIANT": "14"
}
},
"name": "Node.js & TypeScript",
"runArgs": ["--init"],
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"args": {
"VARIANT": "14"
}
},

// Set *default* container specific settings.json values on container create.
"settings": {
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"cschleiden.vscode-github-actions",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"eg2.vscode-npm-script",
"esbenp.prettier-vscode",
"ms-azuretools.vscode-azureappservice",
"ms-azuretools.vscode-bicep",
"yzhang.markdown-all-in-one"
],
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"cschleiden.vscode-github-actions",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"eg2.vscode-npm-script",
"esbenp.prettier-vscode",
"ms-azuretools.vscode-azureappservice",
"ms-azuretools.vscode-bicep",
"yzhang.markdown-all-in-one"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pwsh ./.devcontainer/Update-DevContainer.ps1",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
"features": {
"git": "latest",
"git-lfs": "latest",
"github-cli": "latest",
"azure-cli": "latest",
"powershell": "latest"
}
}
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
"features": {
"git": "latest",
"git-lfs": "latest",
"github-cli": "latest",
"azure-cli": "latest",
"powershell": "latest"
}
}
8 changes: 8 additions & 0 deletions .github/workflows/web-app-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Build and test
uses: ./.github/workflows/composite/web-app-build-test
- name: git push lint fixes
run: |
git config user.name github-actions
git config user.email [email protected]
git diff-index --quiet HEAD || git commit -am "Autofix fixable ESLint errors"
git push
build-and-deploy:
name: "Web App Build & Deploy"
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || ( github.event_name == 'workflow_dispatch' && github.event.inputs.What-If == 'false' ))
Expand Down
Loading

0 comments on commit d973064

Please sign in to comment.