Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(types): enforce stricter typings #475

Merged
merged 1 commit into from
Feb 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/babelPluginTsdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/createEslintConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function createEslintConfig({
pkg,
rootDir,
writeFile,
}: CreateEslintConfigArgs): Promise<CLIEngine.Options['baseConfig']> {
}: CreateEslintConfigArgs): Promise<CLIEngine.Options['baseConfig'] | void> {
Copy link
Collaborator Author

@agilgur5 agilgur5 Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I typed it as void as well because it seems intentional that when --writeFile succeeds, it doesn't return config (because it does return config when it errors/the catch case), but I'm not sure if that actually is intentional.

Maybe it makes sense to return config in all cases? Idk, I don't normally touch much code outside of tsdx build

const isReactLibrary = Boolean(getReactVersion(pkg));

const config = {
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"module": "commonjs",
"rootDir": "src",
"strict": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"target": "es2017"
}
Expand Down