Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with reporting and detection of violations of the indentation, max-empty-lines and no-empty-first-line rules when extending linaria/stylelint-config #693

Closed
jpnelson opened this issue Nov 4, 2020 · 3 comments
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@jpnelson
Copy link
Contributor

jpnelson commented Nov 4, 2020

Environment

  • Linaria version: 1.3.3
  • Node version: 12
  • OS: Mac

Description

When extending linaria/stylelint-config and using these rules:

  • indentation
  • max-empty-lines
  • no-empty-first-line

Error reporting happens for code outside of css template literals, and errors are reported incorrectly.

image

Reproducible Demo

https://codesandbox.io/s/linaria-demo-forked-bxdvh?file=/src/App.js

@jpnelson jpnelson added bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided needs: triage 🏷 Issue needs to be checked and prioritized labels Nov 4, 2020
@github-actions github-actions bot removed the needs: triage 🏷 Issue needs to be checked and prioritized label Nov 4, 2020
@jpnelson
Copy link
Contributor Author

I believe the stylelint rule at-rule-empty-line-before has the same issue

@Anber
Copy link
Collaborator

Anber commented Nov 29, 2021

Unfortunately, we can't use a source map here because SourceMapConsumer is async whereas custom stylelint processor must be sync. However, I've tried to adjust warnings positions with a naive implementation of source-map, but I'm not sure if this will always work.

@Anber
Copy link
Collaborator

Anber commented Nov 29, 2021

@jpnelson btw, have you tried @stylelint/postcss-css-in-js?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

No branches or pull requests

2 participants