{"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,"search_vec":"'-8':88 '2':82 '2024':22 '3':86 '3.0.0':19 '9.0.0':26 'altern':56 'anti':42 'anti-pattern':41 'backbon':4,9,38,66,75,98 'backbone-on':65 'backbone-specif':8 'common':37 'compar':54 'config':30,92 'convent':53 'current':15 'declin':77 'default':48 'ember':61 'enforc':46 'eslint':2,5,14,25,59,85,95,99 'eslint-plugin':94 'eslint-plugin-backbon':1 'eslint-plugin-emb':58 'eslintplugin':97 'event':49 'flat':29 'includ':34 'javascript':93 'legaci':91 'like':57 'lint':11 'mainten':72 'mode':73 'model':47 'older':80 'pattern':39,43 'plugin':3,6,33,60,63,96 'popular':79 'provid':7 'releas':20 'requir':24 'rule':12,35 'scope':50 'sinc':74 'specif':10 'stabl':16 'support':84 'use':28 'version':17,81 'view':52 'x':83,87,89","created_at":"2026-04-25T11:19:09.594878+00:00","updated_at":"2026-04-25T11:19:09.594878+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ilyavolodin/eslint-plugin-backbone","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-backbone","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}