I’ve not yet gone down the flat-config path but I’m setting up ESLint for a new NextJS Typescript project in VSCode and find that I cannot configure the “@typescript-eslint/quotes” rule to enforce double-quotes rather than single-quotes.
For non-Typescript ESLint I’d just use:
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
Checking the “@typescript-eslint/quotes” page doesn’t really describe how to config any options, and applying the same formatting as the non-typescript:
"@typescript-eslint/quotes": [
"error",
"double",
{
"allowTemplateLiterals": true
}
],
shows the error Array has too many items. Expected 2 or fewer.
.
Removing the third arg:
"@typescript-eslint/quotes": [
"error",
"double"
],
gives me the error Incorrect type. Expected "object"
on the “double” arg. It seems to just want error/off/warn for the first arg and an object for the second (?) but I can’t find any docs on how to do that to mark single quotes with an error.
For now I’ve disabled the typescript rule and enabled the normal ESLint version, but is the “@typescript-eslint/quotes” rule not configurable for double-quotes. What am I missing? Thanks!