{"id":19696,"library":"eslint-plugin-backbone","title":"eslint-plugin-backbone","description":"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.","status":"maintenance","version":"3.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/ilyavolodin/eslint-plugin-backbone","tags":["javascript","eslint-plugin","eslintplugin","backbone","eslint"],"install":[{"cmd":"npm install eslint-plugin-backbone","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-backbone","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-backbone","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required by ESLint >=9 flat config system","package":"@eslint/js","optional":false},{"reason":"Peer dependency; version >=9 required for v3.0.0","package":"eslint","optional":false},{"reason":"Peer dependency for global variable definitions in flat config","package":"globals","optional":false}],"imports":[{"note":"ESM-only since v3.0.0; CJS require() will not work.","wrong":"const backbone = require('eslint-plugin-backbone')","symbol":"default import","correct":"import backbone from 'eslint-plugin-backbone'"},{"note":"In flat config, the plugin object is the default export. No need to access .default for CommonJS.","wrong":"var backbone = require('eslint-plugin-backbone').default","symbol":"plugin object (for plugins field)","correct":"import backbone from 'eslint-plugin-backbone'"},{"note":"Since v3.0.0, configs are on the plugin object. Using require() will fail in flat config context.","wrong":"require('eslint-plugin-backbone').configs.recommended","symbol":"configs.recommended","correct":"backbone.configs.recommended"},{"note":"In flat config, rules must be prefixed with the plugin name, e.g., 'backbone/collection-model'.","wrong":"rules: { 'collection-model': 2 }","symbol":"rules (flat config style)","correct":"rules: { 'backbone/collection-model': 'error' }"}],"quickstart":{"code":"import eslint from '@eslint/js';\nimport backbone from 'eslint-plugin-backbone';\nimport globals from 'globals';\n\nexport default [\n  eslint.configs.recommended,\n  backbone.configs.recommended,\n  {\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        Backbone: 'writable',\n        _: 'writable'\n      }\n    },\n    rules: {\n      'backbone/collection-model': 'error',\n      'backbone/defaults-on-top': 'warn'\n    }\n  }\n];","lang":"typescript","description":"ESLint flat config setup with eslint-plugin-backbone v3, using recommended config + custom rules and global variables."},"warnings":[{"fix":"Upgrade to ESLint >=9 and use eslint.config.js with flat config. Do not use .eslintrc.* files.","message":"v3.0.0 drops support for ESLint <9 and removes legacy .eslintrc configs. Only flat config is supported.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace `const backbone = require('eslint-plugin-backbone')` with `import backbone from 'eslint-plugin-backbone'`.","message":"v3.0.0 changes import style: you must use ESM import, not CJS require.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade to v3 if you can use ESLint >=9. Otherwise, stay on v2.1.1.","message":"v2.x is deprecated. It still receives critical fixes but no new features.","severity":"deprecated","affected_versions":"2.x"},{"fix":"Override rule severity in your config: `'backbone/no-native-jquery': 'error'`.","message":"Rule 'no-native-jquery' default severity is 'warn' but some users expect it to be 'error'.","severity":"gotcha","affected_versions":"all"},{"fix":"Add `globals: { Backbone: 'writable', _: 'writable' }` in your flat config.","message":"When using flat config, you must explicitly list all global variables (Backbone, _) if not using recommended config.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Ensure the second argument is a flat array of strings, e.g., ['tagName', 'className'].","message":"The events-on-top rule accepts an array of property names; misconfiguring it can cause false positives.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-plugin-backbone --save-dev` and ensure ESLint version is >=9.","cause":"Plugin not installed or peer dependencies missing (ESLint >=9 required).","error":"Error: Failed to load plugin 'backbone': Cannot find module 'eslint-plugin-backbone'"},{"fix":"Upgrade to ESLint >=9 and use eslint.config.js with flat config, not .eslintrc.","cause":"Using ESLint legacy config with v3 plugin which expects flat config format.","error":"Configuration for rule 'backbone/collection-model' is invalid: Value [2, {...}] is not an array."},{"fix":"Use ESM import: `import backbone from 'eslint-plugin-backbone'` and access `backbone.configs.recommended`.","cause":"Import error: likely using CJS require('eslint-plugin-backbone').configs.recommended which is undefined.","error":"TypeError: backbone.configs is not iterable"},{"fix":"Ensure only one version is installed (dedupe with `npm dedupe`). In flat config, use the plugin object directly.","cause":"Multiple instances of eslint-plugin-backbone installed, or legacy config with plugin name collision.","error":"ESLint couldn't determine the plugin 'backbone' uniquely."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}