Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into browser-bundle
# By Mike Allanson (6) and others # Via GitHub * master: Bump got from 11.2.0 to 11.3.0 (#4825) Export an object from the CSS-in-JS syntax (#4824) Add type `Formatter` for formatter functions (#4823) Update CHANGELOG.md Fix false positives for namespaced variables in property-no-unknown (#4803) Update CHANGELOG.md Fix TypeError for inline comments and autofix for sugarss in max-empty-lines (#4821) Create new 'lintPostcssResult' module (#4819) 13.6.0 Update deps Prepare 13.6.0 Update CHANGELOG.md
- Loading branch information
Showing
14 changed files
with
388 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
const isScssVariable = require('../isScssVariable'); | ||
|
||
describe('isScssVariable', () => { | ||
it('sass variable', () => { | ||
expect(isScssVariable('$sass-variable')).toBeTruthy(); | ||
}); | ||
it('sass variable within namespace', () => { | ||
expect(isScssVariable('namespace.$sass-variable')).toBeTruthy(); | ||
}); | ||
it('sass interpolation', () => { | ||
expect(isScssVariable('#{$Attr}-color')).toBeFalsy(); | ||
}); | ||
it('single word property', () => { | ||
expect(isScssVariable('top')).toBeFalsy(); | ||
}); | ||
it('hyphenated property', () => { | ||
expect(isScssVariable('border-top-left-radius')).toBeFalsy(); | ||
}); | ||
it('property with vendor prefix', () => { | ||
expect(isScssVariable('-webkit-appearance')).toBeFalsy(); | ||
}); | ||
it('custom property', () => { | ||
expect(isScssVariable('--custom-property')).toBeFalsy(); | ||
}); | ||
it('less variable', () => { | ||
expect(isScssVariable('@var')).toBeFalsy(); | ||
}); | ||
it('less append property value with comma', () => { | ||
expect(isScssVariable('transform+')).toBeFalsy(); | ||
}); | ||
it('less append property value with space', () => { | ||
expect(isScssVariable('transform+_')).toBeFalsy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Check whether a property is SCSS variable | ||
* | ||
* @param {string} property | ||
* @returns {boolean} | ||
*/ | ||
module.exports = function (property) { | ||
// SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value)) | ||
if (property.startsWith('$')) { | ||
return true; | ||
} | ||
|
||
// SCSS var within a namespace (e.g. namespace.$var: x) | ||
if (property.includes('.$')) { | ||
return true; | ||
} | ||
|
||
return false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.