Registry / testing / eslint-plugin-backbone

eslint-plugin-backbone

JSON →
library3.0.0jsnpmunverified

ESLint plugin providing Backbone-specific linting rules for ESLint. Current stable version is 3.0.0, released in 2024, which requires ESLint >=9.0.0 and uses flat config only. The plugin includes rules for common Backbone patterns and anti-patterns, such as enforcing model defaults, event scope, and view conventions. Compared to alternatives like eslint-plugin-ember, this plugin is Backbone-only and has been in maintenance mode since Backbone's decline in popularity. Older versions (2.x) support ESLint 3.x-8.x with legacy config.

npm install eslint-plugin-backbone
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-BACK
E
eslint-plugin-backbone
testingjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default import
import backbone from 'eslint-plugin-backbone'
const backbone = require('eslint-plugin-backbone')
ESM-only since v3.0.0; CJS require() will not work.
plugin object (for plugins field)
import backbone from 'eslint-plugin-backbone'
var backbone = require('eslint-plugin-backbone').default
In flat config, the plugin object is the default export. No need to access .default for CommonJS.
configs.recommended
backbone.configs.recommended
require('eslint-plugin-backbone').configs.recommended
Since v3.0.0, configs are on the plugin object. Using require() will fail in flat config context.
rules (flat config style)
rules: { 'backbone/collection-model': 'error' }
rules: { 'collection-model': 2 }
In flat config, rules must be prefixed with the plugin name, e.g., 'backbone/collection-model'.

ESLint flat config setup with eslint-plugin-backbone v3, using recommended config + custom rules and global variables.

import eslint from '@eslint/js'; import backbone from 'eslint-plugin-backbone'; import globals from 'globals'; export default [ eslint.configs.recommended, backbone.configs.recommended, { languageOptions: { globals: { ...globals.browser, Backbone: 'writable', _: 'writable' } }, rules: { 'backbone/collection-model': 'error', 'backbone/defaults-on-top': 'warn' } } ];
Debug
Known issues
breakingv3.0.0 drops support for ESLint <9 and removes legacy .eslintrc configs. Only flat config is supported.
fix
Upgrade to ESLint >=9 and use eslint.config.js with flat config. Do not use .eslintrc.* files.
affects: >=3.0.0
breakingv3.0.0 changes import style: you must use ESM import, not CJS require.
fix
Replace `const backbone = require('eslint-plugin-backbone')` with `import backbone from 'eslint-plugin-backbone'`.
affects: >=3.0.0
deprecatedv2.x is deprecated. It still receives critical fixes but no new features.
fix
Upgrade to v3 if you can use ESLint >=9. Otherwise, stay on v2.1.1.
affects: 2.x
gotchaRule 'no-native-jquery' default severity is 'warn' but some users expect it to be 'error'.
fix
Override rule severity in your config: `'backbone/no-native-jquery': 'error'`.
affects: all
gotchaWhen using flat config, you must explicitly list all global variables (Backbone, _) if not using recommended config.
fix
Add `globals: { Backbone: 'writable', _: 'writable' }` in your flat config.
affects: >=3.0.0
gotchaThe events-on-top rule accepts an array of property names; misconfiguring it can cause false positives.
fix
Ensure the second argument is a flat array of strings, e.g., ['tagName', 'className'].
affects: all
Errors
Common errors & fixes
Error: Failed to load plugin 'backbone': Cannot find module 'eslint-plugin-backbone'
Plugin not installed or peer dependencies missing (ESLint >=9 required).
fix
Run `npm install eslint-plugin-backbone --save-dev` and ensure ESLint version is >=9.
Configuration for rule 'backbone/collection-model' is invalid: Value [2, {...}] is not an array.
Using ESLint legacy config with v3 plugin which expects flat config format.
fix
Upgrade to ESLint >=9 and use eslint.config.js with flat config, not .eslintrc.
TypeError: backbone.configs is not iterable
Import error: likely using CJS require('eslint-plugin-backbone').configs.recommended which is undefined.
fix
Use ESM import: `import backbone from 'eslint-plugin-backbone'` and access `backbone.configs.recommended`.
ESLint couldn't determine the plugin 'backbone' uniquely.
Multiple instances of eslint-plugin-backbone installed, or legacy config with plugin name collision.
fix
Ensure only one version is installed (dedupe with `npm dedupe`). In flat config, use the plugin object directly.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
@eslint/jsrequiredPeer dependency required by ESLint >=9 flat config system
eslintrequiredPeer dependency; version >=9 required for v3.0.0
globalsrequiredPeer dependency for global variable definitions in flat config
Agent activity
2 hits · last 30 days
node
2
Resources