Skip to content

Commit

Permalink
feat: Improve TS Typings (#389)
Browse files Browse the repository at this point in the history
Enabled strict TS compiler rules, avoid usage of `any`
Offer concrete typings throughout the library

NODE-2717
  • Loading branch information
nbbeeken committed Sep 15, 2020
1 parent 9aad874 commit ae9ae2d
Show file tree
Hide file tree
Showing 33 changed files with 3,388 additions and 3,860 deletions.
20 changes: 17 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
"ecmaVersion": 2017
},
"plugins": [
"prettier"
"prettier",
"eslint-plugin-tsdoc"
],
"rules": {
"prettier/prettier": "error",
"tsdoc/syntax": "warn",
"no-console": "off",
"eqeqeq": [
"error",
Expand All @@ -33,11 +35,23 @@
"null": "ignore"
}
],
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
"strict": [
"error",
"global"
],
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-var-requires": "off"
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"Function": false
}
}
]
}
}
4 changes: 2 additions & 2 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"logLevel": "warning"
},
"ae-internal-missing-underscore": {
"logLevel": "none",
"logLevel": "error",
"addToApiReportFile": false
},
"ae-missing-release-tag": {
Expand All @@ -39,7 +39,7 @@
},
"ae-unresolved-link": {
"addToApiReportFile": false,
"logLevel": "none"
"logLevel": "error"
}
},
"tsdocMessageReporting": {
Expand Down
13 changes: 10 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,19 @@ module.exports = function (config) {
output: {
format: 'iife',
name: 'BSONtest',
sourcemap: true,
sourcemap: 'inline',
exports: 'named'
},
onwarn(warning) {
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
console.warn(warning.toString());
}
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
reporters: ['mocha'],

// web server port
port: 9876,
Expand Down Expand Up @@ -79,6 +83,9 @@ module.exports = function (config) {

// Concurrency level
// how many browser should be started simultaneous
concurrency: 1
concurrency: 1,

// Console log print outs will be prefaced with `LOG:` for grep
client: { captureConsole: true }
});
};
Loading

0 comments on commit ae9ae2d

Please sign in to comment.