Skip to content

Commit ae9ae2d

Browse files
authored
feat: Improve TS Typings (#389)
Enabled strict TS compiler rules, avoid usage of `any` Offer concrete typings throughout the library NODE-2717
1 parent 9aad874 commit ae9ae2d

33 files changed

+3388
-3860
lines changed

.eslintrc.json

+17-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
"ecmaVersion": 2017
2222
},
2323
"plugins": [
24-
"prettier"
24+
"prettier",
25+
"eslint-plugin-tsdoc"
2526
],
2627
"rules": {
2728
"prettier/prettier": "error",
29+
"tsdoc/syntax": "warn",
2830
"no-console": "off",
2931
"eqeqeq": [
3032
"error",
@@ -33,11 +35,23 @@
3335
"null": "ignore"
3436
}
3537
],
38+
"@typescript-eslint/no-unused-vars": [
39+
"error",
40+
{
41+
"argsIgnorePattern": "^_"
42+
}
43+
],
3644
"strict": [
3745
"error",
3846
"global"
3947
],
40-
"@typescript-eslint/ban-types": "off",
41-
"@typescript-eslint/no-var-requires": "off"
48+
"@typescript-eslint/ban-types": [
49+
"error",
50+
{
51+
"types": {
52+
"Function": false
53+
}
54+
}
55+
]
4256
}
4357
}

api-extractor.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"logLevel": "warning"
2727
},
2828
"ae-internal-missing-underscore": {
29-
"logLevel": "none",
29+
"logLevel": "error",
3030
"addToApiReportFile": false
3131
},
3232
"ae-missing-release-tag": {
@@ -39,7 +39,7 @@
3939
},
4040
"ae-unresolved-link": {
4141
"addToApiReportFile": false,
42-
"logLevel": "none"
42+
"logLevel": "error"
4343
}
4444
},
4545
"tsdocMessageReporting": {

karma.conf.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ module.exports = function (config) {
4040
output: {
4141
format: 'iife',
4242
name: 'BSONtest',
43-
sourcemap: true,
43+
sourcemap: 'inline',
4444
exports: 'named'
45+
},
46+
onwarn(warning) {
47+
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
48+
console.warn(warning.toString());
4549
}
4650
},
4751

4852
// test results reporter to use
4953
// possible values: 'dots', 'progress'
5054
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
51-
reporters: ['progress'],
55+
reporters: ['mocha'],
5256

5357
// web server port
5458
port: 9876,
@@ -79,6 +83,9 @@ module.exports = function (config) {
7983

8084
// Concurrency level
8185
// how many browser should be started simultaneous
82-
concurrency: 1
86+
concurrency: 1,
87+
88+
// Console log print outs will be prefaced with `LOG:` for grep
89+
client: { captureConsole: true }
8390
});
8491
};

0 commit comments

Comments
 (0)