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 at-rule-no-unknown end positions #655

Conversation

ybiquitous
Copy link
Contributor

Part of #652

This change also adds a test helper function to make testing multiline strings easier.

This change also adds a test helper function to make testing multiline strings easier.
line: 1,
column: 1,
endLine: 1,
endColumn: 10,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[note] It seems to me that one case change is enough to test end positions.

line: warning.line,
column: warning.column
start: { line: warning.line, column: warning.column },
end: { line: warning.endLine, column: warning.endColumn },
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ybiquitous is this a backwards compatible change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I tried testing the minimum version of peerDependencies.stylelint locally:

"peerDependencies": {
"stylelint": "^14.5.1"
},

$ npm i stylelint@14.5.1
...

$ npx jest at-rule-no-unknown --no-verbose
 FAIL  src/rules/at-rule-no-unknown/__tests__/index.js
  ● scss/at-rule-no-unknown › reject › [ true ] › '@funciton floo ($n) {}\n' › no description

    expect(received).toMatchObject(expected)

    - Expected  - 2
    + Received  + 0

      Object {
        "column": 1,
    -   "endColumn": 10,
    -   "endLine": 1,
        "line": 1,
        "text": "Unexpected unknown at-rule \"@funciton\" (scss/at-rule-no-unknown)",
      }

      at Object.<anonymous> (node_modules/jest-preset-stylelint/getTestRule.js:88:33)

It seems that the backward compatibility keeps. 👍🏼

If possible, I think it's better to update peerDependencies.stylelint to ^14.7.0, but not required.

Copy link
Collaborator

@kristerkari kristerkari left a comment

Choose a reason for hiding this comment

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

Sorry for the delay.

Looks good 👍

@kristerkari kristerkari merged commit 1f153ac into stylelint-scss:master Oct 21, 2022
@ybiquitous ybiquitous deleted the fix-at-rule-no-unknown-end-positions branch October 21, 2022 13:47
@ybiquitous
Copy link
Contributor Author

Don't mind. Thanks for the merge!

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