@20minutes/eslint-plugin-graphql 中文文档教程

发布于 3年前 浏览 27 项目主页 更新于 3年前

@20minutes/eslint-plugin-graphql

Node CI

一个 ESLint 插件,用于检查 JavaScript 中的标记查询字符串,或 .graphql 文件中的查询,针对GraphQL 架构。

这与 eslint-plugin-graphql 完全相同,但依赖性高达日期。

yarn add --dev @20minutes/eslint-plugin-graphql

要求:

  • requires Node 12+
  • requires GraphQL 15+

配置相同,但有些地方需要用@20minutes/graph代替graph

// In a file called .eslintrc.js
module.exports = {
  parser: '@babel/eslint-parser',
  rules: {
    "@20minutes/graphql/template-strings": [/* ... */],
    "@20minutes/graphql/no-deprecated-fields": [/* ... */],
    "@20minutes/graphql/required-fields": [/* ... */],
  },
  plugins: [
    '@20minutes/graphql'
  ]
}

@20minutes/eslint-plugin-graphql

Node CI

An ESLint plugin that checks tagged query strings inside JavaScript, or queries inside .graphql files, against a GraphQL schema.

This is exactly the same plugin as eslint-plugin-graphql but with dependencies up to date.

yarn add --dev @20minutes/eslint-plugin-graphql

Requirements:

  • requires Node 12+
  • requires GraphQL 15+

Configuration is the same but you need to use @20minutes/graph instead of graph in some places.

// In a file called .eslintrc.js
module.exports = {
  parser: '@babel/eslint-parser',
  rules: {
    "@20minutes/graphql/template-strings": [/* ... */],
    "@20minutes/graphql/no-deprecated-fields": [/* ... */],
    "@20minutes/graphql/required-fields": [/* ... */],
  },
  plugins: [
    '@20minutes/graphql'
  ]
}
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文