Skip to content

Commit 8a3b584

Browse files
authored
Fix broken report highlighting when processor is used (#1040)
* fix processor report on code files * remove tests on eslint 7 * apply fix * more errors * fix `message.endLine` * fix parser error column location * add changeset
1 parent 651451d commit 8a3b584

File tree

16 files changed

+625
-163
lines changed

16 files changed

+625
-163
lines changed

.changeset/dry-zoos-whisper.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': patch
3+
---
4+
5+
fix broken report highlighting when processor is used

.github/workflows/canary.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ jobs:
5050
uses: actions/cache@v3
5151
with:
5252
path: '**/node_modules'
53-
key: ${{runner.os}}-16-8-16-node-modules-${{hashFiles('yarn.lock')}}
53+
key: ${{runner.os}}-16-16-node-modules-${{hashFiles('yarn.lock')}}
5454
restore-keys: |
55-
${{runner.os}}-16-8-16-node-modules-${{hashFiles('yarn.lock')}}
56-
${{runner.os}}-16-8-16-node-modules-
55+
${{runner.os}}-16-16-node-modules-${{hashFiles('yarn.lock')}}
56+
${{runner.os}}-16-16-node-modules-
5757

5858
- name: Install Dependencies
5959
run: yarn
6060

6161
- name: Release Canary
6262
id: canary
6363
uses: kamilkisiela/release-canary@master
64-
if: github.repository == 'B2o5T/graphql-eslint'
64+
if: github.repository == B2o5T/graphql-eslint
6565
with:
6666
npm-token: ${{secrets.NODE_AUTH_TOKEN}}
6767
npm-script: 'yarn release:canary'

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Release
22
on:
33
push:
4-
branches:
5-
- master
4+
branches: [master]
5+
66
jobs:
77
build:
88
runs-on: ubuntu-latest
@@ -40,10 +40,10 @@ jobs:
4040
uses: actions/cache@v3
4141
with:
4242
path: '**/node_modules'
43-
key: ${{runner.os}}-16-8-16-node-modules-${{hashFiles('yarn.lock')}}
43+
key: ${{runner.os}}-16-16-node-modules-${{hashFiles('yarn.lock')}}
4444
restore-keys: |
45-
${{runner.os}}-16-8-16-node-modules-${{hashFiles('yarn.lock')}}
46-
${{runner.os}}-16-8-16-node-modules-
45+
${{runner.os}}-16-16-node-modules-${{hashFiles('yarn.lock')}}
46+
${{runner.os}}-16-16-node-modules-
4747

4848
- name: Install Dependencies
4949
run: yarn

.github/workflows/tests.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
uses: actions/cache@v3
2626
with:
2727
path: '**/node_modules'
28-
key: ${{runner.os}}-16-8-16-node-modules-${{hashFiles('yarn.lock')}}
28+
key: ${{runner.os}}-16-16-node-modules-${{hashFiles('yarn.lock')}}
2929
restore-keys: |
30-
${{runner.os}}-16-8-16-node-modules-${{hashFiles('yarn.lock')}}
31-
${{runner.os}}-16-8-16-node-modules-
30+
${{runner.os}}-16-16-node-modules-${{hashFiles('yarn.lock')}}
31+
${{runner.os}}-16-16-node-modules-
3232

3333
- name: Install Dependencies
3434
run: yarn
@@ -58,10 +58,10 @@ jobs:
5858
uses: actions/cache@v3
5959
with:
6060
path: '**/node_modules'
61-
key: ${{runner.os}}-16-8-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
61+
key: ${{runner.os}}-16-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
6262
restore-keys: |
63-
${{runner.os}}-16-8-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
64-
${{runner.os}}-16-8-${{matrix.graphql_version}}-node-modules-
63+
${{runner.os}}-16-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
64+
${{runner.os}}-16-${{matrix.graphql_version}}-node-modules-
6565

6666
- name: Use GraphQL v${{matrix.graphql_version}}
6767
run: node ./scripts/match-graphql.mjs ${{matrix.graphql_version}}
@@ -79,14 +79,13 @@ jobs:
7979
path: packages/plugin/dist
8080

8181
test:
82-
name: Testing on Node ${{matrix.node_version}} with ESLint v${{matrix.eslint_version}} and GraphQL v${{matrix.graphql_version}}
82+
name: Testing on Node ${{matrix.node_version}} with GraphQL v${{matrix.graphql_version}} and ESLint v8
8383
timeout-minutes: 60
8484
runs-on: ubuntu-latest
8585
needs: [typecheck]
8686
strategy:
8787
matrix:
8888
node_version: [12, 16]
89-
eslint_version: [7.32.0, 8]
9089
graphql_version: [15, 16]
9190

9291
steps:
@@ -104,28 +103,25 @@ jobs:
104103
uses: actions/cache@v3
105104
with:
106105
path: '**/node_modules'
107-
key: ${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
106+
key: ${{runner.os}}-${{matrix.node_version}}-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
108107
restore-keys: |
109-
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
110-
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-${{matrix.graphql_version}}-node-modules-
108+
${{runner.os}}-${{matrix.node_version}}-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
109+
${{runner.os}}-${{matrix.node_version}}-${{matrix.graphql_version}}-node-modules-
111110

112111
- name: Use GraphQL v${{matrix.graphql_version}}
113112
run: node scripts/match-graphql.mjs ${{matrix.graphql_version}}
114113

115-
- name: Use ESLint v${{matrix.eslint_version}}
116-
run: node scripts/match-eslint.mjs ${{matrix.eslint_version}}
117-
118114
- name: Install Dependencies
119115
run: yarn
120116

121117
- name: Cache Jest
122118
uses: actions/cache@v3
123119
with:
124120
path: .cache/jest
125-
key: ${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-jest-${{hashFiles('yarn.lock')}}
121+
key: ${{runner.os}}-${{matrix.node_version}}-jest-${{hashFiles('yarn.lock')}}
126122
restore-keys: |
127-
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-jest-${{hashFiles('yarn.lock')}}
128-
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-jest-
123+
${{runner.os}}-${{matrix.node_version}}-jest-${{hashFiles('yarn.lock')}}
124+
${{runner.os}}-${{matrix.node_version}}-jest-
129125

130126
# We need build for examples.spec.ts test
131127
# Otherwise we'll get error - Cannot find module 'node_modules/@graphql-eslint/eslint-plugin/dist/index.js'

examples/basic/.eslintrc.js renamed to examples/basic/.eslintrc.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ module.exports = {
44
{
55
files: ['*.js'],
66
extends: ['eslint:recommended'],
7-
env: {
8-
node: true,
9-
},
107
},
118
{
129
files: ['*.graphql'],

examples/code-file/.eslintrc.js renamed to examples/code-file/.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66
processor: '@graphql-eslint/graphql',
77
extends: ['eslint:recommended'],
88
env: {
9-
node: true,
109
es6: true,
1110
},
1211
rules: {

examples/graphql-config-code-file/.eslintrc.js renamed to examples/graphql-config-code-file/.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66
processor: '@graphql-eslint/graphql',
77
extends: ['eslint:recommended'],
88
env: {
9-
node: true,
109
es6: true,
1110
},
1211
},

examples/graphql-config-code-file/query.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const gql = require('graphql-tag');
22

3-
// eslint-disable-next-line no-unused-vars
43
const GET_USER = gql`
54
query {
65
user {

examples/graphql-config/.eslintrc.js renamed to examples/graphql-config/.eslintrc.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ module.exports = {
44
{
55
files: ['*.js'],
66
extends: ['eslint:recommended'],
7-
env: {
8-
node: true,
9-
},
107
},
118
{
129
files: ['*.graphql'],

examples/prettier/.eslintrc.js renamed to examples/prettier/.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66
processor: '@graphql-eslint/graphql',
77
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
88
env: {
9-
node: true,
109
es6: true,
1110
},
1211
},

0 commit comments

Comments
 (0)