0.0.0 • Published 2 years ago

eslint-plugin-use-next-i18next-not-react-i18next v0.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

eslint-plugin-use-next-i18next-not-react-i18next

If you're using Next.js 12, use next-i18next instead of react-i18next.

This plugin is for dummy devs like me who forget to change the import from react-i18next to next-i18next.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-use-next-i18next-not-react-i18next:

npm install eslint-plugin-use-next-i18next-not-react-i18next --save-dev

Usage

Add use-next-i18next-not-react-i18next to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["use-next-i18next-not-react-i18next"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "use-next-i18next-not-react-i18next/no-react-i18next": 2
  }
}

Rules

šŸ’¼ Configurations enabled in.\ āœ… Set in the recommended configuration.\ šŸ”§ Automatically fixable by the --fix CLI option.

NameDescriptionšŸ’¼šŸ”§
no-react-i18nextEnforce next-i18next usage instead of react-i18nextāœ…šŸ”§