Skip to content

Conversation

@aladdin-add
Copy link
Contributor

@aladdin-add aladdin-add commented Jan 23, 2021

it also removed "include": ["src"] in create-react-app - it's not working as expected.

@orta
Copy link
Member

orta commented Jan 23, 2021

We probably can't do this, not all projects have "src" as their default folder I think

I think removing the src from react example, and keeping the README the same is probably the right call

@aladdin-add aladdin-add changed the title docs: update usage in readme fix: remove "src" in create-react-app/tsconfig.json Jan 23, 2021
@aladdin-add
Copy link
Contributor Author

aladdin-add commented Jan 23, 2021

well, reverted that changes. :)

@orta
Copy link
Member

orta commented Jan 23, 2021

Thanks! It will deploy overnight

@orta orta merged commit bed1423 into tsconfig:master Jan 23, 2021
@aladdin-add aladdin-add deleted the docs/update-usage branch January 24, 2021 02:22
@karlhorky
Copy link

karlhorky commented Oct 18, 2022

I ran into this problem today - tsconfig.json files specified using extends will have include and exclude paths relative to their location, as per the include docs:

These filenames are resolved relative to the directory containing the tsconfig.json file.

One way to get around it is to specify relative paths:

  "include": [
    "../../../../**/.eslintrc.cjs",
    "../../../../next-env.d.ts",
    "../../../../**/*.ts",
    "../../../../**/*.tsx",
    "../../../../**/*.js",
    "../../../../**/*.jsx",
    "../../../../**/*.cjs",
    "../../../../**/*.mjs"
  ],

But then you're encoding your node_modules directory structure into the config as well... 🤔

Hm... would be great to get a <root> capability to add to include and exclude paths to refer to the directory with the package.json file, like Jest's <rootDir> option:

  "include": [
    "<root>/**/*.ts"
  ]

@orta I guess this doesn't exist in TS, right?


Edit: opened a feature request in the TypeScript repo here: microsoft/TypeScript#51213

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.

3 participants