Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
eslint-plugin-format
Advanced tools
Format various languages with formatters in ESLint. Supports Prettier and dprint. Side-effects-free and fully configurable.
npm i -D eslint-plugin-format
This plugin does not do language detection or reading configure files, you need to specify the language for each file type you want to format along with other formatting options. We recommend using ESLint's Flat Config format.
// eslint.config.js
import format from 'eslint-plugin-format'
export default [
// ...other flat configs
// use Prettier to format CSS
{
files: ['**/*.css'],
languageOptions: {
parser: format.parserPlain,
},
plugins: {
format,
},
rules: {
'format/prettier': ['error', { parser: 'css', tabWidth: 2 }],
},
},
// use dprint to format TOML
{
files: ['**/*.toml'],
languageOptions: {
parser: format.parserPlain,
},
plugins: {
format,
},
rules: {
'format/dprint': ['error', { language: 'toml', languageOptions: { indentWidth: 2 } }],
},
},
]
format/prettier
Use Prettier to format files.
parser
(required) - the language to format, Supported languagesformat/dprint
Use dprint to format files.
language
(required) - the language to format, or can be a filepath or URL to the WASM binary. Supported languageslanguageOptions
- the options for the languageeslint-plugin-prettier
?While this plugin provides Prettier as one of the formatters, the main difference is that eslint-plugin-prettier
is much more opinionated toward the Prettier CLI ecosystem. While this plugin only treats Prettier as the side-effects-free formatter and gives you full control in ESLint.
Thanks to the existing works for references and inspiration.
MIT License © 2023-PRESENT Anthony Fu
FAQs
Format various languages with formatters in ESLint
The npm package eslint-plugin-format receives a total of 38,555 weekly downloads. As such, eslint-plugin-format popularity was classified as popular.
We found that eslint-plugin-format demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.