9

It works ok on ubuntu

I installed stylelint on iOS but when I run it I get

Error: Could not find "stylelint-config-standard". Do you need a configBasedir?

My config file is:

$ cat .stylelintrc.json
{
  "extends": "stylelint-config-standard",
  "rules": {
    "rule-empty-line-before": null,
    "at-rule-empty-line-before": null
  }
}

I tried "extends": ["stylelint-config-standard"], but it didn't help

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

4 Answers4

4

I had that error message until I installed the config

npm install stylelint-config-standard --save-dev

Guy Thomas
  • 71
  • 4
1

If you have the stylelint-config-standard dependency installed already, maybe you need to delete the node_modules folder and package-lock.json or yarn.lock if you're using yarn, and run the following command:

npm install

or with yarn

yarn install

if the stylelint-config-standard dependency isn't installed may you need to install it running:

npm install stylelint-config-standard -D

or with yarn

yarn add stylelint-config-standard -D
  • 1
    Clarifying how to remove node_modules and package-lock.json and npm install: rm -rf node_modules package-lock.json && npm install – Emma Earl Kent Jul 08 '22 at 17:20
0

The solution for me was adding the overrides section to the config:

module.exports = {
    overrides: [
        {
            files: ["**/*.scss"],
            customSyntax: "postcss-scss"
        }
    ],
    rules: {...},
}
Juanma Menendez
  • 17,253
  • 7
  • 59
  • 56
-2

First, as tried, change the extends to be

"extends": ["stylelint-config-standard"],

but then also do npm install

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497