Error: Failed to load config "plugin:@stylistic" to extend from

254 Views Asked by At

I'm trying to follow this guide here:

https://eslint.style/packages/default

First I installed the package with command:

npm i -D @stylistic/eslint-plugin

In the guide it is using .eslintrc.js but I have .eslintrc.json and I did my best to convert from .js syntax to .json syntax

Here's what I have in my .eslintrc.json

... 
      "extends": [
        "plugin:@stylistic"
      ]
... 

In the EsLint console I get this error:

Error: Failed to load config "plugin:@stylistic" to extend from.

What I'm trying to achieve is use this no-multiple-empty-lines from that plugin to disable having multiple empty lines in *.ts files.

1

There are 1 best solutions below

0
On

I have managed to solve it myself. Basically, you are supposed to provide a config when adding an element to the extends array.

As of 17/03/2024, the @stylistic plugin provides several configs, so using one of them is as simple as changing your config to:

"extends": [
  "plugin:@stylistic/recommended-extends"
]