Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to migrate
unit-disallowed-list
to new media query parser (#…
…6886) * Refactor to migrate `unit-disallowed-list` to new media query parser * Apply suggestions from code review Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> * apply suggestions from code review * increase test coverage * fix * Update lib/rules/unit-disallowed-list/index.js Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> * cleanup * ignore urange productions in unicode-range description --------- Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
- Loading branch information
1 parent
54b7376
commit f1ace61
Showing
4 changed files
with
190 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
const HAS_DIMENSION_LIKE_VALUES = /\d[%\w-]/; | ||
|
||
/** | ||
* Check if a value contains any dimension-like values. | ||
* | ||
* @param {string} value | ||
* @returns {boolean} | ||
*/ | ||
module.exports = function hasDimension(value) { | ||
return HAS_DIMENSION_LIKE_VALUES.test(value); | ||
}; |