{"id":47504,"library":"eslint-plugin-fetch","title":"eslint-plugin-fetch","description":"ESLint plugin to enforce using fetch over other AJAX methods like jQuery's $.ajax, Angular's $http, and XMLHttpRequest. Version 0.0.1 is the only release, with no active development since 2019. Key rules include no-jquery, no-xhr, and no-$http (the latter disabled by default). Differentiates from broader eslint-plugin-compat by focusing solely on fetch preference.","status":"abandoned","version":"0.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","eslint","eslintplugin","eslint-plugin","ajax","fetch","xhr"],"install":[{"cmd":"npm install eslint-plugin-fetch","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-fetch","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-fetch","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to work","package":"eslint","optional":false}],"imports":[{"note":"ESLint automatically resolves the 'eslint-plugin-' prefix.","wrong":"plugins: ['eslint-plugin-fetch']","symbol":"plugin","correct":"plugins: ['fetch']"},{"note":"Must use the full plugin prefix when extending.","wrong":"extends: ['fetch']","symbol":"recommended config","correct":"extends: ['plugin:fetch/recommended']"},{"note":"Rule names must be prefixed with 'fetch/'.","wrong":"rules: { 'no-jquery': 'error' }","symbol":"rules","correct":"rules: { 'fetch/no-jquery': 'error' }"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"fetch\"],\n  \"extends\": [\"plugin:fetch/recommended\"],\n  \"rules\": {\n    \"fetch/no-jquery\": \"error\",\n    \"fetch/no-xhr\": \"error\"\n  }\n}\n\n// Example code that triggers errors:\n// $.ajax({ url: '/api' }); // error: Unexpected jQuery ajax request.\n// new XMLHttpRequest(); // error: Unexpected XMLHttpRequest.\n\n// Allowed:\n// fetch('/api').then(response => response.json());","lang":"javascript","description":"Shows how to configure the plugin in .eslintrc.json and which patterns are flagged."},"warnings":[{"fix":"Use eslint-plugin-no-jquery or a custom eslint rule.","message":"Package has not been updated since 2019; consider using eslint-plugin-no-jquery for broader jQuery linting.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Add 'fetch/no-$http': 'error' to rules.","message":"The 'no-$http' rule is disabled by default to improve performance; must be explicitly enabled.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use eslint-plugin-fetch only with ESLint < 9 or convert config to legacy format.","message":"Only supports ESLint 1.x legacy config format; incompatible with flat config in ESLint 9+.","severity":"deprecated","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.1':25 '2019':35 'activ':32 'ajax':13,18,72 'angular':19 'broader':55 'compat':59 'default':52 'develop':33 'differenti':53 'disabl':50 'enforc':8 'eslint':2,5,57,67,70 'eslint-plugin':69 'eslint-plugin-compat':56 'eslint-plugin-fetch':1 'eslintplugin':68 'fetch':4,10,64,73 'focus':61 'http':21,47 'includ':38 'javascript':66 'jqueri':16,41 'key':36 'latter':49 'like':15 'method':14 'no-jqueri':39 'no-xhr':42 'plugin':3,6,58,71 'prefer':65 'releas':29 'rule':37 'sinc':34 'sole':62 'use':9 'version':24 'xhr':44,74 'xmlhttprequest':23","created_at":"2026-06-07T16:51:51.402662+00:00","updated_at":"2026-06-07T16:51:51.402662+00:00","problems":[{"fix":"Run npm install eslint-plugin-fetch --save-dev or check config uses 'fetch' not 'eslint-plugin-fetch'.","cause":"Plugin not installed or config typo.","error":"ESLint couldn't find the plugin \"eslint-plugin-fetch\"."},{"fix":"Install plugin locally in project root or globally if ESLint is global.","cause":"Local installation missing or global vs local mismatch.","error":"Failed to load plugin 'fetch': Cannot find module 'eslint-plugin-fetch'"},{"fix":"Ensure rule exists in the plugin version; it's part of 0.0.1, so it's valid.","cause":"Rule is disabled by default but referenced in config.","error":"Configuration for rule \"fetch/no-$http\" is invalid"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"eslint-plugin-fetch","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-07","next_check":"2026-09-05","install_tag":null}}