Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not getting results or error from stylelint / stylelint-config-styled-components

I'm installing stylelint-config-styled-components on a react project.

When I execute npm run lint:css (or use the stylelint command directly through the CLI) I don't get any results. I have intentionally put in extra spaces and duplicate style declarations, so there should definitely be some feedback from stylelint that I've broken rules. However, I'm getting nothing, not even an error message. Any ideas?

I have installed the following packages:

  • stylelint 9.1.3
  • stylelint-config-recommended 2.1.0
  • stylelint-config-styled-components 0.1.1
  • stylelint-processor-styled-components 1.3.1

I am using the following script in package.json:

"scripts": {
    //other scripts
    "lint:css": "stylelint './src/**/*.js'"
}

The contents of my .stylelintrc:

{
 "processors": ["stylelint-processor-styled-components"],
 "extends": [
   "stylelint-config-recommended",
   "stylelint-config-styled-components"
 ]
}

My project's file structure (I have tried running the command directly on files with the same result, so I don't think it's an issue with it not being able to find the .js files)

-root
    -.stylelintrc
    -src
      -Components
        -Directory
          -ThingIWantLinted.js
        -AnotherDirectory
          -AnotherThingTolint.js
like image 660
Bonnie Avatar asked Apr 28 '18 15:04

Bonnie


1 Answers

Also got this issue. After upgraded to stylelint 9.4.0 now lint result show as expect.

Reference issue. https://github.com/stylelint/stylelint/pull/3261

like image 177
vinboxx Avatar answered Oct 21 '22 08:10

vinboxx