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

How to resolve check-node-env while linting JSX component #3235

Closed
daxit opened this issue Jun 1, 2022 · 2 comments
Closed

How to resolve check-node-env while linting JSX component #3235

daxit opened this issue Jun 1, 2022 · 2 comments
Labels

Comments

@daxit
Copy link

daxit commented Jun 1, 2022

Summary

When I updated electron boilerplate to the latest version I started getting this error when trying to lint my components through the eslint plugin in VSCode. I would appreciate some help in figuring out how to best resolve this issue.

[Info  - 6:54:38 PM] ⨯ Unable to compile TypeScript: frontend/.erb/configs/webpack.config.renderer.dev.ts(12,26): error TS7016: Could not find a declaration file for module '../scripts/check-node-env'. '/Users/daxitagarwal/Documents/opaque/frontend/.erb/scripts/check-node-env.js' implicitly has an 'any' type.  Occurred while linting /Users/daxitagarwal/Documents/opaque/frontend/src/components/ManageUser/ManageUserView.js:5 Rule: "import/no-cycle"
@daxit daxit added the question label Jun 1, 2022
@daxit
Copy link
Author

daxit commented Jun 1, 2022

Update: I appended the node config in my eslintrc and that seemed to work. Though I'm not sure if that's the best solution.

settings: {
    'import/resolver': {
      // See https://github.com/benmosher/eslint-plugin-import/issues/1396#issuecomment-575727774 for line below
      node: {
        extensions: ['.js', '.jsx', '.ts', '.tsx'],
        moduleDirectory: ['node_modules', 'src/'],
      },
      webpack: {
        config: require.resolve('./.erb/configs/webpack.config.eslint.ts'),
      },
      typescript: {},
    },
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx'],
    },
  },

@daxit daxit changed the title Error with check-node-env while linting JSX component How to resolve check-node-env while linting JSX component Jun 2, 2022
@amilajack
Copy link
Member

Unable to repro. Please comment if you're still running into this issue

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

No branches or pull requests

2 participants