Usage of @eslint/config tool with airbnb and prettier plugins

76 views Asked by At

Following eslint QuickStart documentation, I run the npm init @eslint/config and got a boilerplate .eslintrc as expected:

module.exports = {
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended"
    ],
    "overrides": [
        {
            "env": {
                "node": true
            },
            "files": [
                ".eslintrc.{js,cjs}"
            ],
            "parserOptions": {
                "sourceType": "script"
            }
        }
    ],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "ecmaVersion": "latest",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": {
    }
}

Then I tried extending the above configuration adding airbnb and prettier plugins, by running npm init @eslint/config -- --config airbnb,prettier

However, all previous configuration is gone and I am greeted with this rather empty configuration instead

module.exports = {
    "extends": [
        "airbnb",
        "prettier"
    ]
}

Tried both with

  • clean .eslintrc (running only npm init @eslint/config -- --config airbnb,prettier)
  • having pre-existing boilerplate .eslintrc (by running both npm init @eslint/config and npm init @eslint/config -- --config airbnb,prettier It just overwrites the first config and gives me the extesions-only file.

I would expect the second command to just add the extensions modules to the already existing first config. What am I doing wrong?

0

There are 0 answers