-
Notifications
You must be signed in to change notification settings - Fork 252
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
include and exclude have no effect #207
Comments
Agreed. Maybe we can remove that and provide this excerpt in the README file and instruct users to manually add it: {
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
} |
Summary: This removes the 4 ineffective and redundant entries from the `exclude` list in `tsconfig.json` (`typescript-config` package). These entries have no effect as they are relative to the typescript-config package. Explained in detail here: tsconfig/bases#207 A newly generated RN app shows this config: ``` $ yarn tsc --showConfig | grep -A 5 exclude "exclude": [ "node_modules/tsconfig/react-native/node_modules", "node_modules/tsconfig/react-native/babel.config.js", "node_modules/tsconfig/react-native/metro.config.js", "node_modules/tsconfig/react-native/jest.config.js" ] ``` Clearly, none of these files exist, therefore to remove ambiguity and reduce the complexity of the config, they should be removed. ## Changelog: [GENERAL] [REMOVED] - Remove ineffective excludes from typescript-config Pull Request resolved: #42375 Test Plan: - Create new RN app (`npx react-native init`), install dependencies, run `yarn tsc` - It works - Recreate config, but _without_ the `exclude` section - Everything works exactly the same Reviewed By: huntie Differential Revision: D52904713 Pulled By: NickGerleman fbshipit-source-id: d1d6f65b164053f9a1e611022178ced032a38aef
Wouldn't using |
The main readme file is misleading and the example code it has is not working due to this behavior. |
You are welcome to add notices to the configs when it makes sense, like we did with |
@orta the whole I can update the docs and the configuration to latest version which I also found previous attempts of similar changes in #232 and #243 but none of them landed. Just asking before making changes if you are okay with them |
Strange, I accepted one, unsure why it didn't land. Seems fine with me |
Hi,
tsconfig.json
files specified usingextends
will haveinclude
andexclude
paths relative to their location, as per the include docs:So a config like Next.js base install with
npm
will produce a typescript error:for a tsconfig.json like:
Not specify
include
andexclude
in base template can remove ambiguityHave a nice day
The text was updated successfully, but these errors were encountered: