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

Ignore map property name (#4375) #4450

Merged
merged 6 commits into from Dec 1, 2019

Conversation

fanich37
Copy link
Member

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

It should close #4375 .

Is there anything in the PR that needs further explanation?

No, it's self explanatory.

Copy link
Member

@hudochenkov hudochenkov left a comment

Choose a reason for hiding this comment

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

Nice solution!

@@ -18,6 +19,8 @@ const messages = ruleMessages(ruleName, {
rejected: (unit) => `Unexpected unknown unit "${unit}"`,
});

const mapPropertyNameIndexOffset = 4;
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain what this variable for, please? I don't understand from the following.

Copy link
Member Author

@fanich37 fanich37 Nov 29, 2019

Choose a reason for hiding this comment

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

The map property name (in map cleared from comments & spaces) always has index that being divided by 4 gives remainder equals 0 (e.g. 0, 4, 8 etc).
The naming of this const definitely has to be changed since it's not clear. Any suggestions? Or may be comment would be enough?

Copy link
Member

Choose a reason for hiding this comment

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

I think comment in the code would be enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added comment with explanation.

lib/utils/isMap.js Outdated Show resolved Hide resolved
lib/utils/isMap.js Outdated Show resolved Hide resolved
fanich37 and others added 3 commits November 30, 2019 01:36
Co-Authored-By: Aleks Hudochenkov <aleks@hudochenkov.com>
Co-Authored-By: Aleks Hudochenkov <aleks@hudochenkov.com>
@hudochenkov hudochenkov merged commit a3a74a3 into stylelint:master Dec 1, 2019
@hudochenkov
Copy link
Member

  • Fixed: unit-no-unknown false positives for Sass map keys (#4450).

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.

FP for unit-no-unknown when SCSS map key starts with digit
3 participants