Socket
Socket
Sign inDemoInstall

@sanity/eslint-config-i18n

Package Overview
Dependencies
128
Maintainers
44
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sanity/eslint-config-i18n

An ESLint configuration to help with localizing Sanity Studios


Version published
Maintainers
44
Install size
4.98 MB
Created

Changelog

Source

1.0.0 (2023-12-05)

Features

  • first commit (abf24c9)
  • release (1665100)

Readme

Source

@sanity/eslint-config-i18n

An ESLint configuration to help with localizing Sanity Studios.

This package utilizes @rushstack/eslint-patch to include plugins as dependencies. This making installation easier and allows us to manage those dependencies for you.

Depends on:

Installation

Install

yarn add eslint @sanity/eslint-config-i18n --dev

or

npm install eslint @sanity/eslint-config-i18n --save-dev

Update the configuration

Update your .eslintrc to include "@sanity/eslint-config-i18n"

{
  "extends": [
    "@sanity/eslint-config-studio",
    "@sanity/eslint-config-i18n"
  ]
}

Optionally: If you wish to configure @sanity/eslint-plugin-i18n:

{
  "extends": ["@sanity/eslint-config-studio", "@sanity/eslint-config-i18n"],
  "rules": {
    "@sanity/i18n/no-attribute-string-literals": [
      "error",
      // See https://github.com/sanity-io/eslint-plugin-i18n#rule-options
      {
        "ignores": {},
        "only": {},
        "mode": "extends"
      }
    ],
    "@sanity/i18n/no-attribute-string-literals": [
      "error",
      // See https://github.com/sanity-io/eslint-plugin-i18n#rule-options
      {
        "ignores": {},
        "only": {},
        "mode": "extends"
      }
    ]
  },
  "overrides": [
    // turn off these rules for your tests
    {
      "files": [
        "**/*/test/**/*",
        "**/*/__tests__/**/*",
        "**/*.test.{js,ts,tsx}"
      ],
      "rules": {
        "i18next/no-literal-string": "off",
        "@sanity/i18n/no-attribute-string-literals": "off",
        "@sanity/i18n/no-attribute-template-literals": "off"
      }
    }
  ]
}

Release new version

Run "CI & Release" workflow. Make sure to select the main branch and check "Release new version".

Semantic release will only release on configured branches, so it is safe to run release on any branch.

Keywords

FAQs

Last updated on 05 Dec 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc