New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@naturacosmeticos/eslint-plugin-i18n-checker

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@naturacosmeticos/eslint-plugin-i18n-checker

Helps you identify what locales keys are not included in your locales files

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

eslint-plugin-i18n-checker

Known Vulnerabilities Build Status Codacy Badge

This eslint plugin helps you identify what locales keys are not included in your locales files.

Considering the follow scenario:

--locales/
----en-us.json
----es-pe.json
----pt-br.json
--src/
-----components/
-------header.js

In your header.js you have a call to your i18n function to get the localized value of the string logout: translate('logout')

The i18n-checker will verify if the logout is defined in each locale file you have.

How to use

Installation

npm i --save-dev '@naturacosmeticos/eslint-plugin-i18n-checker'

yarn add -D '@naturacosmeticos/eslint-plugin-i18n-checker'

Configuration

In your eslintrc file you need to add @naturacosmeticos/i18n-checker in the plugins section.

Options

You can configure the following options:

  • localesPath - string - your locales relative path (default is /locales/)
  • messagesBasePath - string - if your locales files has a base path you can pass it (default is undefined)
  • translationFunctionName - string - the name of your translation function (default is translate)

Example:

"@naturacosmeticos/i18n-checker/path-in-locales": ['error',
  {
    localesPath: 'public/locales/',
    messagesBasePath: 'translations',
    translationFunctionName: 't'
  }
]

Contributing

You can contribute submitting pull requests.

Setup

Install the dependencies running yarn in the project folder.

Lint

Just run yarn lint

Tests

You can run the following commands:

  • yarn test
  • yarn test:watch

Keywords

FAQs

Package last updated on 05 Nov 2018

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