Skip to content

Commit

Permalink
Chore/add prettier (#2094)
Browse files Browse the repository at this point in the history
* Update prettier

* Fix prettier scripts

* Remove printWidth, since 80 is the default

* Apply prettier formatting

* Run prettier before eslint in pre-commit

* Only log warnings when running prettier formatting

* Remove trailing comma rule, use default

* Format with trailing comma rule
  • Loading branch information
simeonkerkola authored Jul 29, 2022
1 parent 5d0ce62 commit 870d008
Show file tree
Hide file tree
Showing 518 changed files with 6,550 additions and 6,788 deletions.
42 changes: 21 additions & 21 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
spec:
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
name: frontend-v2
services:
- envs:
- key: INFURA_PROJECT_ID
scope: RUN_AND_BUILD_TIME
- key: ALCHEMY_KEY
scope: RUN_AND_BUILD_TIME
- key: BLOCKNATIVE_DAPP_ID
scope: RUN_AND_BUILD_TIME
http_port: 80
image:
registry_type: DOCKER_HUB
registry: balancerfi
repository: frontend-v2
tag: latest
instance_count: 1
instance_size_slug: basic-xxs
name: frontend-v2
routes:
- path: /
source_dir: /
- envs:
- key: INFURA_PROJECT_ID
scope: RUN_AND_BUILD_TIME
- key: ALCHEMY_KEY
scope: RUN_AND_BUILD_TIME
- key: BLOCKNATIVE_DAPP_ID
scope: RUN_AND_BUILD_TIME
http_port: 80
image:
registry_type: DOCKER_HUB
registry: balancerfi
repository: frontend-v2
tag: latest
instance_count: 1
instance_size_slug: basic-xxs
name: frontend-v2
routes:
- path: /
source_dir: /
22 changes: 10 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,29 @@ module.exports = {
root: true,

env: {
node: true
node: true,
},

globals: {
NodeJS: true,
withDefaults: true,
defineProps: true,
defineEmits: true,
defineExpose: true
defineExpose: true,
},

extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint',
'@vue/typescript'
'@vue/typescript',
],

plugins: ['simple-import-sort'],

parserOptions: {
ecmaVersion: 2020,
parser: '@typescript-eslint/parser'
parser: '@typescript-eslint/parser',
},

rules: {
Expand All @@ -41,18 +39,18 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn'
'simple-import-sort/exports': 'warn',
},

overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true
}
}
]
jest: true,
},
},
],
};
20 changes: 10 additions & 10 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
28 changes: 14 additions & 14 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

You should usually open an issue in the following situations:

* Report an error you can’t solve yourself
* Discuss a high-level topic or idea (for example, community, vision or policies)
* Propose a new feature or other project idea
- Report an error you can’t solve yourself
- Discuss a high-level topic or idea (for example, community, vision or policies)
- Propose a new feature or other project idea

Tips for communicating on issues:

* **If you see an open issue that you want to tackle,** comment on the issue to let people know you’re on it. That way, people are less likely to duplicate your work.
* **If an issue was opened a while ago,** it’s possible that it’s being addressed somewhere else, or has already been resolved, so comment to ask for confirmation before starting work.
* **If you opened an issue, but figured out the answer later on your own,** comment on the issue to let people know, then close the issue. Even documenting that outcome is a contribution to the project.
- **If you see an open issue that you want to tackle,** comment on the issue to let people know you’re on it. That way, people are less likely to duplicate your work.
- **If an issue was opened a while ago,** it’s possible that it’s being addressed somewhere else, or has already been resolved, so comment to ask for confirmation before starting work.
- **If you opened an issue, but figured out the answer later on your own,** comment on the issue to let people know, then close the issue. Even documenting that outcome is a contribution to the project.

### Opening a pull request

You should usually open a pull request in the following situations:

* Submit trivial fixes (for example, a typo, a broken link or an obvious error)
* Start work on a contribution that was already asked for, or that you’ve already discussed, in an issue
- Submit trivial fixes (for example, a typo, a broken link or an obvious error)
- Start work on a contribution that was already asked for, or that you’ve already discussed, in an issue

A pull request doesn’t have to represent finished work. It’s usually better to open a pull request early on, so others can watch or give feedback on your progress. Just mark it as a “WIP” (Work in Progress) in the subject line. You can always add more commits later.

If the project is on GitHub, here’s how to submit a pull request:

* **Fork the repository** and clone it locally. Connect your local to the original repository by adding it as a remote. Pull in changes from this repository often so that you stay up to date so that when you submit your pull request, merge conflicts will be less likely.
* **Create a branch** for your edits.
* **Reference any relevant issues** or supporting documentation in your PR (for example, “Closes #37.”)
* **Include screenshots of the before and after** if your changes include differences in HTML/CSS. Drag and drop the images into the body of your pull request.
* **Test your changes!** Run your changes against any existing tests if they exist and create new ones when needed. Whether tests exist or not, make sure your changes don’t break the existing project.
* **Contribute in the style of the project** to the best of your abilities. This may mean using indents, semi-colons or comments differently than you would in your own repository, but makes it easier for the maintainer to merge, others to understand and maintain in the future.
- **Fork the repository** and clone it locally. Connect your local to the original repository by adding it as a remote. Pull in changes from this repository often so that you stay up to date so that when you submit your pull request, merge conflicts will be less likely.
- **Create a branch** for your edits.
- **Reference any relevant issues** or supporting documentation in your PR (for example, “Closes #37.”)
- **Include screenshots of the before and after** if your changes include differences in HTML/CSS. Drag and drop the images into the body of your pull request.
- **Test your changes!** Run your changes against any existing tests if they exist and create new ones when needed. Whether tests exist or not, make sure your changes don’t break the existing project.
- **Contribute in the style of the project** to the best of your abilities. This may mean using indents, semi-colons or comments differently than you would in your own repository, but makes it easier for the maintainer to merge, others to understand and maintain in the future.
18 changes: 10 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest
needs: wait-for-vercel-deployment
steps:
- name: Purge cache
uses: jakejarvis/cloudflare-purge-action@master
env:
# Zone is required by both authentication methods
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
- name: Purge cache
uses: jakejarvis/cloudflare-purge-action@master
env:
# Zone is required by both authentication methods
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
110 changes: 56 additions & 54 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,68 +11,70 @@ jobs:
Version:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Get package.json version
run: echo PACKAGE_VERSION=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV
- name: Get package-lock.json version
run: echo PACKAGE_LOCK_VERSION=$(node -p -e "require('./package-lock.json').version") >> $GITHUB_ENV
- name: Check lockfile sync
if: env.PACKAGE_VERSION != env.PACKAGE_LOCK_VERSION
run: |
echo "package-lock.json out of sync"
exit 1
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2
with:
diff-search: true
- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
- name: Fail if version not updated and PR base is master
if: steps.check.outputs.changed == 'false' && github.event.pull_request.base.ref == 'master'
run: exit 1
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Get package.json version
run: echo PACKAGE_VERSION=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV
- name: Get package-lock.json version
run: echo PACKAGE_LOCK_VERSION=$(node -p -e "require('./package-lock.json').version") >> $GITHUB_ENV
- name: Check lockfile sync
if: env.PACKAGE_VERSION != env.PACKAGE_LOCK_VERSION
run: |
echo "package-lock.json out of sync"
exit 1
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2
with:
diff-search: true
- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
- name: Fail if version not updated and PR base is master
if: steps.check.outputs.changed == 'false' && github.event.pull_request.base.ref == 'master'
run: exit 1

Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install deps
run: npm install -g npm@7 && npm ci
- name: Run build
run: npm run build
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install deps
run: npm install -g npm@7 && npm ci
- name: Run build
run: npm run build

Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install deps
run: npm install -g npm@7 && npm ci
- name: Run lint
run: npm run lint

- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install deps
run: npm install -g npm@7 && npm ci
- name: Run lint
run: npm run lint
- name: Run prettier
run: npm run prettier

Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install deps
run: npm install -g npm@7 && npm ci
- name: Run tests
run: npm run test:unit
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install deps
run: npm install -g npm@7 && npm ci
- name: Run tests
run: npm run test:unit
Loading

5 comments on commit 870d008

@vercel
Copy link

@vercel vercel bot commented on 870d008 Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 870d008 Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 870d008 Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 870d008 Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 870d008 Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.