From 383a505ecc6a62bb0f85122c671bbae99b133063 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Thu, 30 Jan 2020 18:04:05 -0500 Subject: [PATCH] (types): enforce stricter typings - noUnusedParameters, noImplicitReturns, and noFallthroughCasesInSwitch - improve typings for 1 unused parameter and 1 implicit return - also remove noImplicitAny as that's redundant with strict: true --- src/babelPluginTsdx.ts | 2 +- src/createEslintConfig.ts | 2 +- tsconfig.json | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/babelPluginTsdx.ts b/src/babelPluginTsdx.ts index 66145ebb5..db017fe82 100644 --- a/src/babelPluginTsdx.ts +++ b/src/babelPluginTsdx.ts @@ -47,7 +47,7 @@ export const createConfigItems = (type: any, items: any[]) => { }); }; -export const babelPluginTsdx = babelPlugin.custom((babelCore: any) => ({ +export const babelPluginTsdx = babelPlugin.custom(() => ({ // Passed the plugin options. options({ custom: customOptions, ...pluginOptions }: any) { return { diff --git a/src/createEslintConfig.ts b/src/createEslintConfig.ts index 41fbb4136..26b356eb0 100644 --- a/src/createEslintConfig.ts +++ b/src/createEslintConfig.ts @@ -14,7 +14,7 @@ export async function createEslintConfig({ pkg, rootDir, writeFile, -}: CreateEslintConfigArgs): Promise { +}: CreateEslintConfigArgs): Promise { const isReactLibrary = Boolean(getReactVersion(pkg)); const config = { diff --git a/tsconfig.json b/tsconfig.json index 4ddd72340..b1e42b698 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,8 +11,10 @@ "module": "commonjs", "rootDir": "src", "strict": true, - "noImplicitAny": true, "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "skipLibCheck": true, "target": "es2017" }