Skip to content

Commit 1f55f61

Browse files
committed
feat: add TypeScript defs
fix #20
2 parents 2c06822 + 4d516c2 commit 1f55f61

Some content is hidden

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

43 files changed

+6419
-8337
lines changed

.babelrc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
module.exports = function(api) {
2-
const plugins = ['@babel/plugin-transform-flow-strip-types']
1+
module.exports = function (api) {
2+
const plugins = [
3+
'@babel/plugin-transform-flow-strip-types',
4+
'@babel/plugin-proposal-class-properties',
5+
]
36
const presets = [
47
[
58
'@babel/preset-env',
69
api.env('es5')
710
? { forceAllTransforms: true }
8-
: { targets: { node: 'current' } },
11+
: { targets: { node: '12' } },
912
],
1013
'@babel/preset-flow',
1114
]

.circleci/config.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ version: 2
22
jobs:
33
build:
44
docker:
5+
<<<<<<< HEAD
56
- image: circleci/node:12.16
7+
=======
8+
- image: circleci/node:14
9+
>>>>>>> 4d516c22098cb462793346b3f1aea91563b8ba5b
610

711
steps:
812
- checkout
9-
- restore_cache:
10-
name: Restore Yarn Package Cache
11-
keys:
12-
- v1-yarn-packages-{{ checksum "yarn.lock" }}
1313

1414
- run:
1515
name: Setup NPM Token
@@ -26,18 +26,13 @@ jobs:
2626
- run:
2727
name: Install Dependencies
2828
command: yarn install --frozen-lockfile
29-
- save_cache:
30-
name: Save Yarn Package Cache
31-
key: v1-yarn-packages-{{ checksum "yarn.lock" }}
32-
paths:
33-
- ~/.cache/yarn
3429

3530
- run:
3631
name: build
3732
command: yarn run prepublishOnly
3833
- run:
3934
name: upload test coverage
40-
command: yarn codecov || true
35+
command: yarn codecov
4136
- run:
4237
name: release
43-
command: yarn run semantic-release || true
38+
command: yarn run semantic-release

.eslintrc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
"extends": [
33
"@jedwards1211/eslint-config",
44
"@jedwards1211/eslint-config-flow",
5-
"eslint-config-prettier"
5+
"prettier",
6+
"prettier/babel",
7+
"prettier/flowtype"
68
],
7-
"parser": "babel-eslint",
8-
"parserOptions": {
9-
"ecmaVersion": 6,
10-
"sourceType": "module"
11-
},
9+
"parser": "@babel/eslint-parser",
1210
"env": {
1311
"commonjs": true,
14-
"es6": true,
15-
"shared-node-browser": true
12+
"shared-node-browser": true,
13+
"es2017": true
1614
}
1715
}

.flowconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@
1313
[libs]
1414

1515
[options]
16-
module.system=node
17-
esproposal.class_static_fields=enable
18-
esproposal.class_instance_fields=enable

.gitignore

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
coverage
2-
.nyc_output
1+
/coverage
2+
/.nyc_output
33
node_modules
4-
lib
5-
es
4+
/lib
5+
/es
66
.eslintcache
7-
/*.js
8-
/*.js.flow
7+
*.js
8+
*.js.flow
9+
*.ts
10+
!/src/**/*.js
11+
!/src/**/*.ts
12+
!/test/**/*.js
13+
!/test/**/*.ts
914
!/.babelrc.js

.npmignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**
2+
!**/*.js
3+
!**/*.js.flow
4+
!**/*.d.ts
5+
!/*.md
6+
/src
7+
/test
8+
/coverage
9+
/flow-typed
10+
__tests__
11+
/.*
Lines changed: 12 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 6b3e411701babc2e6f6520580da2616a
2-
// flow-typed version: <<STUB>>/@commitlint/cli_v^5.2.5/flow_v0.61.0
1+
// flow-typed signature: 9a34abf4a0002985fcc07915460f635b
2+
// flow-typed version: <<STUB>>/@commitlint/cli_v^11.0.0/flow_v0.143.1
33

44
/**
55
* This is an autogenerated libdef stub for:
@@ -22,133 +22,38 @@ declare module '@commitlint/cli' {
2222
* require those files directly. Feel free to delete any files that aren't
2323
* needed.
2424
*/
25-
declare module '@commitlint/cli/fixtures/empty/commitlint.config' {
25+
declare module '@commitlint/cli/cli' {
2626
declare module.exports: any
2727
}
2828

29-
declare module '@commitlint/cli/fixtures/extends-root/extended' {
30-
declare module.exports: any
31-
}
32-
33-
declare module '@commitlint/cli/fixtures/inner-scope/commitlint.config' {
34-
declare module.exports: any
35-
}
36-
37-
declare module '@commitlint/cli/fixtures/inner-scope/inner-scope/commitlint.config' {
38-
declare module.exports: any
39-
}
40-
41-
declare module '@commitlint/cli/fixtures/outer-scope/commitlint.config' {
42-
declare module.exports: any
43-
}
44-
45-
declare module '@commitlint/cli/fixtures/parser-preset/commitlint.config' {
46-
declare module.exports: any
47-
}
48-
49-
declare module '@commitlint/cli/fixtures/parser-preset/parser-preset' {
50-
declare module.exports: any
51-
}
52-
53-
declare module '@commitlint/cli/fixtures/signoff/commitlint.config' {
54-
declare module.exports: any
55-
}
56-
57-
declare module '@commitlint/cli/fixtures/simple/commitlint.config' {
29+
declare module '@commitlint/cli/lib/cli-error' {
5830
declare module.exports: any
5931
}
6032

6133
declare module '@commitlint/cli/lib/cli' {
6234
declare module.exports: any
6335
}
6436

65-
declare module '@commitlint/cli/lib/cli.test' {
66-
declare module.exports: any
67-
}
68-
69-
declare module '@commitlint/cli/lib/help' {
70-
declare module.exports: any
71-
}
72-
73-
declare module '@commitlint/cli/src/cli' {
74-
declare module.exports: any
75-
}
76-
77-
declare module '@commitlint/cli/src/cli.test' {
78-
declare module.exports: any
79-
}
80-
81-
declare module '@commitlint/cli/src/help' {
37+
declare module '@commitlint/cli/lib/types' {
8238
declare module.exports: any
8339
}
8440

8541
// Filename aliases
86-
declare module '@commitlint/cli/fixtures/empty/commitlint.config.js' {
87-
declare module.exports: $Exports<
88-
'@commitlint/cli/fixtures/empty/commitlint.config'
89-
>
90-
}
91-
declare module '@commitlint/cli/fixtures/extends-root/extended.js' {
92-
declare module.exports: $Exports<
93-
'@commitlint/cli/fixtures/extends-root/extended'
94-
>
95-
}
96-
declare module '@commitlint/cli/fixtures/inner-scope/commitlint.config.js' {
97-
declare module.exports: $Exports<
98-
'@commitlint/cli/fixtures/inner-scope/commitlint.config'
99-
>
100-
}
101-
declare module '@commitlint/cli/fixtures/inner-scope/inner-scope/commitlint.config.js' {
102-
declare module.exports: $Exports<
103-
'@commitlint/cli/fixtures/inner-scope/inner-scope/commitlint.config'
104-
>
105-
}
106-
declare module '@commitlint/cli/fixtures/outer-scope/commitlint.config.js' {
107-
declare module.exports: $Exports<
108-
'@commitlint/cli/fixtures/outer-scope/commitlint.config'
109-
>
110-
}
111-
declare module '@commitlint/cli/fixtures/parser-preset/commitlint.config.js' {
112-
declare module.exports: $Exports<
113-
'@commitlint/cli/fixtures/parser-preset/commitlint.config'
114-
>
115-
}
116-
declare module '@commitlint/cli/fixtures/parser-preset/parser-preset.js' {
117-
declare module.exports: $Exports<
118-
'@commitlint/cli/fixtures/parser-preset/parser-preset'
119-
>
120-
}
121-
declare module '@commitlint/cli/fixtures/signoff/commitlint.config.js' {
122-
declare module.exports: $Exports<
123-
'@commitlint/cli/fixtures/signoff/commitlint.config'
124-
>
125-
}
126-
declare module '@commitlint/cli/fixtures/simple/commitlint.config.js' {
127-
declare module.exports: $Exports<
128-
'@commitlint/cli/fixtures/simple/commitlint.config'
129-
>
42+
declare module '@commitlint/cli/cli.js' {
43+
declare module.exports: $Exports<'@commitlint/cli/cli'>
13044
}
13145
declare module '@commitlint/cli/index' {
13246
declare module.exports: $Exports<'@commitlint/cli'>
13347
}
13448
declare module '@commitlint/cli/index.js' {
13549
declare module.exports: $Exports<'@commitlint/cli'>
13650
}
51+
declare module '@commitlint/cli/lib/cli-error.js' {
52+
declare module.exports: $Exports<'@commitlint/cli/lib/cli-error'>
53+
}
13754
declare module '@commitlint/cli/lib/cli.js' {
13855
declare module.exports: $Exports<'@commitlint/cli/lib/cli'>
13956
}
140-
declare module '@commitlint/cli/lib/cli.test.js' {
141-
declare module.exports: $Exports<'@commitlint/cli/lib/cli.test'>
142-
}
143-
declare module '@commitlint/cli/lib/help.js' {
144-
declare module.exports: $Exports<'@commitlint/cli/lib/help'>
145-
}
146-
declare module '@commitlint/cli/src/cli.js' {
147-
declare module.exports: $Exports<'@commitlint/cli/src/cli'>
148-
}
149-
declare module '@commitlint/cli/src/cli.test.js' {
150-
declare module.exports: $Exports<'@commitlint/cli/src/cli.test'>
151-
}
152-
declare module '@commitlint/cli/src/help.js' {
153-
declare module.exports: $Exports<'@commitlint/cli/src/help'>
57+
declare module '@commitlint/cli/lib/types.js' {
58+
declare module.exports: $Exports<'@commitlint/cli/lib/types'>
15459
}

flow-typed/npm/@commitlint/config-conventional_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 211481ade58a5d1b48d157e08d068cc3
2-
// flow-typed version: <<STUB>>/@commitlint/config-conventional_v^5.2.3/flow_v0.61.0
1+
// flow-typed signature: 2bf85954b2f8e045350ae8342f86cbc2
2+
// flow-typed version: <<STUB>>/@commitlint/config-conventional_v^11.0.0/flow_v0.143.1
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/@jedwards1211/eslint-config-flow_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 7be3f328e60a5bb311c142ba0bf1e16d
2-
// flow-typed version: <<STUB>>/@jedwards1211/eslint-config-flow_v^1.0.0/flow_v0.61.0
1+
// flow-typed signature: 96e95672a8479aaf556c03d9e58bc958
2+
// flow-typed version: <<STUB>>/@jedwards1211/eslint-config-flow_v^3.0.0/flow_v0.143.1
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/@jedwards1211/eslint-config_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 6be0a15102c7305fbc30e7744c9e0e60
2-
// flow-typed version: <<STUB>>/@jedwards1211/eslint-config_v^1.0.0/flow_v0.61.0
1+
// flow-typed signature: 0aa06c4e27f7ffc928e3deeaeb373387
2+
// flow-typed version: <<STUB>>/@jedwards1211/eslint-config_v^2.0.2/flow_v0.143.1
33

44
/**
55
* This is an autogenerated libdef stub for:

0 commit comments

Comments
 (0)