Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 448485f

Browse files
authored
Merge pull request #199 from streamr-dev/typescript
NET-177: Add TypeScript support
2 parents 672420b + beefb7c commit 448485f

Some content is hidden

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

49 files changed

+2686
-1915
lines changed

.babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports = {
1818
]
1919
},
2020
exclude: ['transform-regenerator', '@babel/plugin-transform-regenerator']
21-
}]
21+
}],
22+
['@babel/preset-typescript']
2223
],
2324
plugins: [
2425
"add-module-exports",

.babel.node.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module.exports = {
1010
targets: {
1111
node: true
1212
}
13-
}]
13+
}],
14+
['@babel/preset-typescript']
1415
],
1516
plugins: [
1617
'add-module-exports',

.eslintrc.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
2-
parser: 'babel-eslint',
2+
parser: '@typescript-eslint/parser',
3+
plugins: [
4+
'@typescript-eslint'
5+
],
36
extends: [
47
'streamr-nodejs'
58
],
@@ -31,5 +34,21 @@ module.exports = {
3134
'no-restricted-syntax': [
3235
'error', 'ForInStatement', 'LabeledStatement', 'WithStatement'
3336
],
37+
'import/extensions': ['error', 'never', { json: 'always' }],
38+
'lines-between-class-members': 'off',
39+
'padded-blocks': 'off',
40+
'no-use-before-define': 'off',
41+
'import/order': 'off',
42+
'no-shadow': 'off',
43+
'@typescript-eslint/no-shadow': 'error',
44+
'no-unused-vars': 'off',
45+
'@typescript-eslint/no-unused-vars': ['error']
46+
},
47+
settings: {
48+
'import/resolver': {
49+
node: {
50+
extensions: ['.js', '.ts']
51+
}
52+
}
3453
}
3554
}

.github/workflows/nodejs.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,14 @@ jobs:
157157
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.2
158158
with:
159159
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
160-
- name: test-browser
161-
timeout-minutes: 2
162-
run: npm run test-browser
160+
161+
- uses: nick-invision/retry@v2
162+
name: Run Test
163+
with:
164+
max_attempts: 3
165+
timeout_minutes: 3
166+
retry_on: error
167+
command: npm run test-browser
163168

164169
benchmarks:
165170
name: Test Benchmark using Node ${{ matrix.node-version }}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ module.exports = {
163163

164164
// A map from regular expressions to paths to transformers
165165
transform: {
166-
'\\.js$': ['babel-jest', {
166+
'\\.(js|ts)$': ['babel-jest', {
167167
configFile: path.resolve(__dirname, '.babel.node.config.js'),
168168
babelrc: false,
169169
}]

0 commit comments

Comments
 (0)