Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
eslint-plugin-object-pattern-newline
Advanced tools
ESLint plugin to enforce newlines in ES6 object pattern
ESLint plugin to enforce newlines in ES6 object pattern.
There is only one rule in this plugin which will report when there are more than 4 values in a line by default.
$ npm install eslint-plugin-object-pattern-newline --save-dev
Or
$ yarn add eslint-plugin-object-pattern-newline -D
Add object-newline
to the plugins section of your .eslintrc
configuration file.
{
"plugins": [
"object-newline"
]
}
Then add the rule in the rules section.
{
"rules": {
"object-newline/enforce": "error"
}
}
The first and most readable way is to use an object which allows you to specify any of the available options, leaving everything that's not specified as the default.
{
"rules": {
"max-len": ["error", 100],
"object-newline/enforce": [
"error",
{
"items": 2,
"max-len": 100
}
]
}
}
items
[number] (default: 4
)Specifies the maximum number of items before the plugin requires breaking items to multiple lines.
max-len
[number] (default: Infinity
)Specifies the maximum length for source code lines in your project. This allows the plugin to prevent quick fixes that would cause your code to violate this limit from being applied. The rule will also automatically split lines for you should they exceed the limit.
Tests can be run via npm run test
, make sure these pass after every change. Be sure to add tests for new features.
FAQs
ESLint plugin to enforce newlines in ES6 object pattern
We found that eslint-plugin-object-pattern-newline 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.