1.0.0 • Published 4 months ago

eslint-plugin-sanity-studio v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

eslint-plugin-sanity-studio

npm GitHub Workflow Status (with event)

This plugin lints Sanity schemas to enforce helper functions.

Rules

💼 Configurations enabled in.\ ✅ Set in the recommended configuration.\ 🔧 Automatically fixable by the --fix CLI option.

Name                      Description💼🔧
define-array-member-helperEnforce "defineArrayMember" helper functions for Sanity schema arrays.🔧
define-field-helperEnforce "defineField" helper functions for Sanity schema fields.🔧
define-type-helperEnforce "defineType" helper functions for Sanity schemas.🔧

Installation

You'll first need to install ESLint:

npm install eslint --save-dev
yarn add eslint --dev
pnpm add eslint --save-dev

Next, install eslint-plugin-sanity-studio:

npm install eslint-plugin-sanity-studio --save-dev
yarn add eslint-plugin-sanity-studio --dev
pnpm add eslint-plugin-sanity-studio --save-dev

Usage

Add sanity-studio to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["sanity-studio"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "sanity-studio/rule-name": "error"
  }
}

Alternatively, use the recommended configuration by extending plugin:sanity-studio/recommended.

{
  "extends": [
    "eslint:recommended",
    // Currently errors for all missing helper functions.
    "plugin:sanity-studio/recommended"
  ]
}
1.0.0

4 months ago

0.4.0

11 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago