diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8ae17513647..f958f089eef 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -3,10 +3,7 @@ module.exports = { extends: ['@theguild'], rules: { 'no-empty': 'off', - 'no-prototype-builtins': 'off', - 'no-useless-constructor': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-use-before-define': 'off', '@typescript-eslint/no-namespace': 'off', '@typescript-eslint/no-empty-interface': 'off', @@ -28,9 +25,9 @@ module.exports = { 'import/no-default-export': 'off', // todo: enable in v3 'unicorn/prefer-node-protocol': 'off', + 'prefer-object-has-own': 'off', }, env: { - es6: true, node: true, }, overrides: [ @@ -44,10 +41,15 @@ module.exports = { jest: true, }, rules: { - '@typescript-eslint/no-unused-vars': 'off', 'import/no-extraneous-dependencies': 'off', }, }, + { + files: '**/tests/fixtures/*.ts', + rules: { + '@typescript-eslint/no-unused-vars': 'off', + }, + }, ], ignorePatterns: ['dev-test', 'examples/front-end', 'website'], }; diff --git a/.gitignore b/.gitignore index fb3776c18ce..c56d0945fff 100644 --- a/.gitignore +++ b/.gitignore @@ -5,18 +5,18 @@ coverage *.log node_modules/ -temp +temp/ junit.xml dist/ .bob/ out.txt .cache tsconfig.tsbuildinfo -.yarn +.yarn/ recompile.sh .next/ -out +out/ website/public/sitemap.xml website/public/_redirects .eslintcache diff --git a/.prettierignore b/.prettierignore index 86a97e0db68..60fab5364ff 100644 --- a/.prettierignore +++ b/.prettierignore @@ -22,3 +22,4 @@ website/src/pages/plugins/presets/near-operation-file-preset.mdx examples/**/gql/** website/algolia-lockfile.json +temp/ diff --git a/package.json b/package.json index ce8d7962912..7d9e9ba4a3a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@graphql-typed-document-node/core": "3.1.1", "@reduxjs/toolkit": "1.8.5", "@tanstack/react-query": "4.2.3", - "@theguild/eslint-config": "0.4.2", + "@theguild/eslint-config": "0.5.0", "@theguild/prettier-config": "0.1.1", "@types/common-tags": "1.8.1", "@types/jest": "28.1.8", @@ -47,8 +47,6 @@ "@types/node": "18.11.18", "@types/react": "18.0.18", "@types/webpack-env": "1.18.0", - "@typescript-eslint/eslint-plugin": "5.36.2", - "@typescript-eslint/parser": "5.36.2", "@urql/exchange-graphcache": "5.0.5", "@vue/apollo-composable": "4.0.0-alpha.19", "@vue/composition-api": "1.7.0", @@ -59,13 +57,7 @@ "bob-the-bundler": "4.0.0", "chalk": "4.1.2", "dotenv": "16.0.2", - "eslint": "8.23.0", - "eslint-config-prettier": "8.5.0", - "eslint-config-standard": "17.0.0", - "eslint-plugin-import": "2.26.0", - "eslint-plugin-n": "15.2.5", - "eslint-plugin-promise": "6.0.1", - "eslint-plugin-react-hooks": "4.6.0", + "eslint": "8.31.0", "flow-bin": "0.186.0", "flow-parser": "0.186.0", "fs-extra": "10.1.0", diff --git a/packages/graphql-codegen-cli/src/codegen.ts b/packages/graphql-codegen-cli/src/codegen.ts index dee5d355c42..e150f05befe 100644 --- a/packages/graphql-codegen-cli/src/codegen.ts +++ b/packages/graphql-codegen-cli/src/codegen.ts @@ -82,8 +82,8 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom const cache = createCache(); function wrapTask(task: () => void | Promise, source: string, taskName: string, ctx: Ctx) { - return () => { - return context.profiler.run(async () => { + return () => + context.profiler.run(async () => { try { await Promise.resolve().then(() => task()); } catch (error) { @@ -95,7 +95,6 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom throw error; } }, taskName); - }; } async function normalize() { @@ -203,7 +202,7 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom return { title, - task: async (_, subTask) => { + async task(_, subTask) { let outputSchemaAst: GraphQLSchema; let outputSchema: DocumentNode; const outputFileTemplateConfig = outputConfig.config || {}; @@ -217,7 +216,7 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom : outputConfig.preset : null; - if (preset && preset.prepareDocuments) { + if (preset?.prepareDocuments) { outputSpecificDocuments = await preset.prepareDocuments(filename, outputSpecificDocuments); } @@ -314,7 +313,7 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom ...(typeof outputFileTemplateConfig === 'string' ? { value: outputFileTemplateConfig } : outputFileTemplateConfig), - emitLegacyCommonJSImports: shouldEmitLegacyCommonJSImports(config, filename), + emitLegacyCommonJSImports: shouldEmitLegacyCommonJSImports(config), }; const outputs: Types.GenerateOptions[] = preset @@ -400,7 +399,6 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom // All the errors throw in `listr2` are collected in context // Running tasks doesn't throw anything const executedContext = await tasks.run(); - if (config.debug) { // if we have debug logs, make sure to print them before throwing the errors printLogs(); diff --git a/packages/graphql-codegen-cli/src/config.ts b/packages/graphql-codegen-cli/src/config.ts index 32ab0f7b8c6..eaabf218ca4 100644 --- a/packages/graphql-codegen-cli/src/config.ts +++ b/packages/graphql-codegen-cli/src/config.ts @@ -121,9 +121,9 @@ export async function loadCodegenConfig({ packageProp, loaders: customLoaders, }: LoadCodegenConfigOptions): Promise { - configFilePath = configFilePath || process.cwd(); - moduleName = moduleName || 'codegen'; - packageProp = packageProp || moduleName; + configFilePath ||= process.cwd(); + moduleName ||= 'codegen'; + packageProp ||= moduleName; const cosmi = cosmiconfig(moduleName, { searchPlaces: generateSearchPlaces(moduleName).concat(additionalSearchPlaces || []), packageProp, @@ -145,9 +145,7 @@ export async function loadContext(configFilePath?: string): Promise { + coerce(watch: any) { if (watch === 'false') { return false; } @@ -489,7 +487,7 @@ function addHashToDocumentFiles(documentFilesPromise: Promise { diff --git a/packages/graphql-codegen-cli/src/presets.ts b/packages/graphql-codegen-cli/src/presets.ts index 478668ec202..f4d72e9f6f8 100644 --- a/packages/graphql-codegen-cli/src/presets.ts +++ b/packages/graphql-codegen-cli/src/presets.ts @@ -16,10 +16,10 @@ export async function getPresetByName( try { const loaded = await loader(moduleName); - if (loaded && loaded.preset) { + if (loaded?.preset) { return loaded.preset; } - if (loaded && loaded.default) { + if (loaded?.default) { return loaded.default; } diff --git a/packages/graphql-codegen-cli/src/utils/logger.ts b/packages/graphql-codegen-cli/src/utils/logger.ts index 30b79df9da6..1e241e83b78 100644 --- a/packages/graphql-codegen-cli/src/utils/logger.ts +++ b/packages/graphql-codegen-cli/src/utils/logger.ts @@ -17,7 +17,7 @@ export function setSilentLogger() { } export function useWinstonLogger() { - if (logger && logger.levels) { + if (logger?.levels) { return; } diff --git a/packages/graphql-codegen-cli/src/utils/watcher.ts b/packages/graphql-codegen-cli/src/utils/watcher.ts index 4b9204cf2c3..e3a01f1b26f 100644 --- a/packages/graphql-codegen-cli/src/utils/watcher.ts +++ b/packages/graphql-codegen-cli/src/utils/watcher.ts @@ -78,7 +78,7 @@ export const createWatcher = ( .map(filename => ({ filename, config: normalizeOutputParam(config.generates[filename]) })) .forEach(entry => { if (entry.config.preset) { - const extension = entry.config.presetConfig && entry.config.presetConfig.extension; + const extension = entry.config.presetConfig?.extension; if (extension) { ignored.push(join(entry.filename, '**', '*' + extension)); } diff --git a/packages/graphql-codegen-cli/tests/custom-loaders/custom-documents-loader.js b/packages/graphql-codegen-cli/tests/custom-loaders/custom-documents-loader.js index 3333d12d3cd..ed0844ab492 100644 --- a/packages/graphql-codegen-cli/tests/custom-loaders/custom-documents-loader.js +++ b/packages/graphql-codegen-cli/tests/custom-loaders/custom-documents-loader.js @@ -2,7 +2,7 @@ const { parse } = require('graphql'); const { readFileSync } = require('fs'); const { join } = require('path'); -module.exports = function (docString, config) { +module.exports = function (docString, _config) { global.CUSTOM_DOCUMENT_LOADER_CALLED = true; return parse(readFileSync(join(process.cwd(), docString), 'utf8')); diff --git a/packages/graphql-codegen-cli/tests/custom-loaders/custom-schema-loader.js b/packages/graphql-codegen-cli/tests/custom-loaders/custom-schema-loader.js index ae0de320325..346508f3519 100644 --- a/packages/graphql-codegen-cli/tests/custom-loaders/custom-schema-loader.js +++ b/packages/graphql-codegen-cli/tests/custom-loaders/custom-schema-loader.js @@ -2,7 +2,7 @@ const { buildSchema } = require('graphql'); const { readFileSync } = require('fs'); const { join } = require('path'); -module.exports = function (schemaString, config) { +module.exports = function (schemaString, _config) { global.CUSTOM_SCHEMA_LOADER_CALLED = true; return buildSchema(readFileSync(join(process.cwd(), schemaString), 'utf8')); diff --git a/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-documents-loader.js b/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-documents-loader.js index 0ec376814e3..95ac6a78c95 100644 --- a/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-documents-loader.js +++ b/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-documents-loader.js @@ -1,3 +1,3 @@ -module.exports = function (schemaString, config) { +module.exports = function (schemaString, _config) { return schemaString; }; diff --git a/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-schema-loader.js b/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-schema-loader.js index 0ec376814e3..95ac6a78c95 100644 --- a/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-schema-loader.js +++ b/packages/graphql-codegen-cli/tests/custom-loaders/invalid-return-value-schema-loader.js @@ -1,3 +1,3 @@ -module.exports = function (schemaString, config) { +module.exports = function (schemaString, _config) { return schemaString; }; diff --git a/packages/graphql-codegen-cli/tests/custom-plugins/basic.js b/packages/graphql-codegen-cli/tests/custom-plugins/basic.js index 3b273404f82..6c3f5177940 100644 --- a/packages/graphql-codegen-cli/tests/custom-plugins/basic.js +++ b/packages/graphql-codegen-cli/tests/custom-plugins/basic.js @@ -1,5 +1,5 @@ module.exports = { - plugin: (schema, documents, config) => { + plugin(_schema, _documents, _config) { return 'plugin'; }, }; diff --git a/packages/graphql-codegen-cli/tests/custom-plugins/checks-extended-schema.js b/packages/graphql-codegen-cli/tests/custom-plugins/checks-extended-schema.js index b5f44be787e..6fe79609843 100644 --- a/packages/graphql-codegen-cli/tests/custom-plugins/checks-extended-schema.js +++ b/packages/graphql-codegen-cli/tests/custom-plugins/checks-extended-schema.js @@ -1,5 +1,5 @@ module.exports = { - plugin: (schema, documents, config) => { + plugin(schema, _documents, _config) { return ` Should have the Extension type: '${schema.getType('Extension')}' `; diff --git a/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema-fn.js b/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema-fn.js index e8e4ed20bd5..378114c82c5 100644 --- a/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema-fn.js +++ b/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema-fn.js @@ -1,5 +1,5 @@ module.exports = { - plugin: (schema, documents, config) => { + plugin(schema, _documents, _config) { return Object.keys(schema.getTypeMap()).join(', '); }, addToSchema: c => `type ${c.test} { f: String }`, diff --git a/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema.js b/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema.js index a63308bf995..a0faad276de 100644 --- a/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema.js +++ b/packages/graphql-codegen-cli/tests/custom-plugins/extends-schema.js @@ -1,5 +1,5 @@ module.exports = { - plugin: (schema, documents, config) => { + plugin(schema, _documents, _config) { return Object.keys(schema.getTypeMap()).join(','); }, addToSchema: `type Extension { f: String }`, diff --git a/packages/graphql-codegen-cli/tests/custom-plugins/validation.js b/packages/graphql-codegen-cli/tests/custom-plugins/validation.js index 32b5325e232..c6bc1fa5924 100644 --- a/packages/graphql-codegen-cli/tests/custom-plugins/validation.js +++ b/packages/graphql-codegen-cli/tests/custom-plugins/validation.js @@ -1,8 +1,8 @@ module.exports = { - plugin: (schema, documents, config) => { + plugin(_schema, _documents, _config) { return 'plugin'; }, - validate: () => { + validate() { throw new Error('Invalid!'); }, }; diff --git a/packages/graphql-codegen-cli/tests/test-files/16.ts b/packages/graphql-codegen-cli/tests/test-files/16.ts index d416bdcbd70..8f788387eb6 100644 --- a/packages/graphql-codegen-cli/tests/test-files/16.ts +++ b/packages/graphql-codegen-cli/tests/test-files/16.ts @@ -1,4 +1,2 @@ const other = 'asd'; export const endpoint = `${other}/graphql`; - -const anotherVariable = `asdfasdf`; diff --git a/packages/graphql-codegen-core/src/codegen.ts b/packages/graphql-codegen-core/src/codegen.ts index 761b9e41e6c..e7a86967d34 100644 --- a/packages/graphql-codegen-core/src/codegen.ts +++ b/packages/graphql-codegen-core/src/codegen.ts @@ -236,15 +236,11 @@ function validateDuplicateDocuments(files: Types.DocumentFile[]) { deduplicatedDefinitions: Set ) { if (typeof node.name !== 'undefined') { - if (!definitionMap[node.kind]) { - definitionMap[node.kind] = {}; - } - if (!definitionMap[node.kind][node.name.value]) { - definitionMap[node.kind][node.name.value] = { - paths: new Set(), - contents: new Set(), - }; - } + definitionMap[node.kind] ||= {}; + definitionMap[node.kind][node.name.value] ||= { + paths: new Set(), + contents: new Set(), + }; const definitionKindMap = definitionMap[node.kind]; diff --git a/packages/graphql-codegen-core/src/execute-plugin.ts b/packages/graphql-codegen-core/src/execute-plugin.ts index 56ab11be1df..72453e21210 100644 --- a/packages/graphql-codegen-core/src/execute-plugin.ts +++ b/packages/graphql-codegen-core/src/execute-plugin.ts @@ -16,7 +16,7 @@ export interface ExecutePluginOptions { } export async function executePlugin(options: ExecutePluginOptions, plugin: CodegenPlugin): Promise { - if (!plugin || !plugin.plugin || typeof plugin.plugin !== 'function') { + if (!plugin?.plugin || typeof plugin.plugin !== 'function') { throw new Error( `Invalid Custom Plugin "${options.name}" \n Plugin ${options.name} does not export a valid JS object with "plugin" function. diff --git a/packages/graphql-codegen-core/src/utils.ts b/packages/graphql-codegen-core/src/utils.ts index f193ddb4a60..b77dac82fa0 100644 --- a/packages/graphql-codegen-core/src/utils.ts +++ b/packages/graphql-codegen-core/src/utils.ts @@ -78,9 +78,7 @@ export function hasFederationSpec(schemaOrAST: GraphQLSchema | DocumentNode) { } export function extractHashFromSchema(schema: GraphQLSchema): string | null { - if (!schema.extensions) { - schema.extensions = {}; - } + schema.extensions ||= {}; return (schema.extensions['hash'] as string) ?? null; } diff --git a/packages/plugins/other/visitor-plugin-common/src/base-documents-visitor.ts b/packages/plugins/other/visitor-plugin-common/src/base-documents-visitor.ts index fa8faa41306..4473763154b 100644 --- a/packages/plugins/other/visitor-plugin-common/src/base-documents-visitor.ts +++ b/packages/plugins/other/visitor-plugin-common/src/base-documents-visitor.ts @@ -214,7 +214,7 @@ export class BaseDocumentsVisitor< } private handleAnonymousOperation(node: OperationDefinitionNode): string { - const name = node.name && node.name.value; + const name = node.name?.value; if (name) { return this.convertName(name, { diff --git a/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts b/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts index 32f4f3fdaab..b263829b36a 100644 --- a/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts +++ b/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts @@ -717,7 +717,7 @@ export class BaseResolversVisitor< const isRootType = this._rootTypeNames.has(typeName); const isMapped = this.config.mappers[typeName]; const isScalar = this.config.scalars[typeName]; - const hasDefaultMapper = Boolean(this.config.defaultMapper && this.config.defaultMapper.type); + const hasDefaultMapper = Boolean(this.config.defaultMapper?.type); if (isRootType) { prev[typeName] = applyWrapper(this.config.rootValueType.type); @@ -969,9 +969,7 @@ export class BaseResolversVisitor< const addMapper = (source: string, identifier: string, asDefault: boolean) => { if (!this.isMapperImported(groupedMappers, identifier, source)) { - if (!groupedMappers[source]) { - groupedMappers[source] = []; - } + groupedMappers[source] ||= []; groupedMappers[source].push({ identifier, asDefault }); } @@ -994,7 +992,7 @@ export class BaseResolversVisitor< addMapper(this.config.rootValueType.source, this.config.rootValueType.import, this.config.rootValueType.default); } - if (this.config.defaultMapper && this.config.defaultMapper.isExternal) { + if (this.config.defaultMapper?.isExternal) { const identifier = stripMapperTypeInterpolation(this.config.defaultMapper.import); addMapper(this.config.defaultMapper.source, identifier, this.config.defaultMapper.default); } @@ -1426,7 +1424,7 @@ export class BaseResolversVisitor< const name = this.convertName(node, { suffix: this.config.resolverTypeSuffix }); this._collectedResolvers[rawTypeName] = name; - const hasExplicitValues = this.config.enumValues[rawTypeName] && this.config.enumValues[rawTypeName].mappedValues; + const hasExplicitValues = this.config.enumValues[rawTypeName]?.mappedValues; return new DeclarationBlock(this._declarationBlockConfig) .export() diff --git a/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts b/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts index bb4a268ab56..eb42a66fbea 100644 --- a/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts +++ b/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts @@ -561,8 +561,7 @@ export class BaseTypesVisitor< const allScalars = Object.keys(this.config.scalars).map(scalarName => { const scalarValue = this.config.scalars[scalarName].type; const scalarType = this._schema.getType(scalarName); - const comment = - scalarType && scalarType.astNode && scalarType.description ? transformComment(scalarType.description, 1) : ''; + const comment = scalarType?.astNode && scalarType.description ? transformComment(scalarType.description, 1) : ''; const { scalar } = this._parsedConfig.declarationKind; return comment + indent(`${scalarName}: ${scalarValue}${this.getPunctuation(scalar)}`); @@ -837,7 +836,7 @@ export class BaseTypesVisitor< const enumName = node.name as any as string; // In case of mapped external enum string - if (this.config.enumValues[enumName] && this.config.enumValues[enumName].sourceFile) { + if (this.config.enumValues[enumName]?.sourceFile) { return null; } @@ -883,8 +882,7 @@ export class BaseTypesVisitor< typeof schemaEnumValue !== 'undefined' ? schemaEnumValue : (enumOption.name as any); if ( - this.config.enumValues[typeName] && - this.config.enumValues[typeName].mappedValues && + this.config.enumValues[typeName]?.mappedValues && typeof this.config.enumValues[typeName].mappedValues[enumValue] !== 'undefined' ) { enumValue = this.config.enumValues[typeName].mappedValues[enumValue]; @@ -1001,7 +999,7 @@ export class BaseTypesVisitor< return typeToUse; } - ListType(node: ListTypeNode, key, parent, path, ancestors): string { + ListType(node: ListTypeNode, _key, _parent, _path, _ancestors): string { const asString = node.type as any as string; return this.wrapWithListType(asString); diff --git a/packages/plugins/other/visitor-plugin-common/src/base-visitor.ts b/packages/plugins/other/visitor-plugin-common/src/base-visitor.ts index a108d4626e5..d1d6f778cbd 100644 --- a/packages/plugins/other/visitor-plugin-common/src/base-visitor.ts +++ b/packages/plugins/other/visitor-plugin-common/src/base-visitor.ts @@ -412,8 +412,8 @@ export class BaseVisitor string { if (!config.namingConvention) { return (str: string, opts: ConvertOptions = {}) => { - return convertNameParts(str, pascalCase, getConfigValue((opts || {}).transformUnderscore, false)); + return convertNameParts(str, pascalCase, getConfigValue(opts?.transformUnderscore, false)); }; } @@ -77,7 +77,7 @@ export function convertFactory(config: { namingConvention?: NamingConvention }): return convertNameParts( str, resolveExternalModuleAndFn(config.namingConvention), - getConfigValue((opts || {}).transformUnderscore, false) + getConfigValue(opts?.transformUnderscore, false) ); }; } @@ -87,7 +87,7 @@ export function convertFactory(config: { namingConvention?: NamingConvention }): return convertNameParts( str, config.namingConvention as (str: string) => string, - getConfigValue((opts || {}).transformUnderscore, false) + getConfigValue(opts?.transformUnderscore, false) ); }; } @@ -100,7 +100,7 @@ export function convertFactory(config: { namingConvention?: NamingConvention }): if (!config.namingConvention[type]) { return (str: string, opts: ConvertOptions = {}) => { const transformUnderscore = - (config.namingConvention as NamingConventionMap).transformUnderscore || (opts || {}).transformUnderscore; + (config.namingConvention as NamingConventionMap).transformUnderscore || opts?.transformUnderscore; return convertNameParts(str, pascalCase, getConfigValue(transformUnderscore, false)); }; } @@ -109,7 +109,7 @@ export function convertFactory(config: { namingConvention?: NamingConvention }): return convertNameParts( str, resolveExternalModuleAndFn(config.namingConvention[type]), - getConfigValue((opts || {}).transformUnderscore, true) + getConfigValue(opts?.transformUnderscore, true) ); }; } @@ -118,8 +118,8 @@ export function convertFactory(config: { namingConvention?: NamingConvention }): } return (node, opts) => { - const prefix = opts && opts.prefix; - const suffix = opts && opts.suffix; + const prefix = opts?.prefix; + const suffix = opts?.suffix; const kind = getKind(node); const str = [prefix || '', getName(node), suffix || ''].join(''); diff --git a/packages/plugins/other/visitor-plugin-common/src/selection-set-to-object.ts b/packages/plugins/other/visitor-plugin-common/src/selection-set-to-object.ts index cefc2aec0d3..d3059f2e52c 100644 --- a/packages/plugins/other/visitor-plugin-common/src/selection-set-to-object.ts +++ b/packages/plugins/other/visitor-plugin-common/src/selection-set-to-object.ts @@ -230,9 +230,7 @@ export class SelectionSetToObject; mustAddEmptyObject: boolean } { - if (!this._selectionSet || !this._selectionSet.selections || this._selectionSet.selections.length === 0) { + if (!this._selectionSet?.selections || this._selectionSet.selections.length === 0) { return { grouped: {}, mustAddEmptyObject: true }; } @@ -326,9 +324,7 @@ export class SelectionSetToObject { if ( - this.config.enumValues[enumName] && - this.config.enumValues[enumName].mappedValues && + this.config.enumValues[enumName]?.mappedValues && typeof this.config.enumValues[enumName].mappedValues[enumValue] !== 'undefined' ) { return this.config.enumValues[enumName].mappedValues[enumValue]; diff --git a/packages/presets/graphql-modules/src/builder.ts b/packages/presets/graphql-modules/src/builder.ts index cc34221f6a7..317cad52369 100644 --- a/packages/presets/graphql-modules/src/builder.ts +++ b/packages/presets/graphql-modules/src/builder.ts @@ -249,7 +249,7 @@ export function buildModule( for (const kind in registry) { const k = kind as RegistryKeys; - if (registry.hasOwnProperty(k) && resolverKeys.includes(k as any)) { + if (Object.prototype.hasOwnProperty.call(registry, k) && resolverKeys.includes(k as any)) { const types = registry[k]; types.forEach(typeName => { @@ -283,7 +283,7 @@ export function buildModule( // Type.Field for (const typeName in picks.objects) { - if (picks.objects.hasOwnProperty(typeName)) { + if (Object.prototype.hasOwnProperty.call(picks.objects, typeName)) { const fields = picks.objects[typeName]; const lines = [wildcardField].concat(fields.map(field => printResolveMiddlewareRecord(field))); @@ -378,9 +378,7 @@ export function buildModule( const name = node.name.value; if (node.fields) { - if (!picksObj[name]) { - picksObj[name] = []; - } + picksObj[name] ||= []; node.fields.forEach(field => { picksObj[name].push(field.name.value); @@ -392,9 +390,7 @@ export function buildModule( const name = node.name.value; if (node.values) { - if (!picks.enums[name]) { - picks.enums[name] = []; - } + picks.enums[name] ||= []; node.values.forEach(field => { picks.enums[name].push(field.name.value); diff --git a/packages/presets/graphql-modules/src/index.ts b/packages/presets/graphql-modules/src/index.ts index 10c2bcc986f..21cd7671c95 100644 --- a/packages/presets/graphql-modules/src/index.ts +++ b/packages/presets/graphql-modules/src/index.ts @@ -23,7 +23,7 @@ export const preset: Types.OutputPreset = { ); } - if (!options.schemaAst || !options.schemaAst.extensions.sources) { + if (!options.schemaAst?.extensions.sources) { throw new Error(`Preset "graphql-modules" requires to use GraphQL SDL`); } diff --git a/packages/presets/graphql-modules/src/utils.ts b/packages/presets/graphql-modules/src/utils.ts index 9e54542ba12..f18f7abf594 100644 --- a/packages/presets/graphql-modules/src/utils.ts +++ b/packages/presets/graphql-modules/src/utils.ts @@ -153,9 +153,7 @@ export function groupSourcesByModule(sources: Source[], basePath: string): Recor // PERF: we could guess the module by matching source.location with a list of already resolved paths const mod = extractModuleDirectory(source.location, basePath); - if (!grouped[mod]) { - grouped[mod] = []; - } + grouped[mod] ||= []; grouped[mod].push(source); } diff --git a/packages/presets/graphql-modules/tests/integration.spec.ts b/packages/presets/graphql-modules/tests/integration.spec.ts index 21c42a305fb..55a8d66ed56 100644 --- a/packages/presets/graphql-modules/tests/integration.spec.ts +++ b/packages/presets/graphql-modules/tests/integration.spec.ts @@ -33,35 +33,23 @@ describe('Integration', () => { // In this test, we make sure executeCodegen passes on a list of Sources as an extension // This is very important test('should generate a base output and 4 for modules', async () => { - try { - const output = await executeCodegen(options); - - expect(output.length).toBe(5); - expect(normalize(output[0].filename)).toMatch(normalize(`/modules/global-types.ts`)); - expect(normalize(output[1].filename)).toMatch(normalize(`/modules/blog/module-types.ts`)); - expect(normalize(output[2].filename)).toMatch(normalize(`/modules/common/module-types.ts`)); - expect(normalize(output[3].filename)).toMatch(normalize(`/modules/dotanions/module-types.ts`)); - expect(normalize(output[4].filename)).toMatch(normalize(`/modules/users/module-types.ts`)); - } catch (e) { - // eslint-disable-next-line no-console - console.error(e); - throw e; - } + const output = await executeCodegen(options); + + expect(output.length).toBe(5); + expect(normalize(output[0].filename)).toMatch(normalize(`/modules/global-types.ts`)); + expect(normalize(output[1].filename)).toMatch(normalize(`/modules/blog/module-types.ts`)); + expect(normalize(output[2].filename)).toMatch(normalize(`/modules/common/module-types.ts`)); + expect(normalize(output[3].filename)).toMatch(normalize(`/modules/dotanions/module-types.ts`)); + expect(normalize(output[4].filename)).toMatch(normalize(`/modules/users/module-types.ts`)); }); test('should not duplicate type even if type and extend type are in the same module', async () => { - try { - const output = await executeCodegen(options); + const output = await executeCodegen(options); - const userResolversStr = `export type UserResolvers = Pick;`; - const nbOfTimeUserResolverFound = output[4].content.split(userResolversStr).length - 1; + const userResolversStr = `export type UserResolvers = Pick;`; + const nbOfTimeUserResolverFound = output[4].content.split(userResolversStr).length - 1; - expect(nbOfTimeUserResolverFound).toBe(1); - } catch (e) { - // eslint-disable-next-line no-console - console.error(e); - throw e; - } + expect(nbOfTimeUserResolverFound).toBe(1); }); test('should allow to override importBaseTypesFrom correctly', async () => { diff --git a/packages/utils/graphql-codegen-testing/src/index.ts b/packages/utils/graphql-codegen-testing/src/index.ts index 5b642e852d0..77674da8765 100644 --- a/packages/utils/graphql-codegen-testing/src/index.ts +++ b/packages/utils/graphql-codegen-testing/src/index.ts @@ -6,7 +6,7 @@ import { diff } from 'jest-diff'; declare global { namespace jest { - interface Matchers { + interface Matchers { /** * Normalizes whitespace and performs string comparisons */ @@ -37,7 +37,7 @@ expect.extend({ const diffString = diff(stripIndent`${expected}`, stripIndent`${received}`, { expand: this.expand, }); - const hasExpect = diffString && diffString.includes('- Expect'); + const hasExpect = diffString?.includes('- Expect'); const message = hasExpect ? `Difference:\n\n${diffString}` diff --git a/packages/utils/plugins-helpers/src/federation.ts b/packages/utils/plugins-helpers/src/federation.ts index 6381fc44061..00f69b13cb3 100644 --- a/packages/utils/plugins-helpers/src/federation.ts +++ b/packages/utils/plugins-helpers/src/federation.ts @@ -203,7 +203,7 @@ export class ApolloFederation { private hasProvides(objectType: ObjectTypeDefinitionNode | GraphQLObjectType, node: FieldDefinitionNode): boolean { const fields = this.providesMap[isObjectType(objectType) ? objectType.name : objectType.name.value]; - if (fields && fields.length) { + if (fields?.length) { return fields.includes(node.name.value); } @@ -271,9 +271,7 @@ export class ApolloFederation { .reduce((prev, curr) => [...prev, ...curr], []); const ofType = getBaseType(field.type); - if (!providesMap[ofType.name]) { - providesMap[ofType.name] = []; - } + providesMap[ofType.name] ||= []; providesMap[ofType.name].push(...provides); }); diff --git a/packages/utils/plugins-helpers/src/oldVisit.ts b/packages/utils/plugins-helpers/src/oldVisit.ts index 93562cc70a3..97384956580 100644 --- a/packages/utils/plugins-helpers/src/oldVisit.ts +++ b/packages/utils/plugins-helpers/src/oldVisit.ts @@ -13,13 +13,13 @@ export function oldVisit( ): any { if (typeof enterVisitors === 'object') { for (const key in enterVisitors) { - newVisitor[key] = newVisitor[key] || {}; + newVisitor[key] ||= {}; newVisitor[key].enter = enterVisitors[key]; } } if (typeof leaveVisitors === 'object') { for (const key in leaveVisitors) { - newVisitor[key] = newVisitor[key] || {}; + newVisitor[key] ||= {}; newVisitor[key].leave = leaveVisitors[key]; } } diff --git a/packages/utils/plugins-helpers/src/types.ts b/packages/utils/plugins-helpers/src/types.ts index dd4e1ff755a..1b8e38741ce 100644 --- a/packages/utils/plugins-helpers/src/types.ts +++ b/packages/utils/plugins-helpers/src/types.ts @@ -613,7 +613,7 @@ export namespace Types { } export function isComplexPluginOutput(obj: Types.PluginOutput): obj is Types.ComplexPluginOutput { - return typeof obj === 'object' && obj.hasOwnProperty('content'); + return typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, 'content'); } export type PluginFunction = ( diff --git a/scripts/examples-front-end-upgrade-codegen.js b/scripts/examples-front-end-upgrade-codegen.js index b8168e848a6..a735498e448 100644 --- a/scripts/examples-front-end-upgrade-codegen.js +++ b/scripts/examples-front-end-upgrade-codegen.js @@ -1,7 +1,4 @@ /* eslint-disable no-console */ -const { writeFileSync } = require('node:fs'); -const { resolve } = require('node:path'); -const { argv, cwd } = require('node:process'); const { exec } = require('node:child_process'); // Usage: node ./scripts/examples-front-end-upgrade-codegen.js 2.12.0-alpha-20220830143058-6693f3074 1.0.1-alpha-20220830093424-2a4853976 @@ -10,8 +7,7 @@ const { exec } = require('node:child_process'); // eslint-disable-next-line import/no-extraneous-dependencies const { globby } = await import('globby'); - const codegenCLIversion = argv[2]; - const clientPresetVersion = argv[3]; + const [, , codegenCLIversion, clientPresetVersion] = process.argv; globby('./examples/front-end/**/package.json', { ignore: ['./examples/front-end/**/node_modules/**', './examples/front-end/**/dist/**'], diff --git a/scripts/match-graphql.js b/scripts/match-graphql.js index 29e5e2e8376..eb8c2922b8f 100644 --- a/scripts/match-graphql.js +++ b/scripts/match-graphql.js @@ -8,6 +8,7 @@ const pkg = require(pkgPath); const version = argv[2]; +// eslint-disable-next-line logical-assignment-operators -- can be removed after drop support of Node.js 12 pkg.resolutions = pkg.resolutions || {}; if (pkg.resolutions.graphql.startsWith(version)) { // eslint-disable-next-line no-console diff --git a/yarn.lock b/yarn.lock index c8bef8a7461..e95f40e2edb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1649,15 +1649,15 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint/eslintrc@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" - integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== +"@eslint/eslintrc@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" + integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== dependencies: ajv "^6.12.4" debug "^4.3.2" espree "^9.4.0" - globals "^13.15.0" + globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" @@ -2569,19 +2569,14 @@ dependencies: client-only "^0.0.1" -"@humanwhocodes/config-array@^0.10.4": - version "0.10.4" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" - integrity sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw== +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" - minimatch "^3.0.4" - -"@humanwhocodes/gitignore-to-minimatch@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" - integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== + minimatch "^3.0.5" "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" @@ -3090,7 +3085,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -3510,10 +3505,10 @@ unist-util-visit "4.1.1" use-debounce "9.0.2" -"@theguild/eslint-config@0.4.2": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@theguild/eslint-config/-/eslint-config-0.4.2.tgz#516fe1e80e3d8e6aef51974803dce05fb1f0b06e" - integrity sha512-vlddJaprW6lfb0dJWu22mEcYNKvOXv/YZRPFuCmTKWVHqmwZZUwBkkAbrvP1am1VP4Jrg4pm/p1SZyRBD0ttlQ== +"@theguild/eslint-config@0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@theguild/eslint-config/-/eslint-config-0.5.0.tgz#990c32aa95fcd74e6602daba986faaa19caec2e4" + integrity sha512-aSiN3Eg6lH5Uq0LjHRt764trs3uYHMsvr2UDRA6/RK/ThPHMvBwnfi1xI7vdwXabE9vSZosnlJ/e/skj43FnKQ== dependencies: "@rushstack/eslint-patch" "^1.2.0" "@typescript-eslint/eslint-plugin" "^5.45.1" @@ -4031,21 +4026,6 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.3.tgz#781d360c282436494b32fe7d9f7f8e64b3118aa3" integrity sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw== -"@typescript-eslint/eslint-plugin@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.2.tgz#6df092a20e0f9ec748b27f293a12cb39d0c1fe4d" - integrity sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw== - dependencies: - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/type-utils" "5.36.2" - "@typescript-eslint/utils" "5.36.2" - debug "^4.3.4" - functional-red-black-tree "^1.0.1" - ignore "^5.2.0" - regexpp "^3.2.0" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/eslint-plugin@^5.45.1": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz#54f8368d080eb384a455f60c2ee044e948a8ce67" @@ -4061,16 +4041,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.36.2.tgz#3ddf323d3ac85a25295a55fcb9c7a49ab4680ddd" - integrity sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA== - dependencies: - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/typescript-estree" "5.36.2" - debug "^4.3.4" - "@typescript-eslint/parser@^5.45.1": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.48.0.tgz#02803355b23884a83e543755349809a50b7ed9ba" @@ -4081,14 +4051,6 @@ "@typescript-eslint/typescript-estree" "5.48.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.36.2.tgz#a75eb588a3879ae659514780831370642505d1cd" - integrity sha512-cNNP51L8SkIFSfce8B1NSUBTJTu2Ts4nWeWbFrdaqjmn9yKrAaJUBHkyTZc0cL06OFHpb+JZq5AUHROS398Orw== - dependencies: - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/visitor-keys" "5.36.2" - "@typescript-eslint/scope-manager@5.48.0": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz#607731cb0957fbc52fd754fd79507d1b6659cecf" @@ -4097,16 +4059,6 @@ "@typescript-eslint/types" "5.48.0" "@typescript-eslint/visitor-keys" "5.48.0" -"@typescript-eslint/type-utils@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.2.tgz#752373f4babf05e993adf2cd543a763632826391" - integrity sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw== - dependencies: - "@typescript-eslint/typescript-estree" "5.36.2" - "@typescript-eslint/utils" "5.36.2" - debug "^4.3.4" - tsutils "^3.21.0" - "@typescript-eslint/type-utils@5.48.0": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz#40496dccfdc2daa14a565f8be80ad1ae3882d6d6" @@ -4117,29 +4069,11 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.2.tgz#a5066e500ebcfcee36694186ccc57b955c05faf9" - integrity sha512-9OJSvvwuF1L5eS2EQgFUbECb99F0mwq501w0H0EkYULkhFa19Qq7WFbycdw1PexAc929asupbZcgjVIe6OK/XQ== - "@typescript-eslint/types@5.48.0": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.48.0.tgz#d725da8dfcff320aab2ac6f65c97b0df30058449" integrity sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw== -"@typescript-eslint/typescript-estree@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.2.tgz#0c93418b36c53ba0bc34c61fe9405c4d1d8fe560" - integrity sha512-8fyH+RfbKc0mTspfuEjlfqA4YywcwQK2Amcf6TDOwaRLg7Vwdu4bZzyvBZp4bjt1RRjQ5MDnOZahxMrt2l5v9w== - dependencies: - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/visitor-keys" "5.36.2" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.48.0": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz#a7f04bccb001003405bb5452d43953a382c2fac2" @@ -4153,18 +4087,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.2.tgz#b01a76f0ab244404c7aefc340c5015d5ce6da74c" - integrity sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/typescript-estree" "5.36.2" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/utils@5.48.0": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.48.0.tgz#eee926af2733f7156ad8d15e51791e42ce300273" @@ -4179,14 +4101,6 @@ eslint-utils "^3.0.0" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.2.tgz#2f8f78da0a3bad3320d2ac24965791ac39dace5a" - integrity sha512-BtRvSR6dEdrNt7Net2/XDjbYKU5Ml6GqJgVfXT0CxTCJlnIqK7rAGreuWKMT2t8cFUT2Msv5oxw0GMRD7T5J7A== - dependencies: - "@typescript-eslint/types" "5.36.2" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.48.0": version "5.48.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz#4446d5e7f6cadde7140390c0e284c8702d944904" @@ -7136,21 +7050,11 @@ escodegen@^1.8.1: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" - integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== - eslint-config-prettier@^8.5.0: version "8.6.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207" integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA== -eslint-config-standard@17.0.0: - version "17.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz#fd5b6cf1dcf6ba8d29f200c461de2e19069888cf" - integrity sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg== - eslint-import-resolver-node@^0.3.6: version "0.3.6" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" @@ -7195,7 +7099,7 @@ eslint-plugin-es@^4.1.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-import@2.26.0, eslint-plugin-import@^2.26.0: +eslint-plugin-import@^2.26.0: version "2.26.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== @@ -7263,20 +7167,6 @@ eslint-plugin-mdx@^2.0.5: unified "^10.1.2" vfile "^5.3.4" -eslint-plugin-n@15.2.5: - version "15.2.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-15.2.5.tgz#aa7ff8d45bb8bf2df8ea3b7d3774ae570cb794b8" - integrity sha512-8+BYsqiyZfpu6NXmdLOXVUfk8IocpCjpd8nMRRH0A9ulrcemhb2VI9RSJMEy5udx++A/YcVPD11zT8hpFq368g== - dependencies: - builtins "^5.0.1" - eslint-plugin-es "^4.1.0" - eslint-utils "^3.0.0" - ignore "^5.1.1" - is-core-module "^2.10.0" - minimatch "^3.1.2" - resolve "^1.22.1" - semver "^7.3.7" - eslint-plugin-n@^15.6.0: version "15.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-15.6.0.tgz#cfb1d2e2e427d620eb9008f8b3b5a40de0c84120" @@ -7291,17 +7181,12 @@ eslint-plugin-n@^15.6.0: resolve "^1.22.1" semver "^7.3.8" -eslint-plugin-promise@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.0.1.tgz#a8cddf96a67c4059bdabf4d724a29572188ae423" - integrity sha512-uM4Tgo5u3UWQiroOyDEsYcVMOo7re3zmno0IZmB5auxoaQNIceAbXEkSt8RNrKtaYehARHG06pYK6K1JhtP0Zw== - eslint-plugin-promise@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz#269a3e2772f62875661220631bd4dafcb4083816" integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig== -eslint-plugin-react-hooks@4.6.0, eslint-plugin-react-hooks@^4.6.0: +eslint-plugin-react-hooks@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== @@ -7414,15 +7299,15 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@8.23.0: - version "8.23.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" - integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== +eslint@8.31.0: + version "8.31.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.31.0.tgz#75028e77cbcff102a9feae1d718135931532d524" + integrity sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA== dependencies: - "@eslint/eslintrc" "^1.3.1" - "@humanwhocodes/config-array" "^0.10.4" - "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" + "@eslint/eslintrc" "^1.4.1" + "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -7438,15 +7323,15 @@ eslint@8.23.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" find-up "^5.0.0" - functional-red-black-tree "^1.0.1" - glob-parent "^6.0.1" - globals "^13.15.0" - globby "^11.1.0" + glob-parent "^6.0.2" + globals "^13.19.0" grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -8027,11 +7912,6 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== - functions-have-names@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" @@ -8123,7 +8003,7 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.1, glob-parent@^6.0.2: +glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== @@ -8170,10 +8050,10 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.15.0: - version "13.15.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" - integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== +globals@^13.19.0: + version "13.19.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" + integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ== dependencies: type-fest "^0.20.2" @@ -8767,7 +8647,7 @@ is-ci@^3.0.1: dependencies: ci-info "^3.2.0" -is-core-module@^2.10.0, is-core-module@^2.11.0, is-core-module@^2.8.1, is-core-module@^2.9.0: +is-core-module@^2.11.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.11.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== @@ -8879,6 +8759,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -9460,6 +9345,11 @@ joycon@^3.0.1: resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== +js-sdsl@^4.1.4: + version "4.2.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0" + integrity sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -10697,7 +10587,7 @@ minimatch@4.2.1: dependencies: brace-expansion "^1.1.7" -minimatch@^3.0.4, minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==