t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native
https://turbo.t3.gg
MIT License
4.28k stars 352 forks source link

bug: Eslint throws: TypeError: context.getSource is not a function when disabling/breaking react-hooks plugin rules. #1015

Closed ypanagidis closed 2 months ago

ypanagidis commented 2 months ago

Provide environment information

System: OS: macOS 14.4.1 CPU: (14) arm64 Apple M3 Max Memory: 10.59 GB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 21.7.1 - ~/.nvm/versions/node/v21.7.1/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v21.7.1/bin/npm pnpm: 9.0.6 - ~/Library/pnpm/pnpm bun: 1.1.0 - ~/.bun/bin/bun

Describe the bug

I noticed when I tried to disable react-hooks/exhaustive-deps eslint crashes. The lsp stops working in the specific file and even though the rule is disabled whenever I run pnpm lint it crashes failing ci with the error: TypeError: context.getSource is not a function

Furthermore I notice that if I add the deps in the deps array of the useEffect eslint lsp starts working again and the error is gone when doing pnpm lint.

Link to reproduction

https://github.com/ypanagidis/eslint-turbo-TypeError

To reproduce

  1. Clone the repo and cd into it
  2. Run pnpm install
  3. Run pnpm lint

Additional information

No response

juliusmarminge commented 2 months ago

should be fixed in https://github.com/t3-oss/create-t3-turbo/commit/19a823e66db0fa1c46bc2782a996c3caeb22e8f5

ypanagidis commented 2 months ago

Absolute legend, thank you so much!!!! Everything works perfectly!