{"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,"search_vec":"'1.0.5':29 'api':34 'broader':53 'config':55 'consist':48 'current':31 'default':22 'differenti':39 'enforc':11,47 'eslint':2,8,60 'eslint-plugin-react-namespace-import':1 'focus':40 'frequenc':58 'import':6,13,14,23,50,62 'initi':36 'javascript':59 'key':38 'lint':54 'low':56 'mainten':57 'name':20 'namespac':5,12,63 'packag':27 'plugin':3,9 'react':4,16,18,26,49,61 'releas':37 'rule':45 'sinc':35 'singl':44 'sole':41 'stabl':33 'style':51 'unlik':52 'version':28","created_at":"2026-04-25T11:20:15.974093+00:00","updated_at":"2026-04-25T11:20:15.974093+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/gonstoll/eslint-plugin-react-namespace-import","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-react-namespace-import","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}}