Skip to content

Commit 04fa0b2

Browse files
committed
refactor: port load to typescript [wip]
1 parent 6332d97 commit 04fa0b2

12 files changed

+438
-398
lines changed

@commitlint/load/package.json

+7-32
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,13 @@
33
"version": "8.1.0",
44
"description": "Load shared commitlint configuration",
55
"main": "lib/index.js",
6+
"types": "lib/index.d.ts",
67
"files": [
78
"lib/"
89
],
910
"scripts": {
10-
"build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps",
1111
"deps": "dep-check",
12-
"pkg": "pkg-check --skip-import",
13-
"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
14-
"test": "ava -c 4 --verbose && ava \"src/*.serial-test.js\" --verbose",
15-
"watch": "babel src --out-dir lib --watch --source-maps"
16-
},
17-
"ava": {
18-
"files": [
19-
"src/**/*.test.js",
20-
"!lib/**/*"
21-
],
22-
"source": [
23-
"src/**/*.js",
24-
"!lib/**/*"
25-
],
26-
"babel": "inherit",
27-
"require": [
28-
"babel-register"
29-
]
30-
},
31-
"babel": {
32-
"presets": [
33-
"babel-preset-commitlint"
34-
]
12+
"pkg": "pkg-check --skip-import"
3513
},
3614
"engines": {
3715
"node": ">=4"
@@ -58,19 +36,16 @@
5836
"devDependencies": {
5937
"@commitlint/test": "8.0.0",
6038
"@commitlint/utils": "^8.1.0",
61-
"ava": "0.22.0",
62-
"babel-cli": "6.26.0",
63-
"babel-preset-commitlint": "^8.0.0",
64-
"babel-register": "6.26.0",
65-
"concurrently": "3.6.1",
66-
"cross-env": "5.1.1",
39+
"@types/cosmiconfig": "5.0.3",
40+
"@types/lodash": "4.14.136",
6741
"execa": "0.11.0",
68-
"globby": "10.0.1"
42+
"globby": "10.0.1",
43+
"proxyquire": "2.1.1",
44+
"typescript": "3.5.3"
6945
},
7046
"dependencies": {
7147
"@commitlint/execute-rule": "^8.1.0",
7248
"@commitlint/resolve-extends": "^8.1.0",
73-
"babel-runtime": "^6.23.0",
7449
"chalk": "2.4.2",
7550
"cosmiconfig": "^5.2.0",
7651
"lodash": "4.17.14",

@commitlint/load/src/index.serial-test.js renamed to @commitlint/load/src/index.serial-test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import {fix} from '@commitlint/test';
21
import test from 'ava';
32

3+
const {fix} = require('@commitlint/test');
4+
45
import load from '.';
56

67
test.serial('default cwd option to process.cwd()', async t => {

0 commit comments

Comments
 (0)