styled-components / stylelint-processor-styled-components

Lint your styled components with stylelint!
https://styled-components.com
MIT License
656 stars 61 forks source link

Autofix stylelint doesn't work #264

Closed WebTravel closed 5 years ago

WebTravel commented 5 years ago

Hi. I try to find solution for stylelint --fix I know this problem solved team of stylelint here: https://github.com/stylelint/stylelint/pull/3261

Hovewer, I can't use stylelint --fix yet.

My .stylelintrc:

{
  "processors": ["stylelint-processor-styled-components"],
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-styled-components"
  ],
  "syntax": "scss",
  "plugins": [
    "stylelint-order"
  ],
  "rules": {
    "number-leading-zero": null,
    "no-missing-end-of-source-newline": null,
    "block-no-empty": null,
    "no-empty-source": null,
    "at-rule-no-unknown": null,
    "property-no-unknown": [
      true,
      {
        "ignoreProperties": [
          "/^lost-/"
        ]
      }
    ],
    "order/properties-order": [ ... ],
  }
}

My package.json

"scripts": {
    "stylelint": "./node_modules/.bin/stylelint ./src/**/*.js --fix",
  },
"devDependencies": {
    "stylelint": "^10.0.1",
    "stylelint-config-standard": "^18.3.0",
    "stylelint-config-styled-components": "^0.1.1",
    "stylelint-order": "^2.2.1",
    "stylelint-processor-styled-components": "^1.6.0",
}

And when I run yarn stylelint command I see next message:

Autofix is incompatible with processors and will be disabled. Are you sure you need a processor?

I can't see solution for this problem.

chinesedfan commented 5 years ago

I know this problem solved team of stylelint here: stylelint/stylelint#3261

@WebTravel Sadly it is not the final result. This feature has been canceled in stylelint@9.10.0.

WebTravel commented 5 years ago

Ok. Thanks for this information. It's bad news for me.

lainermeister commented 4 years ago

@chinesedfan Do you have suggestions on an autofixing option with styled-components or emotion syntax? Since the styles are within jsx, I'm pretty sure that we do need a processor.