An ESLint Plugin For Linguijs
Installation
You'll first need to install ESLint:
npm install --save-dev eslint
yarn add eslint --dev
Next, install eslint-plugin-lingui
:
npm install --save-dev eslint-plugin-lingui
yarn add eslint-plugin-lingui --dev
Note: 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 of the recommended rules for our plugin, add the following config:
import pluginLingui from 'eslint-plugin-lingui'
export default [
pluginLingui.configs['flat/recommended'],
]
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',
},
},
]
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