未从 stylelint / stylelint-config-styled-components 获得结果或错误

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

我在 React 项目上安装 stylelint-config-styled-components

当我执行 npm run lint:css(或直接通过 CLI 使用 stylelint 命令)时,我没有得到任何结果。我有意放置了额外的空格和重复的样式声明,因此 stylelint 肯定会反馈我违反了规则。但是,我什么也没得到,甚至没有错误消息。有什么想法吗?

我安装了以下软件包:

我在 package.json 中使用以下脚本:

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

我的内容.stylelintrc

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

我的项目的文件结构(我已经尝试 运行 直接在文件上使用该命令,结果相同,所以我认为找不到 .js 文件不是问题)

-root
    -.stylelintrc
    -src
      -Components
        -Directory
          -ThingIWantLinted.js
        -AnotherDirectory
          -AnotherThingTolint.js

也遇到了这个问题。升级到 stylelint 后 9.4.0 现在 lint 结果显示如预期。

参考问题。 https://github.com/stylelint/stylelint/pull/3261

除了 (')

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