package
ESLint plugin to ensure consistent react imports
npm install eslint-plugin-react-importGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
56.7 kB
Includes dependencies.
ESLint plugin to ensure consistent react imports
💼 Configurations enabled in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
| Name | Description | 💼 | 🔧 |
|---|---|---|---|
| consistent-syntax | Enforces React import style across your code. Can be customized to use default, namespace, or named import. | ✅ | 🔧 |
npm i --save-dev eslint eslint-plugin-react-importyarn add --dev eslint eslint-plugin-react-importpnpm add --save-dev eslint eslint-plugin-react-import[!TIP] For a working example check
tests/fixturesfolders
// eslint.config.js
import eslintPluginReactImport from 'eslint-plugin-react-import';
export default [
// other configs
// ...
eslintPluginReactImport.configs.recommended,
];[!NOTE] In order to replace all type occurrences typescript parser should be used
// eslint.config.js
import eslintPluginReactImport from 'eslint-plugin-react-import';
import typescriptEslintParser from '@typescript-eslint/parser';
export default [
// other configs
// ...
{
...eslintPluginReactImport.configs.recommended,
languageOptions: {
...eslintPluginReactImport.configs.recommended.languageOptions,
parser: typescriptEslintParser,
},
},
];