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-backboneVerified import paths — ran on the pinned version, not inferred.
ESLint flat config setup with eslint-plugin-backbone v3, using recommended config + custom rules and global variables.
Upgrade to ESLint >=9 and use eslint.config.js with flat config. Do not use .eslintrc.* files.
Replace `const backbone = require('eslint-plugin-backbone')` with `import backbone from 'eslint-plugin-backbone'`.Upgrade to v3 if you can use ESLint >=9. Otherwise, stay on v2.1.1.
Override rule severity in your config: `'backbone/no-native-jquery': 'error'`.
Add `globals: { Backbone: 'writable', _: 'writable' }` in your flat config.Ensure the second argument is a flat array of strings, e.g., ['tagName', 'className'].
Run `npm install eslint-plugin-backbone --save-dev` and ensure ESLint version is >=9.
Upgrade to ESLint >=9 and use eslint.config.js with flat config, not .eslintrc.
Use ESM import: `import backbone from 'eslint-plugin-backbone'` and access `backbone.configs.recommended`.
Ensure only one version is installed (dedupe with `npm dedupe`). In flat config, use the plugin object directly.