correctness/useJsonImportAttributes
correctness · since 2.0.0
Safe autofix
biome.json
{
"linter": {
"rules": {
"correctness": {
"useJsonImportAttributes": "error"
}
}
}
}Enforces the use of with { type: "json" } for JSON module imports.
import jsonData from './data.json';import jsonData from './data.json' with { someOtherAttribute: "value" };import jsonData from './data.json' with { type: "json" };
import jsonData from './data.json' with { type: "json", other: "value" };
import code from './script.js'; // Not a JSON importExamples from the Biome documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
ESLint does not have this rule.
Oxlint does not have this rule.
correctness/useJsonImportAttributes
correctness · since 2.0.0
{
"linter": {
"rules": {
"correctness": {
"useJsonImportAttributes": "error"
}
}
}
}Detects a disposable object assigned to a variable without using or await using syntax.
Require a valid deletion date on the @deprecated directive.
Prefer logical CSS properties over physical properties.
Enforce a consistent notation for the lightness of colors.