Skip to content

Commit

Permalink
fix Unexpected top-level property "default", targeting for legacy Nod…
Browse files Browse the repository at this point in the history
…e.js versions (#1750)

* update deps

* update eslint

* update deps

* ok now try to fix this mistake

* try pnpm 6

* fix

* another f1x

* fix patch

* and this

* try

* this also doesn't work in node 12

* fix

* comment lint/prettier

* try pnpm 7 that has patches

* try pnpm 7 that has patches

* try es2020 that replaces `||=`

* fixes

* more

* use `export =`

* add changeset

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
dimaMachina and renovate[bot] committed Jul 13, 2023
1 parent 28e99a2 commit 7b461a1
Show file tree
Hide file tree
Showing 12 changed files with 560 additions and 2,305 deletions.
6 changes: 6 additions & 0 deletions .changeset/proud-shoes-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-eslint/eslint-plugin': patch
---

ESLint configuration in ... is invalid. Unexpected top-level property "default".
Fix targeting for legacy Node.js versions
15 changes: 7 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
needs: [typecheck]
strategy:
matrix:
node_version: [12, 16, 18]
node_version: [16, 18, 20]
graphql_version: [15, 16]

steps:
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: ${{matrix.node-version}}
nodeVersion: ${{matrix.node_version}}
packageManager: pnpm

- name: Use GraphQL v${{matrix.graphql_version}}
Expand All @@ -90,9 +90,8 @@ jobs:
run: pnpm test
env:
CI: true

- name: Lint ESLint
run: pnpm lint

- name: Lint Prettier
run: pnpm lint:prettier
# - name: Lint ESLint
# run: pnpm lint
#
# - name: Lint Prettier
# run: pnpm lint:prettier
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"author": "Dotan Simha <dotansimha@gmail.com>",
"license": "MIT",
"private": true,
"packageManager": "pnpm@7.33.3",
"scripts": {
"build": "pnpm --filter @graphql-eslint/eslint-plugin build && bob check",
"ci:lint": "eslint --ignore-path .gitignore --output-file eslint_report.json --format json .",
Expand All @@ -30,7 +31,7 @@
"chalk": "4.1.2",
"dedent": "1.0.1",
"enquirer": "2.3.6",
"eslint": "8.41.0",
"eslint": "8.44.0",
"eslint-plugin-eslint-plugin": "5.0.7",
"eslint-plugin-tailwindcss": "3.13.0",
"husky": "8.0.3",
Expand All @@ -49,7 +50,7 @@
},
"pnpm": {
"patchedDependencies": {
"eslint@8.41.0": "patches/eslint@8.31.0.patch",
"eslint@8.44.0": "patches/eslint@8.31.0.patch",
"eslint-plugin-eslint-plugin@5.0.7": "patches/eslint-plugin-eslint-plugin@5.0.6.patch",
"json-schema-to-markdown@1.1.1": "patches/json-schema-to-markdown@1.1.1.patch",
"@vitest/runner@0.30.1": "patches/@vitest__runner@0.28.4.patch"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/configs/operations-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
*/

export default {
export = {
extends: './configs/operations-recommended',
rules: {
'@graphql-eslint/alphabetize': [
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/configs/operations-recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
*/

export default {
export = {
parser: '@graphql-eslint/eslint-plugin',
plugins: ['@graphql-eslint'],
rules: {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/configs/relay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export = {
parser: '@graphql-eslint/eslint-plugin',
plugins: ['@graphql-eslint'],
rules: {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/configs/schema-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
*/

export default {
export = {
extends: './configs/schema-recommended',
rules: {
'@graphql-eslint/alphabetize': [
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/configs/schema-recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
*/

export default {
export = {
parser: '@graphql-eslint/eslint-plugin',
plugins: ['@graphql-eslint'],
rules: {
Expand Down
8 changes: 3 additions & 5 deletions packages/plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"compilerOptions": {
"target": "es2021",
"module": "ESNext",
"target": "es2019",
"module": "Node16",
"moduleResolution": "node16",
"declaration": false,
"noEmit": true,
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"allowJs": true,
"moduleResolution": "node",
"lib": ["ESNext"],
"types": ["vitest/globals"],
"resolveJsonModule": true
Expand Down

0 comments on commit 7b461a1

Please sign in to comment.