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-newline-destructuring
Advanced tools
Eslint plugin for enforcing newlines in object destructuring assignment past a certain number of properties.
Eslint plugin for enforcing newlines in object destructuring assignment past a certain number of properties.
Add newline-destructuring
to the plugins section of your eslint configuration file.
plugins: [
'newline-destructuring'
]
Then add the rule in the rules section
rules: {
'newline-destructuring/newline': 'error'
}
The rule accepts an option object with the following properties:
items
[number] (default: 2
) - Specifies the maximum number of properties before the plugin requires breaking up the statement to multiple lines. If there are exactly this many or fewer properties, then the plugin will make sure the statement stays on one line unless it would violate the maxLength
option or consistent
option is used. More properties than this number will always be split onto multiple lines.
itemsWithRest
[number] (default: 1
) - Specifies the maximum number of properties contain rest pattern before the plugin requires breaking up the statement to multiple lines. If there are exactly this many or fewer properties, then the plugin will make sure the statement stays on one line unless it would violate the maxLength
option or consistent
option is used. More properties than this number will always be split onto multiple lines.
maxLength
[number] (default: Infinity
) - Specifies the maximum length for source code lines in your project, the plugin will split long destructuring lines even if they contains properties less than value in items
or itemsWithRest
consistent
[boolean] (default: false) - If there are less than the threshold items, allow new lines consistent with whether the curly braces are on their own lines or not.
allowAllPropertiesOnSameLine
[boolean] (default: false) - If there are less than the threshold items, allow all properties to be on the same line. But one like
const {
a,b,
c
} = obj
will be split into multiple lines
FAQs
Eslint plugin for enforcing newlines in object destructuring assignment past a certain number of properties.
The npm package eslint-plugin-newline-destructuring receives a total of 13,840 weekly downloads. As such, eslint-plugin-newline-destructuring popularity was classified as popular.
We found that eslint-plugin-newline-destructuring demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.