no-duplicate-dollar-variables doesn't respect scopes
See original GitHub issueno-duplicate-dollar-variables
rule reports variables with the same name but declared in different scopes. The snippet below produces error Unexpected duplicate dollar variable $padding-x scss/no-duplicate-dollar-variables
.
.FormControl-label {
$padding-x: $padding-small-x;
@include input-overlay;
position: relative;
top: 0.40em;
margin-left: $margin-medium-x;
padding-left: $padding-x;
padding-right: $padding-x;
font-size: $font-size-small;
}
.FormControl-input {
$padding-x: $padding-medium-x;
width: 100%;
border: 1px solid $color-grey-light;
border-radius: 0;
padding-left: $padding-x;
padding-right: $padding-x;
height: $row-height;
}
For me it’s pretty obvious that this shouldn’t be reported. Am I wrong?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
no-duplicate-dollar-variables doesn't respect scopes #277
no -duplicate-dollar-variables rule reports variables with the same name but declared in different scopes. The snippet below produces error ...
Read more >Disable 'no-duplicate-dollar-variables' for ... - Stack Overflow
Is it possible to tell stylelint to skip the 'no-duplicate-dollar-variables' rule when a variable is initialized with default as in the case ...
Read more >PythonTA Checks
This error occurs if there are duplicate parameter names in function definitions. All parameters must have distinct names, so that we can refer...
Read more >Use variable inside other variable (#1809) · Issues - GitLab
For other users coming across strange variable value changes, please note that if your variable value contains a dollar sign $ and it...
Read more >Code Style | PMD Source Code Analyzer
Avoid using dollar signs in variable/method/class/interface names. ... public abstract class Thing {} // This class doesn't respect the convention, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@chrismbarr those are not actually false positives, to avoid that you can use the ignore options of the rule:
https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/no-duplicate-dollar-variables/README.md#ignoreinsideatrules-array-of-at-rules
WIth 3.18 the rule triggers:
I had assumed that the media query defines a scope.