Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
prettier-stylelint
Advanced tools
Format your styles with ease!
code > prettier > stylelint > formatted code
prettier-stylelint attempts to create a prettier config based on the stylelint config, then format with prettier followed by stylelint --fix. So after that you should end up with formatted code with no linting errors.
yarn add prettier-stylelint -D
npm install prettier-stylelint --save-dev
This package has a stylelint config to disable some rules that conflict with prettier.
"stylelint": {
"extends": [
"stylelint-config-idiomatic-order",
"./node_modules/prettier-stylelint/config.js"
],
"rules": {
"indentation": 4,
"string-quotes": "single"
}
}
After adding the disabling config you can just prettier-stylelint --write
and its done. Check the CLI options below for more information.
Also in a near future we should have support for prettier-stylelint in prettier-vscode
follow this PR.
const format = require('prettier-eslint')
const sourceCode = 'a[id="foo"] { content: "x"; }'
const options = {
text: sourceCode
}
const formatted = format(options)
// formatted
a[id='foo'] {
content: 'x';
}
The cli automatically ignores .gitignore
and .prettierignore
.
NOTE: It is recommended that you keep your files under source control and committed before running
prettier-stylelint --write
as it will overwrite your files!
Usage
$ prettier-stylelint [<file|glob> ...]
Options
--ignore Additional paths to ignore [Can be set multiple times]
--extension Additional extension to lint [Can be set multiple times]
--cwd=<dir> Working directory for files
--stdin Validate/fix code from stdin ('prettier-stylelint -' also works)
--write Edit files in place (DRAGONS AHEAD !!)
--quiet -q Only log stderr
Examples
$ prettier-stylelint
$ prettier-stylelint index.js
$ prettier-stylelint *.js !foo.js
$ echo 'a[id="foo"] { content: "x"; }' | prettier-stylelint --stdin
Default pattern when no arguments:
**/*.{css,scss,less,sss}
MIT © Hugo Dias
FAQs
code > prettier > stylelint > formatted code
The npm package prettier-stylelint receives a total of 23,777 weekly downloads. As such, prettier-stylelint popularity was classified as popular.
We found that prettier-stylelint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.