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

2

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
Consortium answered 28/4, 2018 at 15:21 Comment(1)
Same here. I followed the detailed steps on Styled Components website 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.Cymbiform
B
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

Betti answered 14/8, 2018 at 4:10 Comment(2)
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.Consortium
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.Consortium
D
0

Except (')

    "scripts": {
    //other scripts
    "lint:css": "stylelint ./src/**/*.js"
}
Dawn answered 26/12, 2018 at 7:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.