Витя, получишь пизды, если будешь использовать margin-top
.
npm package for scanning files and searching content by strings/substrings/chars/regExp.
The most relevant usage is looking for "forbidden" text/code in Your project.
For example, Your team agreed don't use padding
or margin
in Your CSS/Scss/Sass files, but someone still uses it. Beria will scan Your project and find this "forbidden" content.
The most practical use with pre-commit git hooks.
- install package using
npm i beria --save-dev
oryarn beria -D
- create
beria.config.json
config file inside root directory - run
npx beria
Simple config
-
Looking for
margin-top
andmargin-right
strings in .scss files inside styles folder - Package exits with the error if one of these strings was detected
{ "include": [ { "folder": "styles", "fileExtention": "scss", "targets": [ "margin-top", "margin-right" ], } ] }
Advanced config
-
Looking for
margin-top
andmargin-right
strings in .scss files inside styles folder.Margin-Top
ormargiN-Right
will'nt be founded causewithRegister
option is on. -
Also looking for
zalupa
string in .ts files inside types folder.Zalupa
orzAlupA
strings will be detected causewithRegister
option is off. -
package show all founded cases but doesn't exit with the error cause
onlyWarning
option is on.
{ "include": [ { "folder": "styles", "fileExtention": "scss", "targets": [ "margin-top", "margin-right" ], "withRegister": true }, { "folder": "types", "fileExtention": "ts", "targets": [ "zalupa" ], "withRegister": false }, ], "onlyWarning": true }
-
--config
By default package looks for default
beria.config.json
config file inside project folder. You can set another path to Your config file. Example:--config=myfolder/conf.json
-
--onlyWarning
By default, programm exist with error status if search was successful. The option disable this behavior.