Skip to content

Commit 1c2d220

Browse files
graphql-eslint v4 (#1813)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 2bf2868 commit 1c2d220

File tree

294 files changed

+4162
-5311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+4162
-5311
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': patch
3+
---
4+
5+
dependencies updates:
6+
7+
- Removed dependency
8+
[`@babel/code-frame@^7.18.6` ↗︎](https://www.npmjs.com/package/@babel/code-frame/v/7.18.6) (from
9+
`dependencies`)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@graphql-eslint/eslint-plugin": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`graphql-config@^4.5.0` ↗︎](https://www.npmjs.com/package/graphql-config/v/4.5.0) (from `^4.4.0`, in `dependencies`)
6+
- Removed dependency [`@babel/code-frame@^7.18.6` ↗︎](https://www.npmjs.com/package/@babel/code-frame/v/7.18.6) (from `dependencies`)
7+
- Removed dependency [`chalk@^4.1.2` ↗︎](https://www.npmjs.com/package/chalk/v/4.1.2) (from `dependencies`)
8+
- Removed dependency [`tslib@^2.4.1` ↗︎](https://www.npmjs.com/package/tslib/v/2.4.1) (from `dependencies`)
9+
- Updated dependency [`graphql@^16` ↗︎](https://www.npmjs.com/package/graphql/v/16.0.0) (from `^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0`, in `peerDependencies`)
10+
- Added dependency [`eslint@>=8.44.0` ↗︎](https://www.npmjs.com/package/eslint/v/8.44.0) (to `peerDependencies`)

.changeset/dull-scissors-destroy.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': major
3+
---
4+
5+
- bring back `possible-type-extension` rule to `schema-recommended` config
6+
7+
- add `unique-operation-name` and `unique-fragment-name` rules to `operations-recommended` config
8+
9+
The concept of sibling operations provided by graphql-config's `documents` fields is based on
10+
uniquely named operations and fragments, for omitting false-positive/negative cases when operations
11+
and fragments are located in separate files. For this reason, these rules must be included in the
12+
recommended config
13+
14+
- rename `relay` config to `schema-relay`
15+
16+
> To avoid confusing when users extend this config for executable definitions (operations and
17+
> fragments)

.changeset/few-mails-sparkle.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': major
3+
---
4+
5+
- `alphabetize` rule changes
6+
7+
- add `definitions: true` option for `schema-all`/`operations-all` configs
8+
- rename `values: ['EnumTypeDefinition']` to `values: true`
9+
- rename `variables: ['OperationDefinition']` to `variables: true`
10+
- add `groups: ['id', '*', 'createdAt', 'updatedAt']` for `schema-all`/`operations-all` configs
11+
12+
- `require-id-when-available` rule changes
13+
14+
- rename rule to `require-selections`
15+
16+
- update `schema-all`/`operations-all` configs
17+
18+
- `require-description` rule changes
19+
20+
- add `rootField: true` option for `schema-recommended` config
21+
22+
- require `eslint` at least `>=8.44.0` as peerDependency
23+
24+
- `naming-convention`
25+
26+
- add new options for `schema-recommended` config
27+
28+
```json5
29+
{
30+
'EnumTypeDefinition,EnumTypeExtension': {
31+
forbiddenPrefixes: ['Enum'],
32+
forbiddenSuffixes: ['Enum']
33+
},
34+
'InterfaceTypeDefinition,InterfaceTypeExtension': {
35+
forbiddenPrefixes: ['Interface'],
36+
forbiddenSuffixes: ['Interface']
37+
},
38+
'UnionTypeDefinition,UnionTypeExtension': {
39+
forbiddenPrefixes: ['Union'],
40+
forbiddenSuffixes: ['Union']
41+
},
42+
'ObjectTypeDefinition,ObjectTypeExtension': {
43+
forbiddenPrefixes: ['Type'],
44+
forbiddenSuffixes: ['Type']
45+
}
46+
}
47+
```
48+
49+
- remove graphql-js' `unique-enum-value-names` rule
50+
51+
- rename `no-case-insensitive-enum-values-duplicates` to `unique-enum-value-names`
52+
53+
> Since this rule reports case-insensitive enum values duplicates too
54+
55+
- `require-nullable-result-in-root` rule changes
56+
57+
Do not check subscriptions

.changeset/itchy-ads-compete.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': major
3+
---
4+
5+
- remove `parserOptions.schema`
6+
- remove `parserOptions.documents`
7+
- remove `parserOptions.extensions`
8+
- remove `parserOptions.include`
9+
- remove `parserOptions.exclude`
10+
- remove `parserOptions.projects`
11+
- remove `parserOptions.schemaOptions`
12+
- remove `parserOptions.graphQLParserOptions`
13+
- remove `parserOptions.skipGraphQLConfig`
14+
- remove `parserOptions.operations`
15+
16+
- add `parserOptions.graphQLConfig?: IGraphQLConfig` for programmatic usage

.changeset/pre.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"mode": "pre",
3+
"tag": "alpha",
4+
"initialVersions": {
5+
"@graphql-eslint/example-code-file": "0.0.0",
6+
"@graphql-eslint/example-graphql-config": "0.0.0",
7+
"@graphql-eslint/example-monorepo": "0.0.0",
8+
"@graphql-eslint/example-multiple-projects-graphql-config": "0.0.0",
9+
"@graphql-eslint/example-prettier": "0.0.0",
10+
"@graphql-eslint/example-programmatic": "0.0.0",
11+
"@graphql-eslint/example-svelte-code-file": "0.0.0",
12+
"@graphql-eslint/example-vue-code-file": "0.0.0",
13+
"@graphql-eslint/eslint-plugin": "3.20.1",
14+
"@theguild/eslint-rule-tester": "0.0.0",
15+
"website": "0.0.0"
16+
},
17+
"changesets": [
18+
"@graphql-eslint_eslint-plugin-1792-dependencies",
19+
"dull-scissors-destroy",
20+
"few-mails-sparkle",
21+
"itchy-ads-compete",
22+
"rare-planes-love",
23+
"strong-needles-compare"
24+
]
25+
}

.changeset/rare-planes-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': major
3+
---
4+
5+
drop support of Node.js 12/14/16, GraphQL 14/15

.changeset/strong-needles-compare.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': major
3+
---
4+
5+
Remove `GraphQLRuleTester` from bundle, to test your rules use regular `RuleTester` from eslint
6+
7+
> **Note**: with this change unnecessary dependency `@babel/code-frame` was removed too
8+
9+
```js
10+
import { RuleTester } from 'eslint'
11+
12+
const ruleTester = new RuleTester({
13+
parser: require.resolve('@graphql-eslint/eslint-plugin')
14+
})
15+
```

.eslintrc.cjs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
ignorePatterns: ['examples', 'packages/plugin/tests/__snapshots__'],
2+
ignorePatterns: ['examples', 'packages/plugin/__tests__/__snapshots__'],
33
extends: [
44
'@theguild',
55
'@theguild/eslint-config/json',
@@ -55,7 +55,7 @@ module.exports = {
5555
},
5656
},
5757
{
58-
files: ['**/tests/mocks/**/*.{ts,js}'],
58+
files: ['**/__tests__/mocks/**/*.{ts,js}'],
5959
rules: {
6060
'@typescript-eslint/no-unused-vars': 'off',
6161
},
@@ -69,13 +69,6 @@ module.exports = {
6969
node: true,
7070
},
7171
},
72-
{
73-
files: ['packages/plugin/src/**'],
74-
rules: {
75-
// remove in v4 major
76-
'unicorn/prefer-node-protocol': 'off',
77-
},
78-
},
7972
{
8073
files: ['packages/plugin/src/rules/index.ts'],
8174
rules: {

.github/workflows/pr.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
name: pr
1+
name: PR
22
on:
33
pull_request:
4-
branches:
5-
- master
4+
branches: [master]
65

76
jobs:
87
dependencies:

0 commit comments

Comments
 (0)