Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: eslint-plugin-import usage in VSCode with Yarn PnP #1984

Merged
merged 2 commits into from
Aug 2, 2022

Conversation

koistya
Copy link
Member

@koistya koistya commented Aug 2, 2022

Update ESLint configuration so that it doesn't use eslint-import-plugin in VSCode (editor) environment (conditionally).

NOTE: It still uses the plugin when running ESLint via a command line, e.g. yarn lint.

.vscode/settings.json
{
  "eslint.nodeEnv": "EDITOR"
}
.eslintrc.cjs
module.exports = [
  extends: [
    "eslint:recommended",
    process.env.NODE_ENV !== "EDITOR" && "plugin:import/recommended",
    process.env.NODE_ENV !== "EDITOR" && "plugin:import/typescript",
    "plugin:react-hooks/recommended",
    "prettier",
  ].filter(Boolean),
]

Ref microsoft/vscode-eslint#1494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant