Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_cli-10692-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/cli": patch
---
dependencies updates:
- Updated dependency [`yargs@^18.0.0` ↗︎](https://www.npmjs.com/package/yargs/v/18.0.0) (from `^17.0.0`, in `dependencies`)
80 changes: 0 additions & 80 deletions .eslintrc.cjs

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
lint:
name: Linting Check
uses: the-guild-org/shared-config/.github/workflows/lint.yml@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/.github/workflows/lint.yml@bcb53d910698d29749511f386139ad8180269101 # main
with:
script: yarn ci:lint
secrets:
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Checkout Master
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup env
uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main
- name: Prettier Check
run: yarn prettier:check
dev-tests-old:
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup env
uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main
- name: Build
run: yarn build
env:
Expand All @@ -62,7 +62,7 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup env
uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main
- name: Build
run: yarn build
env:
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup env
uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main
- name: Build
run: yarn build
env:
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup env
uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main
with:
nodeVersion: ${{matrix.node_version}}
- name: Use GraphQL v${{matrix.graphql_version}}
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup env
uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main
with:
nodeVersion: ${{matrix.node_version}}
- name: Use GraphQL v${{matrix.graphql_version}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ permissions:

jobs:
dependencies:
uses: the-guild-org/shared-config/.github/workflows/changesets-dependencies.yaml@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/.github/workflows/changesets-dependencies.yaml@bcb53d910698d29749511f386139ad8180269101 # main
if: ${{ github.event.pull_request.title != 'Upcoming Release Changes' }}
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}

alpha:
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@bcb53d910698d29749511f386139ad8180269101 # main
if: ${{ github.event.pull_request.title != 'Upcoming Release Changes' }}
with:
npmTag: alpha
Expand All @@ -31,7 +31,7 @@ jobs:
npmToken: ${{ secrets.NPM_TOKEN }}

release-candidate:
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@bcb53d910698d29749511f386139ad8180269101 # main
if: ${{ github.event.pull_request.title == 'Upcoming Release Changes' }}
with:
npmTag: rc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:

jobs:
stable:
uses: the-guild-org/shared-config/.github/workflows/release-stable.yml@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/.github/workflows/release-stable.yml@bcb53d910698d29749511f386139ad8180269101 # main
with:
releaseScript: release
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: git fetch origin master

- name: Setup env
uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main

- name: Build Packages
run: yarn build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
with:
fetch-depth: 0

- uses: the-guild-org/shared-config/setup@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
- uses: the-guild-org/shared-config/setup@bcb53d910698d29749511f386139ad8180269101 # main
name: setup env

- uses: the-guild-org/shared-config/website-cf@efca92ebf0309a89e2e1bb69b1f52115ff8ee7d6 # main
- uses: the-guild-org/shared-config/website-cf@bcb53d910698d29749511f386139ad8180269101 # main
name: build and deploy website
env:
NEXT_BASE_PATH: ${{ github.ref == 'refs/heads/master' && '/graphql/codegen' || '' }}
Expand Down
184 changes: 184 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import importPlugin from 'eslint-plugin-import';
import tailwindcss from 'eslint-plugin-tailwindcss';
// eslint-disable-next-line import/no-extraneous-dependencies
import unicorn from 'eslint-plugin-unicorn';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';

const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

// Use sub-modules of @theguild/eslint-config that don't trigger @rushstack/eslint-patch
// (the main index.js requires @rushstack/eslint-patch/modern-module-resolution which doesn't support ESLint 10)
// FlatCompat uses CJS require() which can't load ESM-only plugins (unicorn v57+).
// We import them directly and patch the FlatCompat output.
const theGuildIndex = compat.config({
reportUnusedDisableDirectives: true,
overrides: [
{
files: ['*.{,c,m}{j,t}s{,x}'],
extends: ['./node_modules/@theguild/eslint-config/src/base.js'],
},
{
files: ['*.{,c,m}ts{,x}'],
excludedFiles: ['**/*.md{,x}/*'],
parserOptions: {
projectService: true,
},
rules: {
'@typescript-eslint/prefer-optional-chain': 'error',
},
},
{
files: ['*.{,c,m}ts{,x}'],
rules: {
'@typescript-eslint/consistent-type-assertions': 'error',
},
},
{
files: ['*.c{j,t}s'],
env: { node: true },
rules: { '@typescript-eslint/no-var-requires': 'off' },
},
{
files: [
'jest.config.js',
'webpack.config.js',
'bob.config.js',
'babel.config.js',
'postcss.config.{js,cjs}',
'rollup.config.js',
'next-sitemap.config.js',
],
env: { node: true },
},
{
files: ['*.{spec,test}.*'],
env: { jest: true },
rules: { 'import/extensions': ['error', 'never'] },
},
{
files: ['vite.config.ts', 'jest.config.js', '*.d.ts', 'tsup.config.ts', 'prettier.config.js'],
rules: { 'import/no-default-export': 'off' },
},
{
files: ['*.d.ts'],
rules: {
'no-var': 'off',
},
},
],
});

export default [
// Global ignores (replaces ignorePatterns + .gitignore patterns)
{
ignores: [
'.bob/**',
'.next/**',
'.cache/**',
'**/temp/**',
'dev-test/**',
'website/**',
'examples/**',
'**/tests/test-files/**',
'**/tests/test-documents/**',
'**/react-app-env.d.ts',
'packages/presets/swc-plugin/tests/fixtures/simple-uppercase-operation-name.js',
'packages/presets/swc-plugin/tests/fixtures/simple-uppercase-operation-name.other-dir.js',
'**/build/**',
'**/dist/**',
'**/*.json',
],
},

// @theguild base config (via FlatCompat)
// Patch: replace broken CJS-resolved unicorn plugin with the properly imported ESM version
...theGuildIndex.map(config =>
config.plugins?.unicorn ? { ...config, plugins: { ...config.plugins, unicorn } } : config,
),

// Tailwind CSS plugin (flat config)
...tailwindcss.configs['flat/recommended'],

// Project-level rule overrides
{
plugins: {
import: importPlugin,
},
rules: {
'no-empty': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-types': 'off',
'import/no-extraneous-dependencies': 'error',

// todo: enable
'unicorn/filename-case': 'off',
'import/extensions': 'off',
'import/no-default-export': 'off',
// todo: enable in v3
'unicorn/prefer-node-protocol': 'off',
'prefer-object-has-own': 'off',

// Rules introduced/tightened by updated plugins in ESLint 10 migration
'preserve-caught-error': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'no-useless-assignment': 'off',
},
},

// Node environment for all files
...compat.env({ node: true }),

// Website files: extend @theguild react config
...compat
.config({
extends: ['./node_modules/@theguild/eslint-config/src/react.js'],
})
.map(config => ({ ...config, files: ['website/**'] })),

// Test files
{
files: [
'**/*.spec.ts',
'**/tests/**/*.{js,ts,tsx,cjs}',
'**/graphql-codegen-testing/**/*.ts',
'**/vitest.config.ts',
'**/vitest.setup.ts',
'**/__mocks__/*',
],
rules: {
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/no-require-imports': 'off',
},
},

// Test fixtures
{
files: ['**/tests/fixtures/*.{ts,js}'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},

// Scripts and config files
{
files: ['scripts/*.{ts,js}', 'prettier.config.cjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
];
2 changes: 1 addition & 1 deletion examples/react/apollo-client-defer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/node": "^24.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^5.0.0",
"@vitejs/plugin-react": "^6.0.0",
"cypress": "15.7.1",
"serve": "14.2.3",
"start-server-and-test": "3.0.0",
Expand Down
Loading
Loading