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

Fix end positions for at-rule-no-unknown #6026

Merged
merged 1 commit into from Apr 20, 2022

Conversation

ybiquitous
Copy link
Member

Which issue, if any, is this issue related to?

Part of #5694

Is there anything in the PR that needs further explanation?

I think the range should be at an at-rule name, not an at-rule block. E.g.,

    @unknown (max-width: 960px) {}
/** ↑------↑ */

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Shall we classify these as fixes or additions? e.g. "Fixed: at-rule-no-unknown end positions" or "Added: at-rule-no-unknown range support"

@ybiquitous
Copy link
Member Author

Shall we classify these as fixes or additions? e.g. "Fixed: at-rule-no-unknown end positions" or "Added: at-rule-no-unknown range support"

I think this change belongs to fixes because end positions have been supported.

Here is an example of using the latest Stylelint version:

$ echo '@abc {}' > a.css

$ echo '{"rules":{"at-rule-no-unknown":true}}' > .stylelintrc.json

$ npx stylelint a.css -f json | jq .
[
  {
    "source": "/private/tmp/foo/a.css",
    "deprecations": [],
    "invalidOptionWarnings": [],
    "parseErrors": [],
    "errored": true,
    "warnings": [
      {
        "line": 1,
        "column": 1,
        "endLine": 1,
        "endColumn": 8,
        "rule": "at-rule-no-unknown",
        "severity": "error",
        "text": "Unexpected unknown at-rule \"@abc\" (at-rule-no-unknown)"
      }
    ]
  }
]

"endColumn": 8 is output now, but "endColumn": 5 will be output by this pull request.

@jeddy3
Copy link
Member

jeddy3 commented Apr 20, 2022

SGTM. Feel free to merge.

@ybiquitous ybiquitous merged commit 91f65fa into main Apr 20, 2022
@ybiquitous ybiquitous deleted the fix-end-pos-for-at-rule-no-unknown branch April 20, 2022 07:23
@ybiquitous
Copy link
Member Author

Changelog entry added:

  • Fixed: at-rule-no-unknown end positions (#6026).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants