Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-lingui

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-lingui

ESLint plugin for Lingui

  • 0.8.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32K
increased by15.16%
Maintainers
1
Weekly downloads
 
Created
Source

An ESLint Plugin For Linguijs

Set of eslint rules for Lingui projects

npm npm main-suite codecov GitHub

Installation

You'll first need to install ESLint:

npm install --save-dev eslint
# or
yarn add eslint --dev

Next, install eslint-plugin-lingui:

npm install --save-dev eslint-plugin-lingui
# or
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)

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)

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

Keywords

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc