Closed iamhaaamed closed 1 week ago
@iamhaaamed how did you test that, the eslint plugins are working as expected in the repo project at least
@iamhaaamed how did you test that, the eslint plugins are working as expected in the repo project at least
I can not see linting errors in real-time as I code:
Can you run pnpm lint to amke sure if tge issue is related only to cide editor
after runnuing pnpm lint
:
> locator@0.0.1 lint /Users/wayne/Projects/App
> eslint . --ext .js,.jsx,.ts,.tsx
Oops! Something went wrong! :(
ESLint: 8.57.0
ESLint couldn't find the plugin "eslint-plugin-import".
(The package "eslint-plugin-import" was not found when loaded as a Node module from the directory "/Users/wayne/Projects/App".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install eslint-plugin-import@latest --save-dev
The plugin "eslint-plugin-import" was referenced from the config file in ".eslintrc.js » eslint-config-expo » ./utils/core.js".
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
ELIFECYCLE Command failed with exit code 2.
then after running pnpm i eslint-plugin-import@latest -D
and then running pnpm lint
again:
> locator@0.0.1 lint /Users/wayne/Projects/App
> eslint . --ext .js,.jsx,.ts,.tsx
=============
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0
YOUR TYPESCRIPT VERSION: 5.5.3
Please only submit bug reports when using the officially supported version.
=============
Oops! Something went wrong! :(
ESLint: 8.57.0
EslintPluginImportResolveError: Error while loading rule 'import/no-cycle': typescript with invalid interface loaded as resolver
Occurred while linting /Users/wayne/Projects/App/src/api/auth/index.ts
at requireResolver (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/node_modules/eslint-module-utils/resolve.js:110:17)
at fullResolve (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/node_modules/eslint-module-utils/resolve.js:199:22)
at Function.relative (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/node_modules/eslint-module-utils/resolve.js:216:10)
at RemotePath.resolve (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/lib/exportMap/remotePath.js:10:37)
at captureDependency (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/lib/exportMap/captureDependency.js:35:362)
at captureDependencyWithSpecifiers (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/lib/exportMap/captureDependency.js:59:3)
at ImportExportVisitorBuilder.ImportDeclaration (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/lib/exportMap/visitor.js:67:70)
at /Users/wayne/Projects/App/node_modules/eslint-plugin-import/lib/exportMap/builder.js:189:35
at Array.forEach (<anonymous>)
at Function.parse (/Users/wayne/Projects/App/node_modules/eslint-plugin-import/lib/exportMap/builder.js:185:18)
ELIFECYCLE Command failed with exit code 2.
then after running pnpm i -D eslint-import-resolver-typescript
and then running pnpm lint
again, the errors are displayed in the terminal but not in the code editor
After reopening VS Code, it works. It seems that I just needed to install eslint-import-resolver-typescript
and eslint-plugin-import
as dev dependencies
Normally, you don't need to install eslint-import-resolver-typescript
and eslint-plugin-import
as they are dependencies required by eslint-config-expo
and should be installed automatically. I am not sure what causing this issue in your side but this issue shouldn't happen, also you can check your npmrc maybe you are missing something
Thank you for your response. My .npmrc
is set up exactly as you described, so I don't think that's where the issue lies. I also tried deleting the pnpm-lock.yaml file and the node_modules directory, but after reinstalling packages, it still required both eslint-import-resolver-typescript
and eslint-plugin-import
to be installed as dev dependencies...
@iamhaaamed interesting, probably we need another person to try it out and see.
@SihamBen, could you please help with the following? Create a new project using Cli and then run pnpm lint
to ensure everything is working as expected and we don't need to install those deps manually
Summary:
eslint plugins are not working on the latest version.
this is my eslintrc.js file:
and this is my package.json: