tsdx
tsdx copied to clipboard
eslint error on running lint command
Current Behavior
I created a new tsdx app basic storybook app and run the lint command.
Error while running npm run lint command

Any solutions to this currently in existence or workarounds using plain eslint files ?
Hi there, I solved it by fixing eslint-plugin-prettier to "3.3.1" ✅
I am having same issue 😢
steps to reproduce
- npx tsdx create mylib
- cd ./mylib
- yarn lint
Resulting in the error below:

I had to do the following in tsdx based project to fix this
1. Add eslint-plugin-prettier package
Executeyarn add -D eslint-plugin-prettier or npm equivalent to add the latest package.
Shouldn't it be installed as part of tsdx, the way eslint or jest are installed?
2. Upgrade eslint package
I got some further eslint issues like this one and I also wanted to upgrade eslint independently of tsdx. Followed the answer inspired from this reply about installing Jest independently.
Here are the package.json resolutions overriding tsdx internal packages versions
{
"resolutions": {
"**/tsdx/jest": "27.5.1",
"**/tsdx/ts-jest": "27.1.5",
"**/tsdx/eslint": "^7.32.0"
}
}
It works but is this a correct way to override tsdx internal package versions? I think tsdx versions should upgrade more often to upgrade these packages, the last npm published package was 2 years ago.
3. Add any eslint plugin package (Optional)
If you have a separate eslint config file containing a number of plugins that you want to use, add each of them using yarn add -D <eslint-plugin-name> or npm equivalent to add the plugin packages.
4. Run lint
Execute yarn run lint now and it should report ESLint problems.
I think this is still broken on the main branch of tsdx