Skip to content

Commit be16989

Browse files
inwonkiminwonkim
inwonkim
authored andcommitted
Apply typescript
1 parent 282aa9f commit be16989

File tree

274 files changed

+11766
-31849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+11766
-31849
lines changed

.babelrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"presets": ["env"],
3-
"plugins": ["babel-plugin-add-module-exports", "transform-object-rest-spread", "@babel/plugin-transform-runtime"]
4-
}
3+
"plugins": ["syntax-class-properties", "transform-class-properties", "babel-plugin-add-module-exports", "transform-object-rest-spread", "@babel/plugin-transform-runtime"]
4+
}

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
root = true
22

33
[*]
4-
indent_style = tab
5-
indent_size = 4
4+
indent_style = space
5+
indent_size = 2
66
end_of_line = LF
77
charset = utf-8
88
trim_trailing_whitespace = true

.eslintignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
/lib/module
1+
/build
2+
/test
3+
/lib/data/Util.js
4+
/lib/builder
5+
/lib/module
6+
*.d.ts
7+
webpack.config.js

.eslintrc

+74-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,76 @@
11
{
2-
"extends": ["airbnb"],
3-
"rules": {
4-
"indent": ["error", "tab", { "SwitchCase": 1 }],
5-
"no-tabs": 0
6-
}
2+
"globals": {
3+
"$Diff": true,
4+
"__PATH_PREFIX": true
5+
},
6+
"env": {
7+
"es6": true,
8+
"node": true,
9+
"browser": true
10+
},
11+
"parser": "@typescript-eslint/parser",
12+
"extends": ["airbnb", "eslint:recommended", "plugin:prettier/recommended"],
13+
"parserOptions": {
14+
"ecmaVersion": 6,
15+
"sourceType": "module"
16+
},
17+
"plugins": [
18+
"@typescript-eslint",
19+
"prettier"
20+
],
21+
"rules": {
22+
"prettier/prettier": 2,
23+
"block-scoped-var": 0,
24+
"camelcase": 0,
25+
"consistent-return": 0,
26+
"default-case": 0,
27+
"func-names": 0,
28+
"import/no-unresolved": 0,
29+
"import/extensions": 0,
30+
"max-len": 0,
31+
"new-cap": 0,
32+
"no-bitwise": 0,
33+
"no-cond-assign": 0,
34+
"no-continue": 0,
35+
"no-mixed-spaces-and-tabs": 0,
36+
"no-multi-assign": 0,
37+
"no-nested-ternary": 0,
38+
"no-param-reassign": 0,
39+
"no-plusplus": 0,
40+
"no-proto": 0,
41+
"no-redeclare": 0,
42+
"no-restricted-properties": 0,
43+
"no-restricted-syntax": 0,
44+
"no-return-assign": 0,
45+
"no-sequences": 0,
46+
"no-shadow": 0,
47+
"no-sparse-arrays": 0,
48+
"no-tabs": 0,
49+
"no-underscore-dangle": 0,
50+
"no-unreachable": 0,
51+
"no-unused-expressions": 0,
52+
"no-use-before-define": 0,
53+
"no-var": 0,
54+
"no-void": 0,
55+
"prefer-destructuring": 0,
56+
"vars-on-top": 0
57+
},
58+
"overrides": [{
59+
"files": [
60+
"**/test/*.js",
61+
"**/test/*.ts",
62+
"**/*.spec.js",
63+
"**/*.spec.ts",
64+
"**/*.test.js",
65+
"**/*.test.ts"
66+
],
67+
"rules": {
68+
"import/extensions": 0,
69+
"import/no-unresolved": 0,
70+
"@typescript-eslint/explicit-function-return-type": 0,
71+
"max-len": 0,
72+
"no-console": 0,
73+
"no-undef": 0
74+
}
75+
}],
776
}

.github/workflows/lint.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
pull_request:
4+
5+
jobs:
6+
eslint:
7+
name: eslint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: install node v14
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 14
15+
- name: yarn install
16+
run: yarn install
17+
- name: eslint
18+
uses: icrawl/action-eslint@v1
19+
with:
20+
custom-glob: lib

.github/workflows/test-release.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: test and release
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [14.x]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- name: Install
24+
run: npm ci
25+
26+
- name: Test
27+
run: npm t
28+
29+
release:
30+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
31+
runs-on: ubuntu-latest
32+
needs: [test]
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v1
39+
with:
40+
node-version: 14.x
41+
42+
- name: Install
43+
run: npm ci
44+
45+
- name: Release
46+
run: npx semantic-release
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ yarn-error.log*
1515
.vscode
1616
.npmignore
1717
yarn.lock
18-
package-lock.json
1918
.travis.yml
2019
.nvmrc
2120
.eslintrc
2221
.editorconfig
23-
.babelrc
22+
.babelrc
23+
24+
build/

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v6.10
1+
v14.10

.travis.yml

-5
This file was deleted.

README.md

-22
Original file line numberDiff line numberDiff line change
@@ -2002,28 +2002,6 @@ IconValidator.isPrivateKey(privKey: any) => boolean
20022002
const isPrivateKey = IconValidator.isPrivateKey('7abca1...20a9f1')
20032003
```
20042004

2005-
### static isPublicKey()
2006-
2007-
Check if input value is a public key type string.
2008-
2009-
```javascript
2010-
IconValidator.isPublicKey(pubKey: any) => boolean
2011-
```
2012-
#### Parameters
2013-
2014-
| Parameter | Type | Description |
2015-
| ------------- | ----------- | ----------- |
2016-
| public | `any` | an input value |
2017-
2018-
#### Returns
2019-
`boolean` - Returns true if the input value is a public key type string.
2020-
2021-
#### Example
2022-
```javascript
2023-
// Returns true if the input value is a public key type string.
2024-
const isPublicKey = IconValidator.isPublicKey('7abca1...20a9f1')
2025-
```
2026-
20272005
### static isEoaAddress()
20282006

20292007
Check if input value is a EOA address type string.

build/icon-sdk-js.node.min.js

-31
This file was deleted.

build/icon-sdk-js.web.min.js

-27
This file was deleted.

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import IconService from './lib/IconService';
17+
import IconService from "./lib/IconService";
1818

1919
export default IconService;

lib/Exception.js

-122
This file was deleted.

0 commit comments

Comments
 (0)