-
-
Notifications
You must be signed in to change notification settings - Fork 17
Bug: JSON v1.0.1 is not backward-compatible with ESLint v9.39.2 #213
Description
Environment
ESLint version: 9.39.2
@eslint/json version: 1.0.1
Node version: 20.19.1
npm version: 10.8.2
Operating System: Stackblitz
Which language are you using?
json
What did you do?
// eslint.config.js
import json from '@eslint/json';
import { defineConfig } from 'eslint/config';
export default defineConfig([
{
files: ['**/*.jsonc'],
plugins: { json },
language: 'json/jsonc',
extends: ['json/recommended'],
},
]);What did you expect to happen?
I expected the types in @eslint/json@1.0.1 to be compatible with ESLint v9.
According to the CI test strategy, README.md, and the comments in markdown (eslint/markdown#593 (comment)), JSON v1 is expected to remain backward compatible with ESLint v9.
Line 30 in 4106331
| eslint: [9.15.0, 9.x, 10.x] |
What actually happened?
The types in JSON v1 are not compatible with ESLint v9, which prevents using this plugin with ESLint v9 despite it being mentioned as compatible.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-kpy9aaea?file=eslint.config.js
Please run npm run tsc at the reproduction link.
Participation
- I am willing to submit a pull request for this issue.
Additional comments
The problem is that the ESLint.plugin type, which is extracted from import type { ESLint } from "eslint";, now has different type signatures:
- ESLint v9.39.2 depends on
@eslint/core0.17.0 - ESLint v10.0.0 depends on
@eslint/core1.1.0 - JSON v0.14.0 depends on
@eslint/core0.17.0 - JSON v1.0.1 depends on
@eslint/core1.1.0
So,
- JSON v1 and ESLint v10 is compatible. ✅
- JSON v1 and ESLint v9 is incompatible ❌
Another point is that the HEAD branches of CSS and Markdown are affected by this problem. I discovered it while working on eslint/markdown#593.
To summarize, my question is: do we need to retain type compatibility with ESLint v9 for JSON v1 / CSS v1 / and Markdown v8? If so, I think we need a fundamental solution to ensure these types work seamlessly. Since one of the primary aims of the major releases of language plugins was to maintain backward compatibility, I hope this issue can be addressed.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status