-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a893b13
commit 21a9977
Showing
31 changed files
with
2,521 additions
and
2,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Lint | ||
|
||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
Publish: | ||
runs-on: ubuntu-latest | ||
|
||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: latest | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: 'pnpm' | ||
- run: pnpm i --no-frozen-lockfile | ||
|
||
- name: Lint | ||
run: pnpm lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const { echo } = require('./module-a'); | ||
|
||
echo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { echo } from './module-b'; | ||
|
||
echo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
echo() { | ||
return 'Hello world'; | ||
}, | ||
say(name) { | ||
return `Hello ${name}`; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export function echo() { | ||
return 'Hello world'; | ||
} | ||
export function say(name) { | ||
return `Hello ${name}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function promiseFn() { | ||
return new Promise(() => {}); | ||
} | ||
|
||
async function main() { | ||
await promiseFn(); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const DEFAULT_TOKEN_DECIMAL = 18; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
export class CustomError extends Error { | ||
code: string; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
import get from 'lodash/get'; | ||
|
||
export const getListField = (obj: $TSFixMe, key: string) => get(obj, `${key}List`) || get(obj, key) || []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
export const getRelatedAddresses = (state: $TSFixMe) => | ||
[state.address].concat(state.migratedFrom || []).filter(Boolean); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
import crypto from 'crypto'; | ||
|
||
export const md5 = (x: $TSFixMe) => crypto.createHash('md5').update(x).digest('hex'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function promiseFn() { | ||
return new Promise(() => {}); | ||
} | ||
|
||
async function main() { | ||
await promiseFn(); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@arcblock/eslint-config-base", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Arcblock's ESLint config base", | ||
"author": "zhanghan <[email protected]>", | ||
"homepage": "https://github.com/ArcBlock/eslint-config#readme", | ||
|
@@ -18,15 +18,15 @@ | |
}, | ||
"dependencies": { | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^26.8.7", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-unicorn": "^42.0.0" | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-jest": "^27.2.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-unicorn": "^47.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.17.0", | ||
"prettier": "^2.7.1" | ||
"eslint": "^8.42.0", | ||
"prettier": "^2.8.8" | ||
}, | ||
"peerDependencies": { | ||
"eslint": "^8.17.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
// follow javascript style from [here](https://github.com/airbnb/javascript) | ||
|
||
const shared = require("./shared"); | ||
const shared = require('./shared'); | ||
|
||
module.exports = { | ||
...shared, | ||
extends: ["@arcblock/eslint-config-base", "airbnb-typescript/base"], | ||
extends: ['@arcblock/eslint-config-base', 'airbnb-typescript/base'], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.mjs', '.ts'], | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
'require-await': 'error', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
// follow javascript style from [here](https://github.com/airbnb/javascript) | ||
|
||
const shared = require("./shared"); | ||
const shared = require('./shared'); | ||
|
||
module.exports = { | ||
...shared, | ||
extends: ["@arcblock/eslint-config", "airbnb-typescript"], | ||
extends: ['@arcblock/eslint-config', 'airbnb-typescript'], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
'require-await': 'error', | ||
}, | ||
}; |
Oops, something went wrong.