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

Update tsconfig of example to be consistent with default output of next.js #25581

Merged
merged 2 commits into from
Jun 3, 2021

Conversation

daku10
Copy link
Contributor

@daku10 daku10 commented May 29, 2021

remove alwaysStrict: true rule from tsconfig.json in with-typescript example, because the rule is included in strict: true has been already written in tsconfig.json and other included rules such as noImplicitAny: true have not been written.

tsconfig documentation link

Documentation / Examples

  • Make sure the linting passes

@ijjk ijjk added the examples Issue/PR related to examples label May 29, 2021
Copy link
Member

@leerob leerob left a comment

Choose a reason for hiding this comment

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

Has this been removed from the default TypeScript setup as well? It seems so. We should probably update these ones too: https://github.com/vercel/next.js/search?q=alwaysStrict

@daku10
Copy link
Contributor Author

daku10 commented May 31, 2021

Thanks for reviewing!
I'm not sure what is the default TypeScript setup but probably you are right.
This tsconfig is different from one of current next.js created and also one of tsc --init of Typescript@4.0.
This tsconfig is similar to one of the next.js official, but it is stricter than the official one.
What should I do?

Below is a sample of next.js 10.2.3 created

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  },
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx"
  ],
  "exclude": [
    "node_modules"
  ]
}

@daku10
Copy link
Contributor Author

daku10 commented May 31, 2021

I am not sure what is the best tsconfig for examples, but all of tsconfig of examples you suggested has the redundant rule.
Therefore I pushed a commit to remove them.
I can squash commits, if this pull request is approved.

@leerob
Copy link
Member

leerob commented May 31, 2021

Let's be consistent with the default output of new Next.js projects 😄

@daku10 daku10 changed the title remove redundant tsconfig rule @daku10 Update tsconfig of example to be consistent with default output of next.js Jun 1, 2021
@daku10 daku10 changed the title @daku10 Update tsconfig of example to be consistent with default output of next.js Update tsconfig of example to be consistent with default output of next.js Jun 1, 2021
@daku10
Copy link
Contributor Author

daku10 commented Jun 1, 2021

Thank you for replying!
I updated tsconfig of examples you suggested to be consistent with the default output except with-electron-typescript/electron-src/tsconfig.json, because it is not next.js project.
p.s. with-electron-typescript/renderer/tsconfig is a next.js project and updated.

leerob
leerob previously approved these changes Jun 1, 2021
Copy link
Member

@leerob leerob left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!

@daku10
Copy link
Contributor Author

daku10 commented Jun 1, 2021

Sorry to bother you, I forgot to apply format
Finally I understand meaning of Make sure the linting passes in the pull request format.

@kodiakhq kodiakhq bot merged commit 9d14dd8 into vercel:canary Jun 3, 2021
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Jun 16, 2021
…xt.js (vercel#25581)

remove `alwaysStrict: true` rule from tsconfig.json in with-typescript example, because the rule is included in `strict: true` has been already written in tsconfig.json and other included rules such as `noImplicitAny: true` have not been written.  

[tsconfig documentation link](https://www.typescriptlang.org/tsconfig#alwaysStrict)

## Documentation / Examples

- [x] Make sure the linting passes
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants