Skip to content

Commit

Permalink
Bump eslint-config-standard from 14.1.1 to 16.0.1 (#5011)
Browse files Browse the repository at this point in the history
* Bump eslint-config-standard from 14.1.1 to 16.0.1

Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 14.1.1 to 16.0.1.
- [Release notes](https://github.com/standard/eslint-config-standard/releases)
- [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md)
- [Commits](standard/eslint-config-standard@v14.1.1...v16.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Improve typescript vue apollo plugin (#5007)

* feat: support type imports

Closes #5006

* fix: do not use undefined for variables generic and parameter

Not using undefined for variables generic fixes the following issue:
Type 'undefined' does not satisfy the constraint 'Record<string, any>'

Not using undefined for variables parameter fixes the following issue:
Argument of type 'undefined' is not assignable to parameter of type 'VariablesParameter<Exact<{ [key: string]: never; }>>'

* feat: improve jsdoc formatting

* Remove newlines before and after the first argument in the example code.
* Add @param variables where applicable.

* chore: add changeset

* chore: update dev-test examples

* fix(cli): resolve modules provided through the -r flags relative to the cwd (#4983)

* fix(cli): require -r flags relative to the cwd

* chore: disable eslint for import

* fix(cli): resolve from folders correctly (#5032)

* fix(cli): resolve from folders correctly

* chore: changesets

* modify apollo angular visitor to allow external operation definitions related to #4719 (#4765)

* modify apollo angular visitor to allow external opration definitions

* handle document

* fix document

* resolve unit test failures

* add unit test

* reset version

* add changeset

* add a warning for importOperationTypesFrom, update apollo-angular documentation

* more warnings and tests to help get configuration correct

* more eslint ignores

* update documentation for external documentMode

* more readme updates

* more readme updates

* fix(vue-apollo): regression, respect omitOperationSuffix even with dedupeOperationSuffix enabled (#5015)

* fix(vue-apollo): regression, respect omitOperationSuffix even with dedupeOperationSuffix enabled

* updated changeset

* fix changeset

Co-authored-by: Dotan Simha <dotansimha@gmail.com>

* Bump graphql from 15.3.0 to 15.4.0 (#5008)

* Bump graphql from 15.3.0 to 15.4.0

Bumps [graphql](https://github.com/graphql/graphql-js) from 15.3.0 to 15.4.0.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v15.3.0...v15.4.0)

Signed-off-by: dependabot[bot] <support@github.com>

* update all snapshot
fix for patches

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dotan Simha <dotansimha@gmail.com>

* Bump eslint-config-standard from 14.1.1 to 16.0.1

Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 14.1.1 to 16.0.1.
- [Release notes](https://github.com/standard/eslint-config-standard/releases)
- [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md)
- [Commits](standard/eslint-config-standard@v14.1.1...v16.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

* fixes for lint issues

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Sthamer <sthamer.pascal@gmail.com>
Co-authored-by: Kristoffer K <merceyz@users.noreply.github.com>
Co-authored-by: Jeffrey Barrus <1044815+jbarrus@users.noreply.github.com>
Co-authored-by: JoeSchr <JoeSchr@users.noreply.github.com>
Co-authored-by: Dotan Simha <dotansimha@gmail.com>
  • Loading branch information
6 people authored Nov 4, 2020
1 parent da6ff08 commit c137957
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 54 deletions.
21 changes: 10 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"standard",
"prettier",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {
"no-empty": "off",
"no-console": "error",
"no-prototype-builtins": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-unused-vars": ["warn", {"args": "none"}],
"no-unused-vars": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars-experimental": ["warn", { "ignoreArgsIfArgsAfterAreUsed": true }],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-interface": "off",
Expand All @@ -31,18 +33,15 @@
},
"overrides": [
{
"files": [
"**/tests/**/*.ts",
"**/graphql-codegen-testing/**/*.ts",
"*.spec.ts"
],
"files": ["**/tests/**/*.ts", "**/graphql-codegen-testing/**/*.ts", "*.spec.ts"],
"env": {
"jest": true
},
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
],
"ignorePatterns": ["dist", "node_modules", "dev-test", "website"]
"ignorePatterns": ["dist", "node_modules", "dev-test", "website", "test-files"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"bob-the-bundler": "1.1.0",
"eslint": "7.12.1",
"eslint-config-prettier": "6.15.0",
"eslint-config-standard": "14.1.1",
"eslint-config-standard": "16.0.1",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/src/utils/listr-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const render = tasks => {
export class ErrorRenderer {
private tasks: any;

constructor(tasks, options) {
constructor(tasks, _options) {
this.tasks = tasks;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('generate-and-save', () => {
const filename = 'overwrite.ts';
const writeSpy = jest.spyOn(fs, 'writeSync').mockImplementation();
const readSpy = jest.spyOn(fs, 'readSync').mockImplementation();
readSpy.mockImplementation(f => '');
readSpy.mockImplementation(_f => '');
// forces file to exist
const fileExistsSpy = jest.spyOn(fs, 'fileExists');
fileExistsSpy.mockImplementation(file => file === filename);
Expand Down
1 change: 0 additions & 1 deletion packages/graphql-codegen-cli/tests/init.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/first */
jest.mock('latest-version', () => {
return () => Promise.resolve('1.0.0');
});
Expand Down
3 changes: 1 addition & 2 deletions packages/plugins/c-sharp/c-sharp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { CSharpResolversPluginRawConfig } from './config';
export const plugin: PluginFunction<CSharpResolversPluginRawConfig> = async (
schema: GraphQLSchema,
documents: Types.DocumentFile[],
config: CSharpResolversPluginRawConfig,
{ outputFile }
config: CSharpResolversPluginRawConfig
): Promise<string> => {
const visitor = new CSharpResolversVisitor(config, schema);
const printedSchema = printSchema(schema);
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/flow/resolvers/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class FlowResolversVisitor extends BaseResolversVisitor<RawResolversConfi
return `$RequireFields<${argsType}, { ${fields.map(f => `${f.name.value}: *`).join(', ')} }>`;
}

protected applyOptionalFields(argsType: string, fields: readonly InputValueDefinitionNode[]): string {
protected applyOptionalFields(argsType: string, _fields: readonly InputValueDefinitionNode[]): string {
return argsType;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/java/resolvers/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class JavaResolversVisitor extends BaseVisitor<JavaResolversPluginRawConf
.withBlock(node.fields.map(f => indent((f as any)(false))).join('\n')).string;
}

FieldDefinition(node: FieldDefinitionNode, key: string | number, parent: any) {
FieldDefinition(node: FieldDefinitionNode, key: string | number, _parent: any) {
return (isInterface: boolean) => {
const baseType = getBaseTypeNode(node.type);
const typeToUse = this.getTypeToUse(baseType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ export type IDirectiveResolvers${contextType} = ${name}<ContextType>;`
return `${resolversType}['${name}']`;
}

protected getParentTypeForSignature(node: FieldDefinitionNode): string {
protected getParentTypeForSignature(_node: FieldDefinitionNode): string {
return 'ParentType';
}

Expand Down Expand Up @@ -996,7 +996,7 @@ export type IDirectiveResolvers${contextType} = ${name}<ContextType>;`
return `RequireFields<${argsType}, ${fields.map(f => `'${f.name.value}'`).join(' | ')}>`;
}

protected applyOptionalFields(argsType: string, fields: readonly InputValueDefinitionNode[]): string {
protected applyOptionalFields(argsType: string, _fields: readonly InputValueDefinitionNode[]): string {
this._globalDeclarations.add(REQUIRE_FIELDS_TYPE);
return `RequireFields<${argsType}, never>`;
}
Expand Down Expand Up @@ -1136,13 +1136,13 @@ export type IDirectiveResolvers${contextType} = ${name}<ContextType>;`
].join('\n');
}

protected buildEnumResolverContentBlock(node: EnumTypeDefinitionNode, mappedEnumType: string): string {
protected buildEnumResolverContentBlock(_node: EnumTypeDefinitionNode, _mappedEnumType: string): string {
throw new Error(`buildEnumResolverContentBlock is not implemented!`);
}

protected buildEnumResolversExplicitMappedValues(
node: EnumTypeDefinitionNode,
valuesMapping: { [valueName: string]: string | number }
_node: EnumTypeDefinitionNode,
_valuesMapping: { [valueName: string]: string | number }
): string {
throw new Error(`buildEnumResolversExplicitMappedValues is not implemented!`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export class BaseTypesVisitor<
return comment;
}

protected mergeAllFields(allFields: string[], hasInterfaces: boolean): string {
protected mergeAllFields(allFields: string[], _hasInterfaces: boolean): string {
return allFields.join('\n');
}

Expand All @@ -383,7 +383,7 @@ export class BaseTypesVisitor<

getInterfaceTypeDeclarationBlock(
node: InterfaceTypeDefinitionNode,
originalNode: InterfaceTypeDefinitionNode
_originalNode: InterfaceTypeDefinitionNode
): DeclarationBlock {
const declarationBlock = new DeclarationBlock(this._declarationBlockConfig)
.export()
Expand All @@ -403,7 +403,7 @@ export class BaseTypesVisitor<
.join('\n\n');
}

ScalarTypeDefinition(node: ScalarTypeDefinitionNode): string {
ScalarTypeDefinition(_node: ScalarTypeDefinitionNode): string {
// We empty this because we handle scalars in a different way, see constructor.
return '';
}
Expand Down Expand Up @@ -519,7 +519,7 @@ export class BaseTypesVisitor<
.join(',\n');
}

DirectiveDefinition(node: DirectiveDefinitionNode): string {
DirectiveDefinition(_node: DirectiveDefinitionNode): string {
return '';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class BaseVisitor<TRawConfig extends RawConfig = RawConfig, TPluginConfig
});
}

protected getPunctuation(declarationKind: DeclarationKind): string {
protected getPunctuation(_declarationKind: DeclarationKind): string {
return '';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -476,19 +476,19 @@ export class ClientSideBaseVisitor<
}

protected buildOperation(
node: OperationDefinitionNode,
documentVariableName: string,
operationType: string,
operationResultType: string,
operationVariablesTypes: string
_node: OperationDefinitionNode,
_documentVariableName: string,
_operationType: string,
_operationResultType: string,
_operationVariablesTypes: string
): string {
return null;
}

protected getDocumentNodeSignature(
resultType: string,
variablesTypes: string,
node: FragmentDefinitionNode | OperationDefinitionNode
_resultType: string,
_variablesTypes: string,
_node: FragmentDefinitionNode | OperationDefinitionNode
): string {
if (
this.config.documentMode === DocumentMode.documentNode ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ export class BaseSelectionSetProcessor<Config extends SelectionSetProcessorConfi
}

transformPrimitiveFields(
schemaType: GraphQLObjectType | GraphQLInterfaceType,
fields: PrimitiveField[]
_schemaType: GraphQLObjectType | GraphQLInterfaceType,
_fields: PrimitiveField[]
): ProcessResult {
throw new Error(
`Please override "transformPrimitiveFields" as part of your BaseSelectionSetProcessor implementation!`
);
}

transformAliasesPrimitiveFields(
schemaType: GraphQLObjectType | GraphQLInterfaceType,
fields: PrimitiveAliasedFields[]
_schemaType: GraphQLObjectType | GraphQLInterfaceType,
_fields: PrimitiveAliasedFields[]
): ProcessResult {
throw new Error(
`Please override "transformAliasesPrimitiveFields" as part of your BaseSelectionSetProcessor implementation!`
);
}

transformLinkFields(fields: LinkField[]): ProcessResult {
transformLinkFields(_fields: LinkField[]): ProcessResult {
throw new Error(`Please override "transformLinkFields" as part of your BaseSelectionSetProcessor implementation!`);
}

transformTypenameField(type: string, name: string): ProcessResult {
transformTypenameField(_type: string, _name: string): ProcessResult {
throw new Error(
`Please override "transformTypenameField" as part of your BaseSelectionSetProcessor implementation!`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ export class OperationVariablesToObject {
return `${formattedFieldString}: ${formattedTypeString}`;
}

public wrapAstTypeWithModifiers(baseType: string, typeNode: TypeNode): string {
public wrapAstTypeWithModifiers(_baseType: string, _typeNode: TypeNode): string {
throw new Error(`You must override "wrapAstTypeWithModifiers" of OperationVariablesToObject!`);
}

protected formatFieldString(fieldName: string, isNonNullType: boolean, hasDefaultValue: boolean): string {
protected formatFieldString(fieldName: string, isNonNullType: boolean, _hasDefaultValue: boolean): string {
return fieldName;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TypeScriptOperationVariablesToObject as TSOperationVariablesToObject } from '@graphql-codegen/typescript';

export class TypeScriptOperationVariablesToObject extends TSOperationVariablesToObject {
protected formatTypeString(fieldType: string, isNonNullType: boolean, hasDefaultValue: boolean): string {
protected formatTypeString(fieldType: string, isNonNullType: boolean, _hasDefaultValue: boolean): string {
return fieldType;
}
}
2 changes: 1 addition & 1 deletion packages/plugins/typescript/operations/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor<
: [];
}

protected getPunctuation(declarationKind: DeclarationKind): string {
protected getPunctuation(_declarationKind: DeclarationKind): string {
return ';';
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/resolvers/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class TypeScriptResolversVisitor extends BaseResolversVisitor<
return this.clearOptional(baseValue);
}

protected getPunctuation(declarationKind: DeclarationKind): string {
protected getPunctuation(_declarationKind: DeclarationKind): string {
return ';';
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/typescript/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export class TsVisitor<
.withBlock(this.buildEnumValuesBlock(enumName, node.values)).string;
}

protected getPunctuation(declarationKind: DeclarationKind): string {
protected getPunctuation(_declarationKind: DeclarationKind): string {
return ';';
}
}
2 changes: 1 addition & 1 deletion packages/utils/config-schema/src/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function generateDocs(schema: TJS.Definition, types: PluginConfig[]): Rec
return result;
}

function generateContentForSchema(schema: TJS.Definition, level = 3): string {
function generateContentForSchema(schema: TJS.Definition): string {
return Object.keys(schema.properties || {})
.map(propName => {
const prop = schema.properties[propName] as TJS.Definition;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7462,10 +7462,10 @@ eslint-config-prettier@6.15.0:
dependencies:
get-stdin "^6.0.0"

eslint-config-standard@14.1.1:
version "14.1.1"
resolved "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz#830a8e44e7aef7de67464979ad06b406026c56ea"
integrity sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==
eslint-config-standard@16.0.1:
version "16.0.1"
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.1.tgz#9a385eea27f96b7918cb53f07e01e9d10cc56401"
integrity sha512-WBBiQQZdaPyL+4sPkGWhWrHCDtvJoU195B9j8yXE9uFQnX34gMXI5CeBRm95gx3PMEZPM5OpwET10hH4F4SxCA==

eslint-import-resolver-node@^0.3.4:
version "0.3.4"
Expand Down

0 comments on commit c137957

Please sign in to comment.