-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix
require is not defined
in flat configs for Vue/Svelte projects (#…
…2466) * yoyo * use alpha * use `assert` instead `with`
- Loading branch information
1 parent
5d0b322
commit da608d7
Showing
13 changed files
with
142 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@graphql-eslint/eslint-plugin': patch | ||
--- | ||
|
||
fix `require is not defined` in flat configs for Vue/Svelte projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
examples/multiple-projects-graphql-config/eslint.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import js from '@eslint/js'; | ||
import * as graphql from '@graphql-eslint/eslint-plugin'; | ||
|
||
export default [ | ||
{ | ||
files: ['**/*.js'], | ||
processor: graphql.processors.graphql, | ||
rules: js.configs.recommended.rules, | ||
}, | ||
{ | ||
// Setup GraphQL Parser | ||
files: ['**/*.graphql'], | ||
plugins: { | ||
'@graphql-eslint': { rules: graphql.rules }, | ||
}, | ||
languageOptions: { | ||
parser: graphql.parser, | ||
}, | ||
}, | ||
{ | ||
files: ['schema.*.graphql'], | ||
rules: { | ||
...graphql.flatConfigs['schema-recommended'].rules, | ||
'@graphql-eslint/require-description': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js/*.graphql'], | ||
rules: graphql.flatConfigs['operations-recommended'].rules, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import svelteParser from 'svelte-eslint-parser'; | ||
import js from '@eslint/js'; | ||
import * as graphql from '@graphql-eslint/eslint-plugin'; | ||
|
||
export default [ | ||
{ | ||
files: ['**/*.js', '**/*.svelte'], | ||
processor: graphql.processors.graphql, | ||
rules: js.configs.recommended.rules, | ||
}, | ||
{ | ||
files: ['**/*.svelte'], | ||
languageOptions: { | ||
parser: svelteParser, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.graphql'], | ||
languageOptions: { | ||
parser: graphql.parser, | ||
}, | ||
plugins: { | ||
'@graphql-eslint': { rules: graphql.rules }, | ||
}, | ||
rules: { | ||
'@graphql-eslint/no-anonymous-operations': 'error', | ||
'@graphql-eslint/no-duplicate-fields': 'error', | ||
'@graphql-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
OperationDefinition: { | ||
style: 'PascalCase', | ||
forbiddenPrefixes: ['Query', 'Mutation', 'Subscription', 'Get'], | ||
forbiddenSuffixes: ['Query', 'Mutation', 'Subscription'], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import vueParser from 'vue-eslint-parser'; | ||
import js from '@eslint/js'; | ||
import * as graphql from '@graphql-eslint/eslint-plugin'; | ||
|
||
export default [ | ||
{ | ||
files: ['**/*.js', '**/*.vue'], | ||
processor: graphql.processors.graphql, | ||
rules: js.configs.recommended.rules, | ||
}, | ||
{ | ||
files: ['**/*.vue'], | ||
languageOptions: { | ||
parser: vueParser, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.graphql'], | ||
languageOptions: { | ||
parser: graphql.parser, | ||
}, | ||
plugins: { | ||
'@graphql-eslint': { rules: graphql.rules }, | ||
}, | ||
rules: { | ||
'@graphql-eslint/no-anonymous-operations': 'error', | ||
'@graphql-eslint/no-duplicate-fields': 'error', | ||
'@graphql-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
OperationDefinition: { | ||
style: 'PascalCase', | ||
forbiddenPrefixes: ['Query', 'Mutation', 'Subscription', 'Get'], | ||
forbiddenSuffixes: ['Query', 'Mutation', 'Subscription'], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.