Skip to content

Commit

Permalink
chore: Fix linter and apply to all files
Browse files Browse the repository at this point in the history
  • Loading branch information
superduck35 committed Aug 4, 2021
1 parent 75c65c4 commit 39be8bb
Show file tree
Hide file tree
Showing 27 changed files with 10,932 additions and 13,312 deletions.
12 changes: 6 additions & 6 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
"scope-case": [2, 'always', 'lower-case'],
"subject-case": [2, 'always', 'sentence-case'],
}
}
extends: ["@commitlint/config-conventional"],
rules: {
"scope-case": [2, "always", "lower-case"],
"subject-case": [2, "always", "sentence-case"],
},
}
50 changes: 23 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
module.exports = {
"extends": [
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"env": {
"node": true,
"browser": true,
"jest": true
extends: ["airbnb-typescript", "plugin:@typescript-eslint/recommended", "prettier", "prettier/@typescript-eslint"],
env: {
node: true,
browser: true,
jest: true,
},
"parserOptions": {
"project": "./tsconfig.json"
parserOptions: {
project: "./tsconfig.json",
},
"settings": {
'import/resolver': {
"alias": {
settings: {
"import/resolver": {
alias: {
map: [
['@utils', './test-utils'],
['types/generated', './types/generated/index', 'types/contracts']
["@utils", "./test-utils"],
["types/generated", "./types/generated/index", "types/contracts"],
],
extensions: ['.ts', '.d.ts', '.js', '.jsx', '.json']
}
}
extensions: [".ts", ".d.ts", ".js", ".jsx", ".json"],
},
},
},
"rules": {
rules: {
"@typescript-eslint/no-use-before-define": 1,
"import/no-extraneous-dependencies": "off",
"no-console": "off",
Expand All @@ -38,15 +33,16 @@ module.exports = {
"lines-between-class-members": 0,
"prefer-destructuring": 1,
},
"overrides": [
overrides: [
{
"files": [
files: [
"./types/contracts.ts",
"./types/interfaces.d.ts",
"./types/**/*.ts",
"./scripts/**/*.ts",
"./test/**/*.ts",
"./test-utils/**/*.ts"],
}
]
};
"./test-utils/**/*.ts",
],
},
],
}
49 changes: 24 additions & 25 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
on: ["push", "pull_request"]
name: Coverage
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn compile
- run: yarn coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn compile
- run: yarn coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
38 changes: 19 additions & 19 deletions .github/workflows/lint-sol.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
on: ["push", "pull_request"]
name: Lint Solidity
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn lint-sol
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn lint-sol
41 changes: 20 additions & 21 deletions .github/workflows/lint-ts.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
on: ["push", "pull_request"]
name: Lint Typescript
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn compile
- run: yarn lint-ts
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn compile
- run: yarn lint-ts
50 changes: 25 additions & 25 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"useTabs": false,
"singleQuote": false,
"printWidth": 140,
"overrides": [
{
"files": "*.ts",
"options": {
"parser": "typescript",
"trailingComma": "all",
"arrowParens": "always"
}
},
{
"files": "*.sol",
"options": {
"printWidth": 100,
"bracketSpacing": true,
"explicitTypes": "always"
}
}
]
}
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"useTabs": false,
"singleQuote": false,
"printWidth": 140,
"overrides": [
{
"files": "*.ts",
"options": {
"parser": "typescript",
"trailingComma": "all",
"arrowParens": "always"
}
},
{
"files": "*.sol",
"options": {
"printWidth": 100,
"bracketSpacing": true,
"explicitTypes": "always"
}
}
]
}
6 changes: 2 additions & 4 deletions contracts/rewards/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


## Files

Why so many?
Expand All @@ -13,7 +11,7 @@ Allows reward allocators ("FundManagers") to distribute rewards.
### StakingRewards

`StakingRewards` is `InitializableRewardsDistributionRecipient`
--------------> is `StakingTokenWrapper`
--------------> is `StakingTokenWrapper`

This preserves the code written, tested, audited and deployed by `Synthetix` (StakingRewards & StakingTokenWrapper).

Expand All @@ -23,6 +21,6 @@ Audit: https://github.com/sigp/public-audits/blob/master/synthetix/unipool/revie
### StakingRewardsWithPlatformToken

`StakingRewardsWithPlatformToken` is `InitializableRewardsDistributionRecipient`
-------------------------------> is `StakingTokenWrapper`
-------------------------------> is `StakingTokenWrapper`

`StakingRewardsWithPlatformToken` deploys `PlatformTokenVendor` during its constructor
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"prettify": "prettier --write tasks/**/*.ts test/**/*.ts types/*.ts contracts/**/*.sol",
"lint": "yarn run lint-ts; yarn run lint-sol",
"lint:fix": "yarn pretty-quick --pattern '**/*.*(sol|json)' --staged --verbose",
"lint:fix": "yarn pretty-quick --pattern '**/*.*(sol|json)' --staged --verbose && yarn pretty-quick --write --staged tasks/**/*.ts test/**/*.ts types/*.ts",
"lint-ts": "yarn eslint ./test --ext .ts --fix --quiet",
"lint-sol": "solhint 'contracts/**/*.sol'",
"compile-abis": "typechain --target=ethers-v5 --out-dir types/generated \"?(contracts|build)/!(build-info)/**/+([a-zA-Z0-9]).json\"",
Expand Down
Loading

0 comments on commit 39be8bb

Please sign in to comment.