K
K
KBBS2021-02-22 19:58:30
JavaScript
KBBS, 2021-02-22 19:58:30

Why does eslint --fix replace quotes with double quotes, ignoring the quotes rule from .eslintrc.js?

When using eslint --fix, for some reason, single quotes are replaced by double ones. In this case, the quotes value from the rules section of .eslintrc.js is completely ignored.
Even if I set it to off (in this case, as I understand it, the rule should not be processed at all), the replacement still occurs.

Below is the content of .eslintrc.js.

Why is this happening and what exactly am I doing wrong?
I will be grateful for help.

module.exports = {
    root: true,
    env: {
        node: true,
    },
    extends: [
        "plugin:vue/vue3-essential",
        "eslint:recommended",
        "@vue/prettier",
    ],
    parserOptions: {
        parser: "@babel/eslint-parser",
        requireConfigFile: false,
    },
    rules: {
        "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
        "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
        quotes: "off",
    },
};


--print-config shows quotes: off.

"quotes": [
    "off"
],

Those. the rule is picked up from a config.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DrWeyber, 2021-02-23
@KBBS

I usually use prettier for this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question