Skip to content

Commit

Permalink
update docs, added release flow and canary flows
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Oct 3, 2020
1 parent 997bf6f commit dd0ad38
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 11 deletions.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions packages/plugin/src/rules/avoid-operation-name-prefix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ function verifyRule(

const rule: GraphQLESLintRule<AvoidOperationNamePrefixConfig> = {
meta: {
type: 'suggestion',
docs: {
description:
'Enforce/avoid operation name prefix, useful if you wish to avoid prefix in your root fields, or avoid using REST terminology in your schema',
category: 'Stylistic Issues',
recommended: false,
url: 'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/avoid-operation-name-prefix.md',
},
messages: {
[AVOID_OPERATION_NAME_PREFIX]: `Forbidden operation name prefix: "{{ invalidPrefix }}"`,
},
Expand Down
12 changes: 7 additions & 5 deletions packages/plugin/src/rules/description-style.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { GraphQLESLintRule } from '../types';

type DescriptionStyleRuleConfig = [{
style: 'inline' | 'block';
}];
type DescriptionStyleRuleConfig = [
{
style: 'inline' | 'block';
}
];

const rule: GraphQLESLintRule<DescriptionStyleRuleConfig> = {
meta: {
type: 'suggestion',
docs: {
description: 'Require all comments to follow the same style',
description: 'Require all comments to follow the same style (either block or inline)',
category: 'Stylistic Issues',
recommended: false,
url: 'https://github.com/ilyavolodin/graphql-eslint/blob/master/docs/rules/description-style.md',
url: 'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/description-style.md',
},
schema: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/src/rules/input-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const rule: GraphQLESLintRule<InputNameRuleConfig> = {
type: 'suggestion',
docs: {
description:
'require mutation argument to be always called "input" and input type to be called Mutation name + "Input"',
'Require mutation argument to be always called "input" and input type to be called Mutation name + "Input"',
category: 'Stylistic Issues',
recommended: false,
url: 'https://github.com/ilyavolodin/graphql-eslint/blob/master/docs/rules/input-name.md',
url: 'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/input-name.md',
},
schema: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/src/rules/naming-convention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ const rule: GraphQLESLintRule<NamingConventionRuleConfig> = {
meta: {
type: 'suggestion',
docs: {
description: 'requires description around GraphQL nodes',
description: 'Requires description around GraphQL nodes',
category: 'Best practices',
recommended: true,
url: 'https://github.com/ilyavolodin/graphql-eslint/blob/master/docs/rules/naming-convention.md',
url: 'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/naming-convention.md',
},
schema: [
{
Expand Down
8 changes: 8 additions & 0 deletions packages/plugin/src/rules/no-anonymous-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ const NO_ANONYMOUS_OPERATIONS = 'NO_ANONYMOUS_OPERATIONS';

const rule: GraphQLESLintRule = {
meta: {
type: 'suggestion',
docs: {
category: 'Best Practices',
description:
'Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes.',
recommended: true,
url: 'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/no-anonymous-operations.md',
},
messages: {
[NO_ANONYMOUS_OPERATIONS]: `Anonymous GraphQL operations are forbidden. Please make sure to name your {{ operation }}!`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ const ERROR_MESSAGE_ID = 'NO_CASE_INSENSITIVE_ENUM_VALUES_DUPLICATES';

const rule: GraphQLESLintRule = {
meta: {
type: 'suggestion',
docs: {
url:
'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/no-case-insensitive-enum-values-duplicates.md',
category: 'Best Practices',
recommended: true,
},
fixable: 'code',
messages: {
[ERROR_MESSAGE_ID]: `Case-insensitive enum values duplicates are not allowed! Found: "{{ found }}"`,
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin/src/rules/no-operation-name-suffix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ function verifyRule(
const rule: GraphQLESLintRule = {
meta: {
fixable: 'code',
type: 'suggestion',
docs: {
category: 'Stylistic Issues',
recommended: true,
description: `Makes sure you are not adding the operation type to the name of the operation.`,
url: `https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/no-operation-name-suffix.md`,
},
messages: {
[NO_OPERATION_NAME_SUFFIX]: `Unnecessary "{{ invalidSuffix }}" suffix in your operation name!`,
},
Expand Down
5 changes: 4 additions & 1 deletion packages/plugin/src/rules/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ type PrettierRuleConfig = [
const rule: GraphQLESLintRule<PrettierRuleConfig> = {
meta: {
docs: {
url: 'https://github.com/ilyavolodin/graphql-eslint/blob/master/docs/rules/prettier.md',
description: `Having all your code follow the same styling guidelines makes it easier to read and understand the code`,
recommended: true,
category: 'Stylistic Issues',
url: 'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/prettier.md',
},
type: 'layout',
fixable: 'code',
Expand Down
10 changes: 9 additions & 1 deletion packages/plugin/src/rules/require-deprecation-reason.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import { GraphQLESLintRule } from '../types';
import { valueFromNode } from '../estree-parser/utils';

const rule: GraphQLESLintRule = {
meta: {},
meta: {
docs: {
description: `Require all deprecation directives to specify a reason`,
category: 'Best Practices',
url: `https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/require-deprecation-reason.md`,
recommended: true,
},
type: 'suggestion',
},
create(context) {
return {
Directive(node) {
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin/src/rules/require-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ function verifyRule(

const rule: GraphQLESLintRule<RequireDescriptionRuleConfig> = {
meta: {
docs: {
category: 'Best Practices',
description: `Enforce descriptions in your type definitions`,
url: `https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/require-description.md`,
recommended: true,
},
type: 'suggestion',
messages: {
[REQUIRE_DESCRIPTION_ERROR]: `Description is required for nodes of type "{{ nodeType }}"`,
},
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin/src/rules/require-id-when-available.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ type RequireIdWhenAvailableRuleConfig = [{ fieldName: string }];

const rule: GraphQLESLintRule<RequireIdWhenAvailableRuleConfig, true> = {
meta: {
type: 'suggestion',
docs: {
category: 'Best Practices',
description: `This rule allow you to enforce selecting specific fields when they are available on the GraphQL type.`,
url: `https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/require-id-when-available.md`,
},
messages: {
[REQUIRE_ID_WHEN_AVAILABLE]: `Field "{{ fieldName }}" must be selected when it's available on a type. Please make sure to include it in your selection set!`,
},
Expand Down
5 changes: 5 additions & 0 deletions packages/plugin/src/rules/validate-against-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ function validateDoc(context: GraphQLESlintRuleContext, schema: GraphQLSchema, d

const rule: GraphQLESLintRule = {
meta: {
docs: {
url: `https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/validate-against-schema.md`,
recommended: true,
description: `This rule validates GraphQL operations against your GraphQL schema, and reflects the error as lint errors.`,
},
type: 'problem',
},
create(context) {
Expand Down

0 comments on commit dd0ad38

Please sign in to comment.