Package Exports
- eslint-plugin-lingui
- eslint-plugin-lingui/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-lingui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
An ESLint Plugin For Linguijs
Set of eslint rules for Lingui projects
Installation
You'll first need to install ESLint:
npm install --save-dev eslint
# or
yarn add eslint --devNext, install eslint-plugin-lingui:
npm install --save-dev eslint-plugin-lingui
# or
yarn add eslint-plugin-lingui --devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-lingui globally.
Flat Config (eslint.config.js)
Recommended Setup
To enable all the recommended rules for our plugin, add the following config:
import pluginLingui from 'eslint-plugin-lingui'
export default [
pluginLingui.configs['flat/recommended'],
// Any other config...
]We also recommend enabling the no-unlocalized-strings rule. It’s not enabled by default because it needs to be set up specifically for your project. Please check the rule's documentation for example configurations.
Custom setup
Alternatively, you can load the plugin and configure only the rules you want to use:
import pluginLingui from 'eslint-plugin-lingui'
export default [
{
plugins: {
lingui: pluginLingui,
},
rules: {
'lingui/t-call-in-function': 'error',
},
},
// Any other config...
]Legacy Config (.eslintrc)
Recommended setup
To enable all of the recommended rules for our plugin, add plugin:lingui/recommended in extends:
{
"extends": ["plugin:lingui/recommended"]
}Custom setup
Alternatively, add lingui to the plugins section, and configure the rules you want to use:
{
"plugins": ["lingui"],
"rules": {
"lingui/t-call-in-function": "error"
}
}Rules
✅ - Recommended