Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
eslint-plugin-always
Advanced tools
ESLint plugin that always reports with a configurable message.
Simply reports ALWAYS!
There is a reason why we want to do so! See Why?
$ yarn add eslint-plugin-always --dev
Add the plugin to your ESLint configuration:
{
"plugins": [
"always"
]
}
And then add the following rule:
{
"rules": {
"always/always": ["error", {
"message": "Hello World"
}]
}
}
I need to notice the team members that the new folder must contain a ESLint configuration.
Notice
I will simply show you the use case which is the reason why I created this plugin.
There is a cartridges/
folder in the project. This folder contains multiple packages which may need a different ESLint configuration.
The surrounding application uses another ESLint configuration.
But this configuration isn't applicable for the packages in the cartridges/
folder.
├── cartridges
│ ├── app_foo
│ │ ├── .eslintrc.json
│ ├── int_foo
│ │ ├── .eslintrc.json
│ ├── int_bar
│ │ ├── .eslintrc.json
│ ├── int_new <-- DETECT WHY THIS FOLDER DOESN'T HAVE A LINT CONFIGURATION
│ ├── bc_foo
│ │ ├── .eslintrc.json
│ ├── .eslintrc.json <-- THE FILE THAT ENABLES THIS RULE AND CONTAINING root: true
├── packages.json <-- CONTAINING THE SURROUNDING LINT CONFIGURATION
For a new package cartidges/int_new
a valid ESLint configuration must be added.
cartridges/.eslintrc.json
resets the ESLint configuration and adds this rule.
{
"root": true,
"plugins": [
"always"
],
"rules": {
"always/always": ["error", {
"message": "No ESLint config found. Please add one or ignore the cartridge."
}]
}
}
So all files in this folder structure won't check any ESLint rules. The subfolders must contain ESLint configurations which can differ between each subfolder.
For the case that someone adds a subfolder and forgets the ESLint configuration this rule was created. So every file within the subfolder will report an error
No ESLint config found. Please add one or ignore the cartridge.
MIT © 2023 Jens Simon
FAQs
ESLint plugin that always reports with configurable message
The npm package eslint-plugin-always receives a total of 494 weekly downloads. As such, eslint-plugin-always popularity was classified as not popular.
We found that eslint-plugin-always 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.