From 3f4178d0cefd3ebc9a13156ef7046cc933c288e4 Mon Sep 17 00:00:00 2001 From: Minggang Wang Date: Tue, 11 Mar 2025 10:58:47 +0800 Subject: [PATCH 1/2] Use path in triple-slash directives Fix: #1073 --- tsconfig.json | 19 +++++++++++++++++ types/base.d.ts | 54 ++++++++++++++++++++++++------------------------ types/index.d.ts | 2 +- 3 files changed, 47 insertions(+), 28 deletions(-) create mode 100644 tsconfig.json diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..84ecd4a4 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "target": "es6", + /* Strict Type-Checking Options */ + "strict": true, + /* Additional Checks */ + /* next line commented out because we need unused vars for type tests */ + // "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "lib": ["es2017"] + }, + "include": [ + "types/**/*" + ] +} diff --git a/types/base.d.ts b/types/base.d.ts index c42583ab..8aaec44c 100644 --- a/types/base.d.ts +++ b/types/base.d.ts @@ -1,27 +1,27 @@ -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/types/index.d.ts b/types/index.d.ts index 5e761c65..603c0da0 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -/// +/// declare module 'rclnodejs' { /** From ff765d54a537ccd49235c295006561293f77893f Mon Sep 17 00:00:00 2001 From: Minggang Wang Date: Tue, 11 Mar 2025 11:23:58 +0800 Subject: [PATCH 2/2] Set triple-slash-reference off --- eslint.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index 1d12dd5f..a40fdcaa 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -43,6 +43,7 @@ export default [ rules: { ...typescriptEslint.configs.recommended.rules, "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/triple-slash-reference": "off", }, }, {