Below is a snippet of my code, where eslint indent lints my multiline ternary expression:
https://i.sstatic.net/tGFShAyf.png
This is the error I am encountering:
Expected indentation of 8 spaces but found 16. eslint(indent)
Despite specifying 4 spaces per indent, eslint is expecting only 2. I had a similar issue with Switch Case previously, which was resolved by editing the .eslintrc.json
. However, this time, I haven't been able to find a solution like that.
My .eslintrc.json
:
{
"env": { "browser": true, "node": true },
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 2020 },
"extends": [""eslint:recommended", "e;"plugin:@typescript-eslint/recommended"&, "plugin:prettier/recommended"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-use-before-define": ["error", { "functions": false }],
"@typescript-eslint/no-var-requires": "off",
"indent": ["error", 4, {"SwitchCase": 1}],
"prettier/prettier": ["error", { "endOfLine": "auto" }]
}
}
I am seeking guidance on how to resolve this linting error.