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
10 changes: 6 additions & 4 deletions examples/code-file/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

export default [
{
files: ['**/*.js'],
processor: graphql.processors.graphql,
processor: graphqlPlugin.processor,
rules: {
...js.configs.recommended.rules,
'no-console': 'error',
Expand All @@ -13,10 +13,12 @@ export default [
{
files: ['**/*.graphql'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
rules: {
'@graphql-eslint/no-anonymous-operations': 'error',
Expand Down
8 changes: 5 additions & 3 deletions examples/graphql-config/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

export default [
{
Expand All @@ -9,10 +9,12 @@ export default [
{
files: ['**/*.graphql'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
rules: {
'@graphql-eslint/no-anonymous-operations': 'error',
Expand Down
14 changes: 8 additions & 6 deletions examples/monorepo/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

const SCHEMA_PATH = 'server/**/*.gql';

Expand All @@ -11,7 +11,7 @@ export default [
{
files: ['client/**/*.tsx'],
// Setup processor for operations/fragments definitions on code-files
processor: graphql.processors.graphql,
processor: graphqlPlugin.processor,
languageOptions: {
parserOptions: {
ecmaFeatures: {
Expand All @@ -24,20 +24,22 @@ export default [
// Setup GraphQL Parser
files: ['**/*.{graphql,gql}'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
},
{
// Setup recommended config for schema files
files: [SCHEMA_PATH],
rules: graphql.configs['flat/schema-recommended'],
rules: graphqlPlugin.configs['flat/schema-recommended'].rules,
},
{
// Setup recommended config for operations files
files: ['client/**/*.{graphql,gql}'],
rules: graphql.configs['flat/operations-recommended'],
rules: graphqlPlugin.configs['flat/operations-recommended'].rules,
},
];
14 changes: 8 additions & 6 deletions examples/multiple-projects-graphql-config/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

export default [
{
files: ['**/*.js'],
processor: graphql.processors.graphql,
processor: graphqlPlugin.processor,
rules: js.configs.recommended.rules,
},
{
// Setup GraphQL Parser
files: ['**/*.graphql'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
},
{
files: ['schema.*.graphql'],
rules: {
...graphql.configs['flat/schema-recommended'],
...graphqlPlugin.configs['flat/schema-recommended'].rules,
'@graphql-eslint/require-description': 'off',
},
},
{
files: ['**/*.js/*.graphql'],
rules: graphql.configs['flat/operations-recommended'],
rules: graphqlPlugin.configs['flat/operations-recommended'].rules,
},
];
10 changes: 6 additions & 4 deletions examples/prettier/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import prettierConfig from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

export default [
{
Expand All @@ -11,7 +11,7 @@ export default [
},
{
files: ['**/*.js'],
processor: graphql.processors.graphql,
processor: graphqlPlugin.processor,
rules: {
...js.configs.recommended.rules,
...prettierConfig.rules,
Expand All @@ -21,10 +21,12 @@ export default [
{
files: ['**/*.graphql'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
rules: {
'prettier/prettier': 'error',
Expand Down
8 changes: 5 additions & 3 deletions examples/programmatic/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

export default [
{
Expand All @@ -9,7 +9,7 @@ export default [
{
files: ['**/*.graphql'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
parserOptions: {
graphQLConfig: {
schema: 'schema.graphql',
Expand All @@ -18,7 +18,9 @@ export default [
},
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
rules: {
'@graphql-eslint/require-selections': ['error', { fieldName: '_id' }],
Expand Down
10 changes: 6 additions & 4 deletions examples/svelte-code-file/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import svelteParser from 'svelte-eslint-parser';
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

export default [
{
files: ['**/*.js', '**/*.svelte'],
processor: graphql.processors.graphql,
processor: graphqlPlugin.processor,
rules: js.configs.recommended.rules,
},
{
Expand All @@ -17,10 +17,12 @@ export default [
{
files: ['**/*.graphql'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
rules: {
'@graphql-eslint/no-anonymous-operations': 'error',
Expand Down
10 changes: 6 additions & 4 deletions examples/vue-code-file/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import vueParser from 'vue-eslint-parser';
import js from '@eslint/js';
import * as graphql from '@graphql-eslint/eslint-plugin';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';

export default [
{
files: ['**/*.js', '**/*.vue'],
processor: graphql.processors.graphql,
processor: graphqlPlugin.processor,
rules: js.configs.recommended.rules,
},
{
Expand All @@ -17,10 +17,12 @@ export default [
{
files: ['**/*.graphql'],
languageOptions: {
parser: graphql.parser,
parser: graphqlPlugin.parser,
},
plugins: {
'@graphql-eslint': { rules: graphql.rules },
'@graphql-eslint': {
rules: graphqlPlugin.rules,
},
},
rules: {
'@graphql-eslint/no-anonymous-operations': 'error',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"pnpm": {
"patchedDependencies": {
"eslint@9.9.0": "patches/eslint@8.46.0.patch",
"eslint": "patches/eslint.patch",
"[email protected]": "patches/[email protected]"
}
}
Expand Down
56 changes: 12 additions & 44 deletions packages/plugin/__tests__/__snapshots__/input-name.spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ exports[`input-name > invalid > Invalid #1 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error 1/2
Expand Down Expand Up @@ -41,10 +38,7 @@ exports[`input-name > invalid > Invalid #2 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error
Expand All @@ -65,10 +59,7 @@ exports[`input-name > invalid > Invalid #3 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error
Expand All @@ -89,10 +80,7 @@ exports[`input-name > invalid > Invalid #4 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error 1/2
Expand Down Expand Up @@ -122,10 +110,7 @@ exports[`input-name > invalid > Invalid #5 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error 1/2
Expand Down Expand Up @@ -155,10 +140,7 @@ exports[`input-name > invalid > Invalid #6 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error 1/2
Expand Down Expand Up @@ -188,10 +170,7 @@ exports[`input-name > invalid > Invalid #7 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error 1/2
Expand Down Expand Up @@ -221,10 +200,7 @@ exports[`input-name > invalid > Invalid #8 1`] = `
#### ⚙️ Options

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": true
}

#### ❌ Error 1/4
Expand Down Expand Up @@ -272,10 +248,7 @@ exports[`input-name > invalid > Invalid #9 1`] = `
#### ⚙️ Options

{
"checkInputType": false,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"checkInputType": false
}

#### ❌ Error 1/2
Expand Down Expand Up @@ -306,9 +279,7 @@ exports[`input-name > invalid > Invalid #10 1`] = `

{
"checkInputType": true,
"caseSensitiveInputType": false,
"checkQueries": false,
"checkMutations": true
"caseSensitiveInputType": false
}

#### ❌ Error
Expand All @@ -330,9 +301,7 @@ exports[`input-name > invalid > Invalid #11 1`] = `

{
"checkInputType": true,
"caseSensitiveInputType": true,
"checkQueries": false,
"checkMutations": true
"caseSensitiveInputType": true
}

#### ❌ Error
Expand All @@ -355,8 +324,7 @@ exports[`input-name > invalid > Invalid #12 1`] = `
{
"checkQueries": true,
"checkInputType": true,
"caseSensitiveInputType": true,
"checkMutations": true
"caseSensitiveInputType": true
}

#### ❌ Error
Expand Down
Loading
Loading