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

You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. #690

Open
LeCoupa opened this issue Mar 19, 2025 · 1 comment

Comments

@LeCoupa
Copy link

LeCoupa commented Mar 19, 2025

Hello! 🙂 I'm trying to get the ts/no-unnecessary-condition rule working in our Turborepo, but I'm struggling with it. I keep running into the following issue:

Oops! Something went wrong! :(

ESLint: 9.15.0

Error: Error while loading rule 'ts/no-unnecessary-condition': You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://typescript-eslint.io/getting-started/typed-linting for enabling linting with type information.
Parser: (unknown)
Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.
module.exports = antfu(
  {
   // ...
  },
  {
    rules: {
      // ...
      'ts/no-unused-expressions': 'off',
    },
  },
)
@GollyJer
Copy link

GollyJer commented Mar 20, 2025

I'm getting the same error with...

'ts/naming-convention': [
   'error', 
   { selector: 'variable', format: ['camelCase', 'PascalCase', 'UPPER_CASE'], leadingUnderscore: 'allow' },
],

Highlighted what I think the issue is...
[Error - 1:35:54 PM] An unexpected error occurred:
[Error - 1:35:54 PM] Error: Error while loading rule 'ts/naming-convention': You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://typescript-eslint.io/getting-started/typed-linting for enabling linting with type information.
Parser: jsonc-eslint-parser
Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.
Occurred while linting C:\Users\Jeremy\label-maker\package.json

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

No branches or pull requests

2 participants