Skip to content

Parameter 'a' implicitly has an 'any' type when attempting to run the first exercise #36

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

Closed
kqvanity opened this issue Sep 13, 2022 · 1 comment

Comments

@kqvanity
Copy link

kqvanity commented Sep 13, 2022

when i try to run the first exercise, I get the following error messages

Running tests...

 RUN  v0.21.1 /home/elementary/Downloads/beginners-typescript-tutorial

  src/01-number.problem.ts (1)

Test Files  1 passed (1)
     Tests  1 passed (1)
  Start at  14:16:57
  Duration  1.30s (setup 62ms, collect 27ms, tests 5ms)

Checking types...
src/01-number.problem.ts:3:31 - error TS7006: Parameter 'a' implicitly has an 'any' type.

3 export const addTwoNumbers = (a, b) => {
                                ~

src/01-number.problem.ts:3:34 - error TS7006: Parameter 'b' implicitly has an 'any' type.

3 export const addTwoNumbers = (a, b) => {
                                   ~


Found 2 errors in the same file, starting at: src/01-number.problem.ts:3

I've tried settings tsconfig.json's noImplicityAny' and strict` options to 'false' as advisable on the internet, but the error still persists. Any help?

@mattpocock
Copy link
Collaborator

The point of the exercise is to try and fix this error. When you fix the TS errors, the exercise will be marked as complete and you can continue to the next one!

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

No branches or pull requests

2 participants