Skip to content

Bug: [flat config] Caching is not supported when parser is an object #16875

@liuweiGL

Description

@liuweiGL

Environment

Node version: v18.14.0
npm version: v9.3.1
Local ESLint version: v8.33.0 (Currently used)
Global ESLint version: Not found
Operating System: win32 10.0.19045

What parser are you using?

@babel/eslint-parser

What did you do?

eslint.config.js

import babelParser from '@babel/eslint-parser'

export default [
  {
    files: ['**/*.js', '**/*.mjs'],
    languageOptions: {
      parser: babelParser
    }
  }
]

What did you expect to happen?

Print the config detail

What actually happened?

PS C:\Users\liuwei\Desktop\gitlab\eastcoal-pc> pnpm eslint --print-config eslint.config.js

Oops! Something went wrong! :(

ESLint: 8.33.0

Error: Caching is not supported when parser is an object.
    at Object.value (C:\Users\liuwei\Desktop\gitlab\eastcoal-pc\node_modules\.pnpm\eslint@8.33.0\node_modules\eslint\lib\config\flat-config-array.js:188:27)
    at JSON.stringify (<anonymous>)
    at Object.execute (C:\Users\liuwei\Desktop\gitlab\eastcoal-pc\node_modules\.pnpm\eslint@8.33.0\node_modules\eslint\lib\cli.js:387:27)
    at async main (C:\Users\liuwei\Desktop\gitlab\eastcoal-pc\node_modules\.pnpm\eslint@8.33.0\node_modules\eslint\bin\eslint.js:135:24)

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

https://eslint.org/blog/2022/08/new-config-system-part-2/#custom-parsers-and-parser-options-are-mostly-the-same

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyrepro:yesIssues with a reproducible example

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions