jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.2k stars 505 forks source link

eslint error on running lint command #1077

Open sanjeetiitr opened 2 years ago

sanjeetiitr commented 2 years ago

Current Behavior

I created a new tsdx app basic storybook app and run the lint command.

Error while running npm run lint command image

piyushchauhan2011 commented 2 years ago

Any solutions to this currently in existence or workarounds using plain eslint files ?

cbouvier15 commented 2 years ago

Hi there, I solved it by fixing eslint-plugin-prettier to "3.3.1"

LinnJS commented 2 years ago

I am having same issue 😢

steps to reproduce

1) npx tsdx create mylib 2) cd ./mylib 3) yarn lint

Resulting in the error below:

image

riteshjagga commented 2 years ago

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.

mimshwright commented 2 years ago

I think this is still broken on the main branch of tsdx