justthedev / stylelint-magic-numbers Goto Github PK
View Code? Open in Web Editor NEWSylelint Plugin to Prevent Magic Numbers
License: MIT License
Sylelint Plugin to Prevent Magic Numbers
License: MIT License
Describe the bug
I am receiving a false positive when linting rules which use the CSS Grid fr
unit.
To Reproduce
with the following stylelint config:
{
"plugins": [
"stylelint-magic-numbers"
],
"rules": {
"magic-numbers/magic-numbers": [
true,
{
"acceptedNumbers": [ 0 ],
"acceptedValues": [ "100%", "1fr" ],
"severity": "error"
}
]
}
}
run stylelint
against the following css:
.example {
display: grid;
grid-template-rows: max-content 1fr max-content;
}
Expected behavior
expected linting to succeed
Error Logs
Desktop (please complete the following information):
node 12.18.3
Additional context
I believe this would be solved by updating valueRegExp
here to include fr
: https://github.com/JuStTheDev/stylelint-magic-numbers/blob/master/src/index.js#L39
Describe the bug
After updating from stylelint 15.11.0 to 16.2.1 i get the following error (see Error Logs).
Switching back and it runs again.
To Reproduce
Already mentioned in description. Try to run with 16.2.1.
Expected behavior
Should work with current stylelint version.
Error Logs
Error: Cannot find module '...\frontend\node_modules\stylelint\lib\utils\isVariable'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1181:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15)
at resolveExports (node:internal/modules/cjs/loader:591:14)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (...\frontend\node_modules\stylelint-magic-numbers\dist\index.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
Desktop (please complete the following information):
Additional context
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.