Skip to content

Commit

Permalink
Add TSDoc linter rules
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Oct 29, 2024
1 parent adb9a68 commit edbc8c1
Show file tree
Hide file tree
Showing 10 changed files with 235 additions and 79 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
'plugins': [
'react',
'@typescript-eslint',
'eslint-plugin-tsdoc',
'import'
],
'rules': {
Expand Down Expand Up @@ -56,5 +57,11 @@ module.exports = {
'import/no-self-import': 'error',
'import/no-default-export': 'error',
}
}, {
// Enable TSDoc rules for TypeScript files, allowing the use of JSDoc in JS files.
'files': ['**/*.ts'],
'rules': {
'tsdoc/syntax': 'warn'
}
}],
};
199 changes: 176 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"eslint-plugin-compat": "^4.1.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-tsdoc": "^0.3.0",
"husky": "^3.1.0",
"jest": "^27.2.3",
"react": "^18.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/utils/promiseWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* - setting an `onFinally` handler as the first handler (e.g. `promiseWrapper(Promise.reject()).finally(...)`)
* - setting more than one handler with at least one of them being an onRejected handler
*
* @param customPromise promise to wrap
* @param defaultOnRejected default onRejected function
* @param customPromise - Promise to wrap
* @param defaultOnRejected - Default onRejected function
* @returns a promise that doesn't need to be handled for rejection (except when using async/await syntax).
*/
export default function promiseWrapper(customPromise: Promise<any>, defaultOnRejected: (_: any) => any): Promise<any> {
Expand Down
Loading

0 comments on commit edbc8c1

Please sign in to comment.