{"id":19900,"library":"eslint-plugin-react-namespace-import","title":"eslint-plugin-react-namespace-import","description":"An ESLint plugin that enforces namespace imports (import * as React from 'react') over named or default imports from the React package. Version 1.0.5 is current, with stable API since initial release. Key differentiator: focused solely on a single rule to enforce consistent React import style, unlike broader linting configs. Low maintenance frequency.","status":"active","version":"1.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/gonstoll/eslint-plugin-react-namespace-import","tags":["javascript","eslint","react","import","namespace"],"install":[{"cmd":"npm install eslint-plugin-react-namespace-import","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-react-namespace-import","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-react-namespace-import","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for plugin to work","package":"eslint","optional":false}],"imports":[{"note":"Default export provides { rules, configs }.","wrong":"import { rules } from 'eslint-plugin-react-namespace-import'","symbol":"plugin","correct":"import plugin from 'eslint-plugin-react-namespace-import'"},{"note":"CommonJS require is supported; rule object is under 'rules' key.","wrong":"const rules = require('eslint-plugin-react-namespace-import').rules","symbol":"rules","correct":"const { rules } = require('eslint-plugin-react-namespace-import')"},{"note":"Access recommended config via configs.recommended for programmatic use.","symbol":"configs.recommended","correct":"import { configs } from 'eslint-plugin-react-namespace-import'"}],"quickstart":{"code":"// Install plugin\nnpm install --save-dev eslint eslint-plugin-react-namespace-import\n\n// .eslintrc.json\n{\n  \"extends\": [\"plugin:react-namespace-import/recommended\"],\n  \"rules\": {\n    \"react-namespace-import/no-namespace-import\": \"error\"\n  }\n}\n\n// Example code that will fail lint:\n// import React from 'react';\n// Correct: import * as React from 'react';","lang":"javascript","description":"Install and configure the plugin to enforce namespace imports from React."},"warnings":[{"fix":"Only enforces namespace imports for 'react'; other packages ignored.","message":"The rule only applies to imports from 'react' package; does not check aliases like 'react-dom' or other packages.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"No fix available; rule name remains as is. Consider it as 'enforce-namespace-import' mentally.","message":"Plugin uses 'no-namespace-import' rule name which is confusing (it actually enforces namespace import).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Override rule severity in your own .eslintrc if you want errors.","message":"When using recommended config, the rule is set to 'warn' by default, not 'error'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use another plugin if you need to enforce namespace imports for other packages.","message":"Plugin does not support customizing the package name to enforce; hardcoded to 'react'.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev eslint-plugin-react-namespace-import","cause":"Plugin not installed or not in node_modules.","error":"ESLint couldn't find the plugin \"eslint-plugin-react-namespace-import\"."},{"fix":"Ensure plugin is in 'plugins' array, not 'extends', and rule name is correct.","cause":"Rule referenced incorrectly in plugins or rules section.","error":"Configuration for rule \"react-namespace-import/no-namespace-import\" is invalid."},{"fix":"Ensure eslint version >=0.8.0 and plugin is installed.","cause":"Plugin not loaded due to missing or mismatched eslint version.","error":"Cannot read properties of undefined (reading 'no-namespace-import')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}