Closed simeon-raykov closed 1 year ago
Hey Simeon ! I think I had the same issue (see #17966) I think they are working on it
Hi there @simeon-raykov ! Thanks for filing an issue! It would be super useful if you could provide a small reproduction repository of the issue you are experiencing, and how this is causing you trouble in this case! If you don't want the project-level tsconfig you may remove it, but please let me know how this is blocking you!
@mandarini It is blocking me because there is now a test that searches for tsconfig.json when running the command "yarn nx migrate --run-migrations"
Hey!
I still get a similar error on linting with the latest 16.6.0-beta.1
🤔
On linting with @nx/linter:eslint
I get the following errors:
...
/Users/francois/Projects/org/repo/libs/widgets/my-widget/v2/tailwind.config.js
0:0 error Parsing error: Cannot read file '/users/francois/projects/org/repo/libs/widgets/my-widget/v2/.storybook/tsconfig.json'
✖ 67 problems (67 errors, 0 warnings)
Seems to happen for all projects using storybook, there is no tsconfig.json in the .storybook folder. Only at a project level.
Currently migrating from 15.6.3
Note: creating an empty tsconfig.json file in the .storybook folders seem to stop the lint error
@Lp-Francois I adjusted our migrator to change that as well. Can I see your eslintrc
file please? Does it contain the path to that file?
Hey @mandarini ,
The .eslintrc.json in one of the project failing looks like this:
{
"extends": ["plugin:@nx/react", "../../../../.eslintrc.js"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": [
"libs/widgets/my-widget/v2/tsconfig.*?.json",
"libs/widgets/my-widget/v2/.storybook/tsconfig.json"
]
},
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
So yes it contains the path to .storybook/tsconfig.json
. Should I remove it manually?
I have a tsconfig.storybook.json
in the same folder, and no tsconfig.json
in .storybook
Note: deleting the line "libs/[...any project path...]/.storybook/tsconfig.json"
in all storybook projects seems to pass the linting 👌 I guess the migrator should delete the line if present?
Yes, that's what I added in the migrator! :)
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
My team can't upgrade to v.16.5.0 because of storybook. It now requires us to have a local level tsconfig.json but we don't think we need that because it will only inherit from the base config and it will add additional complexity. This is a demo of our project structure:
├── .storybook/ │ ├── main.ts │ ├── manager.ts │ ├── preview-head.html │ ├── test-runner.ts │ ├── tsconfig.json ├── apps/ │ ├── demo/ │ │ ├── host/ | │ │ ├── components/ | │ │ ├───.stories.tsx │ │ ├── remote/ | │ │ ├── components/ | │ │ ├───.stories.tsx │ │ ├── storybook/ | │ │ ├── .storybook/ | │ │ ├─── main.ts | │ │ ├─── manager.ts | │ │ ├─── preview.ts | │ │ ├─── test-runner.ts | │ │ ├─── project.json ├── libs/ │ ├── demo/ │ │ ├── ui/ | │ │ ├── src/ | │ │ ├───*.stories.tsx
We have made all of the configurations needed in our root level .storybook and only inherit them in our demo scoped storybook app. Our demo scoped storybook main.ts file only imports the stories like this:
Expected Behavior
Migration should run successfully without the need of additional tsconfig.json
Nx Report
Failure Logs
Operating System