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

Fix some errors found when run typescript compiler #144

Merged
merged 3 commits into from
May 23, 2021

Conversation

Mingun
Copy link
Member

@Mingun Mingun commented May 3, 2021

Some errors, catched with the following change in the tsconfig.json and running npm run ts:

 tsconfig.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tsconfig.json b/tsconfig.json
index fe8a4420..bee30bbf 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -4,7 +4,7 @@
     "module": "commonjs",                           /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
     // "lib": [],                                   /* Specify library files to be included in the compilation. */
     "allowJs": true,                                /* Allow javascript files to be compiled. */
-    "checkJs": false,                               /* Report errors in .js files. */
+    "checkJs": true,                                /* Report errors in .js files. */
     // "jsx": "preserve",                           /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
     "declaration": true,                            /* Generates corresponding '.d.ts' file. */
     "declarationMap": false,                         /* Generates a sourcemap for each corresponding '.d.ts' file. */
@@ -14,8 +14,8 @@
     "removeComments": true,                         /* Do not emit comments to output. */
 
   /* over time we will enable these */
-    // "strict": true,                              /* Enable all strict type-checking options. */
-    // "noImplicitAny": true,                       /* Raise error on expressions and declarations with an implied 'any' type. */
+    "strict": true,                                 /* Enable all strict type-checking options. */
+    "noImplicitAny": false,                         /* 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. */
     // "strictBindCallApply": true,                 /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
@@ -34,5 +34,5 @@
     "skipLibCheck": true,                           /* Skip type checking of declaration files. */
     "forceConsistentCasingInFileNames": true        /* Disallow inconsistently-cased references to the same file. */
   },
-  "include": ["./lib/**/*.js", "./test/**/*.spec.js", "./benchmark/*.js"]
+  "include": ["./lib/**/*.js", "./test/**/*.spec.js"]
 }

Because I anyway replace all arguments usage with the rest parameters, I also made a small improvement in the default visitor behavior for visitExpression methods: make it returns a value of the visited expression. Now you no longer need to override that methods just to return values

@hildjj hildjj mentioned this pull request May 20, 2021
@hildjj hildjj added this to the 1.2 milestone May 22, 2021
@Mingun
Copy link
Member Author

Mingun commented May 23, 2021

Rebased and ready to merge

@hildjj hildjj merged commit d611345 into peggyjs:main May 23, 2021
@Mingun Mingun deleted the ts-errors-fix branch May 23, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants