From 46f838b3799193283bbfc01355e405908ebfe1e3 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 3 May 2021 15:22:30 +1000 Subject: [PATCH] Add few tsconfig rules --- tsconfig.json | 13 +++++++------ web-chat/src/App.tsx | 2 +- web-chat/tsconfig.json | 5 ++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 5c85161103..ac42bdb78f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,18 +14,19 @@ "strict": true /* Enable all strict type-checking options. */, /* Strict Type-Checking Options */ - // "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - // "strictNullChecks": true /* Enable strict null checks. */, - // "strictFunctionTypes": true /* Enable strict checking of function types. */, - // "strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, - // "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, - // "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + "strictNullChecks": true /* Enable strict null checks. */, + "strictFunctionTypes": true /* Enable strict checking of function types. */, + "strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, + "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, + "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, /* Additional Checks */ "noUnusedLocals": true /* Report errors on unused locals. */, "noUnusedParameters": true /* Report errors on unused parameters. */, "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + "forceConsistentCasingInFileNames": true, /* Debugging Options */ "traceResolution": false /* Report module resolution log messages. */, diff --git a/web-chat/src/App.tsx b/web-chat/src/App.tsx index 64ef9bc25f..5f4a890d3b 100644 --- a/web-chat/src/App.tsx +++ b/web-chat/src/App.tsx @@ -1,6 +1,6 @@ import { multiaddr } from 'multiaddr'; import PeerId from 'peer-id'; -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import './App.css'; import { ChatMessage } from 'waku-chat/chat_message'; import { WakuMessage } from 'waku/waku_message'; diff --git a/web-chat/tsconfig.json b/web-chat/tsconfig.json index 669bc8f97d..01588d1cdd 100644 --- a/web-chat/tsconfig.json +++ b/web-chat/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "target": "es5", + "incremental": true, + "target": "es2017", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -8,6 +9,8 @@ "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node",