0.1.1 • Published 7 years ago

eslint-plugin-bkpr v0.1.1

Weekly downloads
38
License
MIT
Repository
-
Last release
7 years ago

eslint-plugin-bkpr

A set of custom ESLint rules used at Beekeeper.

Rules

no-unused-translation: Will check if translate function is called with unknown translation key

Get Started

First, we need to add eslint plugin to the project dev dependencies. Make sure to met peerDependencies.

npm install --save-dev eslint-plugin-bkpr

Let's say, we want every call with i18n.t(...) to be checked, we will need to add an .eslintrc.js file:

const translations = require('./translations.js');
const translationKeys = Object.keys(translations);

module.exports = {
  plugins: ['bkpr'],
  rules: {
    'bkpr/no-unused-translation': ['error', 'i18n', 't', translationKeys]
  }
};