Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina authored Aug 14, 2024
2 parents 2753a8c + db6afa9 commit b084052
Show file tree
Hide file tree
Showing 250 changed files with 12,094 additions and 9,131 deletions.
11 changes: 8 additions & 3 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json",
"$schema": "https://unpkg.com/@changesets/config@2.0.1/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "graphql/graphiql" }],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"ignore": ["example-*"],
"ignore": [
"example-graphiql-webpack",
"example-monaco-graphql-nextjs",
"example-monaco-graphql-react-vite",
"example-monaco-graphql-webpack"
],
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"updateInternalDependents": "always"
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.changeset/
.changeset/*.md

# ignore working-group dir markdown so it's easier for people to edit from the UI
working-group/
packages/codemirror-graphql/src/__tests__/schema-kitchen-sink.graphql
CHANGELOG.md
**/CHANGELOG.md
packages/vscode-graphql-syntax/tests/__fixtures__/
packages/graphql-language-service-server/src/__tests__/parseDocument.test.ts
61 changes: 32 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
overrides: [
{
// Rules for all code files
files: ['**/*.{js,jsx,ts,tsx}'],
files: ['**/*.{js,jsx,ts,tsx,mts,cts}'],
parserOptions: {
ecmaVersion: 6,
},
Expand All @@ -54,21 +54,14 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:import-x/recommended',
'plugin:import-x/typescript',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'prettier',
],
plugins: [
'promise',
'sonarjs',
'unicorn',
'@arthurgeron/react-usememo',
'sonar',
'@shopify',
],
plugins: ['promise', 'sonarjs', 'unicorn', 'sonar', '@shopify'],
globals: {
atom: false,
document: false,
Expand All @@ -81,10 +74,6 @@ module.exports = {
'@shopify/prefer-early-return': ['error', { maximumStatements: 2 }],
'@shopify/prefer-class-properties': 'off', // enable after https://github.com/Shopify/web-configs/issues/387 will be fixed
'sonarjs/no-inverted-boolean-check': 'error',
'@arthurgeron/react-usememo/require-usememo': [
'error',
{ checkHookCalls: false },
],
// Possible Errors (http://eslint.org/docs/rules/#possible-errors)
'no-console': 'error',
'no-constant-binary-expression': 'error',
Expand Down Expand Up @@ -133,7 +122,14 @@ module.exports = {
'no-octal-escape': 'error',
'no-param-reassign': 'error',
'no-proto': 'error',
'no-restricted-properties': 'off',
'no-restricted-properties': [
'error',
{
object: 'window',
property: 'localStorage',
message: 'Use `localStorage` instead',
},
],
'no-return-assign': 'error',
'no-return-await': 'error',
'no-script-url': 'error',
Expand All @@ -144,7 +140,6 @@ module.exports = {
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-return': 'off',
'@typescript-eslint/prefer-optional-chain': 'error',
'no-warning-comments': 'off',
radix: 'error',
'require-await': 'off',
Expand Down Expand Up @@ -281,9 +276,9 @@ module.exports = {

'sonarjs/no-ignored-return': 'error',
'unicorn/no-array-push-push': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'error',
'import-x/no-extraneous-dependencies': 'error',
'import-x/no-duplicates': 'error',
'import-x/no-named-as-default': 'error',
'prefer-object-spread': 'error',
// React rules
'react/no-unused-state': 'error',
Expand Down Expand Up @@ -336,7 +331,15 @@ module.exports = {
'sonar/prefer-promise-shorthand': 'error',
'sonar/no-dead-store': 'error',
'unicorn/prefer-node-protocol': 'error',
'import/no-unresolved': ['error', { ignore: ['^node:'] }],
'import-x/no-unresolved': [
'error',
{ ignore: ['^node:', '\\.svg\\?react$'] },
],
'no-extra-boolean-cast': [
'error',
{ enforceForInnerExpressions: true },
],
'unicorn/no-length-as-slice-end': 'error',
'unicorn/prefer-string-replace-all': 'error',
'unicorn/no-hex-escape': 'off', // TODO: enable
// doesn't catch a lot of cases; we use ESLint builtin `no-restricted-syntax` to forbid `.keyCode`
Expand All @@ -351,14 +354,16 @@ module.exports = {
},
{
// Rules that requires type information
files: ['**/*.{ts,tsx}'],
files: ['**/*.{ts,tsx,mts,cts}'],
excludedFiles: ['**/*.{md,mdx}/*.{ts,tsx}'],
// extends: ['plugin:@typescript-eslint/recommended-type-checked'],
rules: {
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
// TODO: Fix all errors for the following rules included in recommended config
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
Expand Down Expand Up @@ -398,7 +403,6 @@ module.exports = {
rules: {
'jest/no-conditional-expect': 'off',
'jest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],
'@arthurgeron/react-usememo/require-usememo': 'off',
},
},
{
Expand All @@ -415,14 +419,14 @@ module.exports = {
'no-console': 'off',
'no-new': 'off',
'no-alert': 'off',
'import/no-unresolved': 'off',
'import-x/no-unresolved': 'off',
},
},
{
// Rule for ignoring imported dependencies from tests files
files: ['**/__tests__/**', 'webpack.config.js', '**/tests/**'],
rules: {
'import/no-extraneous-dependencies': 'off',
'import-x/no-extraneous-dependencies': 'off',
},
},
{
Expand All @@ -432,7 +436,7 @@ module.exports = {
'packages/vscode-graphql-execution/**',
],
rules: {
'import/no-unresolved': ['error', { ignore: ['^node:', 'vscode'] }],
'import-x/no-unresolved': ['error', { ignore: ['^node:', 'vscode'] }],
},
},
{
Expand Down Expand Up @@ -473,14 +477,13 @@ module.exports = {
// Rules for codeblocks inside Markdown/MDX
files: ['**/*.{md,mdx}/*.{js,jsx,ts,tsx}'],
rules: {
'import/no-extraneous-dependencies': 'off',
'import-x/no-extraneous-dependencies': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'import/no-unresolved': 'off',
'import-x/no-unresolved': 'off',
'no-console': 'off',
'no-undef': 'off',
'react/jsx-no-undef': 'off',
'react-hooks/rules-of-hooks': 'off',
'@arthurgeron/react-usememo/require-usememo': 'off',
'sonar/no-dead-store': 'off',
'@typescript-eslint/no-restricted-imports': 'off',
},
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/main-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,40 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: yarn
- name: Cache node modules
id: cache-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
**/node_modules
key: modules-${{ github.sha }}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cache/Cypress
key: cypress-${{ runner.os }}
key: cypress-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile --immutable

jest:
name: Jest Unit Tests
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- id: cache-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
**/node_modules
key: modules-${{ github.sha }}
- run: yarn test --coverage
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-graphql-compat-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
release: ['15.5.3', '^15.8.0', '16.1.0', '16.2.0', '16.3.0']
release:
['15.5.3', '^15.8.0', '16.1.0', '16.2.0', '16.3.0', '17.0.0-alpha.5']
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: 16
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-${{hashFiles('yarn.lock')}}
Expand Down
Loading

0 comments on commit b084052

Please sign in to comment.