Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
eslint-plugin-backbone
Advanced tools
Backbone specific linting rules for ESLint
npm install eslint@">=1.0.0"
or
npm install eslint@">=1.0.0" --save-dev
eslint-plugin-backbone requires ESLint
with version greater then 1.0.0 if you would like to use your own base models.
If you installed ESLint
globally, you have to install Backbone plugin globally too. Otherwise, install it locally.
npm install eslint-plugin-backbone
or
npm install eslint-plugin-backbone --save-dev
Deprecated in v2
note: ESLint v2 removed support for default configurations. Please see config below for details.
If you are using ESLint >0.9.0 then this plugin will provide default configuration. If you are fine with defaults, you do not need to update your .eslintrc file.
Defaults are currently set to the following:
"collection-model": 2,
"defaults-on-top": 1,
"event-scope": 1,
"events-on-top": [1, ["tagName", "className"]],
"initialize-on-top": [1, { View: ["tagName", "className", "events"], Model: ["defaults", "url", "urlRoot"], Collection: ["model", "url"] }],
"model-defaults": 2,
"no-changed-set": 2,
"no-collection-models": 2,
"no-constructor": 1,
"no-el-assign": 2,
"no-model-attributes": 2,
"no-native-jquery": [1, "selector"],
"no-silent": 1,
"no-view-collection-models": 2,
"no-view-model-attributes": 2,
"no-view-onoff-binding": 2,
"no-view-qualified-jquery": 0,
"render-return": 2
In version 2.0.0 removed support for default configurations for plugins and replaced it with ability for plugins to bundle configs. This plugin include recommended
configuration that you can extend from to enable recommended setup of the rules (see "Default configuration" for the list of enabled rules).
To enable bundled config modify your .eslintrc file to include the following line:
{
"extends": "plugin:backbone/recommended"
}
This will enable all of the rules listed above, as well as add two global variables - Backbone
and _
.
Add plugins
section and specify eslint-plugin-backbone as a plugin
{
"plugins": [
"backbone"
]
}
Enable all of the rules that you would like to use
{
"rules": {
"backbone/collection-model": 1,
"backbone/defaults-on-top": 1,
"backbone/model-defaults": 1,
"backbone/no-constructor": 1,
"backbone/no-native-jquery": 1,
...
}
}
If you are using custom models/view/collection bases you also have to specify each on in the settings
section
{
"settings": {
"backbone": {
"Collection": ["Backbone.NestedCollection", "MyCollection"],
"Model": ["MyBaseModel"],
"View": ["MyBaseView"]
}
}
}
FAQs
Eslint rules for Backbone.
The npm package eslint-plugin-backbone receives a total of 1,395 weekly downloads. As such, eslint-plugin-backbone popularity was classified as popular.
We found that eslint-plugin-backbone 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
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.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.