Skip to content

ESlint plugin

Introduction

To facilitate the usage of Stringatele in your project, we’ve developed an ESlint plugin. This plugin will automatically highlight lines in your code where you are using plain text strings without the use of Stringtale and offer to wrap your text in <Value> tags. It can also throw errors when building your code.

Implementation

  1. Install the @stringtale/eslint-plugin as a dev package in your project.

    Terminal window
    npm install --dev @stringtale/eslint-plugin
  2. Add the following ESlint rules to your eslint configuration. Depending on your project, the exact location will differ, usually it’s either in .eslintrc.js or eslint.config.js.

    module.exports = {
    "plugins": ["@stringtale"],
    "extends": [
    "plugin:@stringtale/recommended"
    ]
    }

    For more information on how to configure eslint, check the configuration documentation as well as the configuration files documentation.

  3. Your editor should now warn you whenever you attempt to add new text to your project without using Stringtale.