10

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
RobC
  • 22,977
  • 20
  • 73
  • 80
Bonnie
  • 611
  • 8
  • 25
  • 2
    Same here. I followed the detailed steps on [Styled Components website](https://www.styled-components.com/docs/tooling#stylelint) and I get nothing. I also ran `stylelint './src/**/*.js' --formatter verbose` and it does list the files it should check, but they all return OK (green) even if some of them have obvious problems. – pnichols May 02 '18 at 15:03

2 Answers2

2

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

vinboxx
  • 605
  • 11
  • 13
  • I am just now revisiting this issue and have updated my project with the newest versions of everything listed above: "stylelint": "^9.7.1", "stylelint-config-recommended": "^2.1.0", "stylelint-config-styled-components": "^0.1.1", "stylelint-processor-styled-components": "^1.5.0", However, now I am getting the error "Error: EMFILE: too many open files" I've checked some other stack overflow posts and have tried installing watchman. That did not change anything. – Bonnie Oct 31 '18 at 14:33
  • After making the comment above, I did determine that the linting runs/works on other machines, so this does work! The problem of too many files being opened is unrelated. – Bonnie Nov 09 '18 at 15:29
0

Except (')

    "scripts": {
    //other scripts
    "lint:css": "stylelint ./src/**/*.js"
}
Brayden
  • 1
  • 1