Skip to content

Commit

Permalink
Merge pull request #126 from splitio/tsdoc_linter
Browse files Browse the repository at this point in the history
Refactor TypeScript declarations
  • Loading branch information
EmilianoSanchez authored Nov 12, 2024
2 parents ffd93c0 + 91e268c commit c3b937e
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 86 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'
}
}],
};
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
- Updated linter dependencies and rules. The deprecated TSLint package was replaced by ESLint.
- Updated some transitive dependencies for vulnerability fixes.
- Updated @splitsoftware/splitio package to version 10.22.4 that includes minor improvements.
- Bugfixing - Fixed error when using the SDK in localhost mode for testing with NodeJS test runners such as Jest (See https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#localhost-mode).
- Bugfixing - Fixed error when using the SDK in localhost mode for testing with Node.js test runners such as Jest (See https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#localhost-mode).

1.7.1 (November 15, 2022)
- Updated React Redux peer dependency range to include React-redux@8.x.x and React@18.x.x.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Split has built and maintains SDKs for:
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
* Node.js [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
* PHP thin-client [Github](https://github.com/splitio/php-thin-client) [Docs](https://help.split.io/hc/en-us/articles/18305128673933-PHP-Thin-Client-SDK)
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
Expand Down
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
2 changes: 1 addition & 1 deletion src/__tests__/utils/mockNodeSplitSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function mockSdk() {
const splits: jest.Mock = jest.fn().mockReturnValue([]);
const manager: jest.Mock = jest.fn().mockReturnValue({ names, split, splits });

// Client (only one client on Node SDK)
// Client (only one client on Node.js)
const __client__ = mockClient();
const client = jest.fn(() => {
return __client__;
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 c3b937e

Please sign in to comment.