From 4203710b0320d3e97a17a586144429f4b475b1c6 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 11 Jul 2023 13:54:47 +0200 Subject: [PATCH 1/4] add prettierignore to eslint ignore --- .changeset/late-tables-teach.md | 6 +++--- .prettierignore | 1 + package.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.changeset/late-tables-teach.md b/.changeset/late-tables-teach.md index c82bbb76de1..14e734d007c 100644 --- a/.changeset/late-tables-teach.md +++ b/.changeset/late-tables-teach.md @@ -10,7 +10,7 @@ the plugin signature has changed slightly as well. now, instead of something like this: -```js +```jsx import { useExplorerPlugin } from '@graphiql/plugin-explorer'; import { snippets } from './snippets'; import { useExporterPlugin } from '@graphiql/plugin-code-exporter'; @@ -44,7 +44,7 @@ const App = () => { you can just do this: -```js +```jsx import { explorerPlugin } from '@graphiql/plugin-explorer'; import { snippets } from './snippets'; import { codeExporterPlugin } from '@graphiql/plugin-code-exporter'; @@ -69,7 +69,7 @@ const App = () => { or this, for more complex state-driven needs: -```js +```jsx import { useMemo } from 'react' import { explorerPlugin } from '@graphiql/plugin-explorer'; import { snippets } from './snippets'; diff --git a/.prettierignore b/.prettierignore index e36c8f8cb2a..b248138fd9b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,4 @@ working-group/ packages/codemirror-graphql/src/__tests__/schema-kitchen-sink.graphql CHANGELOG.md +**/CHANGELOG.md diff --git a/package.json b/package.json index 997deb1d54c..1d7be334aa9 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "dev-graphiql": "yarn workspace graphiql dev", "e2e": "yarn run e2e:build && yarn workspace graphiql e2e", "e2e:build": "yarn build && yarn workspace graphiql build-bundles", - "eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --max-warnings=0 --ignore-path .gitignore --cache .", + "eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --max-warnings=0 --ignore-path .gitignore --ignore-path .prettierignore --cache .", "format": "yarn eslint --fix && yarn pretty", "jest": "jest --testPathIgnorePatterns cm6-graphql", "license-check": "jsgl --local ./", From 767dc884c9cae207ad99871ea02922c3134ce60c Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 11 Jul 2023 13:58:27 +0200 Subject: [PATCH 2/4] remove ignored section from prettierrc --- .prettierrc | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.prettierrc b/.prettierrc index ecda9b88964..a219e18edf6 100644 --- a/.prettierrc +++ b/.prettierrc @@ -10,16 +10,6 @@ "printWidth": 80, "proseWrap": "preserve" } - }, - { - "files": [ - "**/.changeset/*.md", - "**/CHANGELOG.md", - "working-group/agendas/**/*.md" - ], - "options": { - "proseWrap": "never" - } } ] } From d610ecd2b97c39e531626070d9a17f5dab3e502c Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 11 Jul 2023 14:01:15 +0200 Subject: [PATCH 3/4] only pass single ignore-path to eslint --- .prettierignore => .eslintignore | 0 package.json | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .prettierignore => .eslintignore (100%) diff --git a/.prettierignore b/.eslintignore similarity index 100% rename from .prettierignore rename to .eslintignore diff --git a/package.json b/package.json index 1d7be334aa9..24d86a3b920 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "dev-graphiql": "yarn workspace graphiql dev", "e2e": "yarn run e2e:build && yarn workspace graphiql e2e", "e2e:build": "yarn build && yarn workspace graphiql build-bundles", - "eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --max-warnings=0 --ignore-path .gitignore --ignore-path .prettierignore --cache .", + "eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --max-warnings=0 --ignore-path .gitignore --cache .", "format": "yarn eslint --fix && yarn pretty", "jest": "jest --testPathIgnorePatterns cm6-graphql", "license-check": "jsgl --local ./", @@ -66,7 +66,7 @@ "prebuild-bundles": "yarn build-bundles-clean", "prepublishOnly": "./scripts/prepublish.sh", "pretty": "yarn pretty-check --write", - "pretty-check": "prettier --cache --check --ignore-path .gitignore --ignore-path .prettierignore .", + "pretty-check": "prettier --cache --check --ignore-path .gitignore --ignore-path .eslintignore .", "ci:version": "yarn changeset version && yarn build && yarn format", "release": "yarn build && yarn build-bundles && (wsrun release --exclude-missing --serial --recursive --changedSince main -- || true) && yarn changeset publish", "release:canary": "(node scripts/canary-release.js && yarn build && yarn build-bundles && yarn changeset publish --tag canary) || echo Skipping Canary...", From 1fcbb5febd6fa39641ccb1b965a36feb91c1abbe Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 11 Jul 2023 14:02:45 +0200 Subject: [PATCH 4/4] add to pre-commit hooks as well --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 24d86a3b920..ca9c1a73465 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,12 @@ "lint-staged": { "*.{js,ts,jsx,tsx}": [ "eslint --fix", - "prettier --write", + "prettier --write --ignore-path .eslintignore", "jest --passWithNoTests", "yarn lint-cspell" ], "*.{md,html,json,css}": [ - "prettier --write", + "prettier --write --ignore-path .eslintignore", "yarn lint-cspell" ] },