Skip to content

Commit

Permalink
chore: eslint x graphql support
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Aug 25, 2022
1 parent 15c2ba5 commit 15d0f68
Show file tree
Hide file tree
Showing 8 changed files with 702 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ahmadnassri
ardatan
autocrlf
autosetuprebase
bdel
Expand All @@ -20,9 +21,11 @@ esbuild
fbca
fpnv
gpgsign
graphqlrc
hmarr
iife
keyid
larsgw
lcov
lintstagedrc
micnncim
Expand Down
8 changes: 8 additions & 0 deletions .eslintrc.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,14 @@ const config = {
'unicorn/no-keyword-prefix': 0
}
},
{
files: ['*.gql'],
extends: ['plugin:@graphql-eslint/operations-all'],
rules: {
'@graphql-eslint/no-anonymous-operations': 0,
'@graphql-eslint/require-id-when-available': 0
}
},
{
files: ['*.json'],
extends: ['plugin:jsonc/prettier'],
Expand Down
4 changes: 2 additions & 2 deletions .github/graphql/queries/linked-issues.gql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query ($owner: String!, $repo: String!, $pr: Int!, $limit: Int = 20) {
repository(owner: $owner, name: $repo) {
query ($limit: Int = 20, $owner: String!, $pr: Int!, $repo: String!) {
repository(name: $repo, owner: $owner) {
pullRequest(number: $pr) {
closingIssuesReferences(
first: $limit
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/label-linked-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
uses: octokit/graphql-action@v2.2.22
with:
query: |
query ($owner: String!, $repo: String!, $pr: Int!, $limit: Int = 20) {
repository(owner: $owner, name: $repo) {
query ($limit: Int = 20, $owner: String!, $pr: Int!, $repo: String!) {
repository(name: $repo, owner: $owner) {
pullRequest(number: $pr) {
closingIssuesReferences(
first: $limit
Expand Down
7 changes: 7 additions & 0 deletions .graphqlrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# GRAPHQL CONFIG
# https://graphql-config.com/docs/user/usage

---
documents:
- ./.github/graphql/**/*.gql
schema: https://raw.githubusercontent.com/octokit/graphql-schema/master/schema.graphql
16 changes: 14 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@
"eslint.enable": true,
"eslint.nodePath": "./node_modules/eslint",
"eslint.options": {
"extensions": ["cjs", "cts", "json", "md", "mjs", "ts", "yml"],
"extensions": ["cjs", "cts", "gql", "json", "md", "mjs", "ts", "yml"],
"overrideConfigFile": "./.eslintrc.cjs"
},
"eslint.packageManager": "yarn",
"eslint.validate": ["javascript", "json", "markdown", "typescript"],
"eslint.validate": [
"graphql",
"javascript",
"json",
"markdown",
"typescript",
"typescriptreact"
],
"files.associations": {
"*.snap": "jest-snapshot",
".env.zsh": "shellscript",
Expand Down Expand Up @@ -87,6 +94,11 @@
"format": "svg",
"icon": "eslint"
},
{
"extensions": [".graphqlrc.yml"],
"format": "svg",
"icon": "graphql"
},
{
"extensions": [".lintstagedrc.cjs"],
"format": "svg",
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"build": "unbuild",
"check:ci": "yarn fix:cg && yarn check:spelling && yarn check:types && yarn test && NODE_ENV=production yarn pack -o %s-%v.tgz && yarn clean:pack",
"check:format": "prettier --check .",
"check:lint": "eslint --cache --exit-on-fatal-error --ext cjs,cts,json,md,mjs,ts,yml .",
"check:lint": "eslint --cache --exit-on-fatal-error --ext cjs,cts,gql,json,md,mjs,ts,yml .",
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
"check:types": "NODE_OPTIONS='--es-module-specifier-resolution=node --loader=./loader' tsc -p tsconfig.json",
"check:upgrades": "yarn upgrade-interactive",
Expand Down Expand Up @@ -63,6 +63,7 @@
"@faker-js/faker": "7.4.0",
"@flex-development/dist-tag": "1.0.0",
"@flex-development/tutils": "5.0.0",
"@graphql-eslint/eslint-plugin": "3.10.7",
"@types/chai": "4.3.3",
"@types/conventional-changelog": "3.1.1",
"@types/conventional-changelog-config-spec": "2.1.1",
Expand Down Expand Up @@ -96,6 +97,7 @@
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-unicorn": "43.0.2",
"eslint-plugin-yml": "1.1.0",
"graphql": "16.6.0",
"growl": "1.10.5",
"husky": "8.0.1",
"is-ci": "3.0.1",
Expand All @@ -118,6 +120,7 @@
"yaml-eslint-parser": "1.1.0"
},
"resolutions": {
"@ardatan/sync-fetch": "larsgw/sync-fetch#head=worker_threads",
"typescript": "4.8.0-beta",
"vite": "3.0.4"
},
Expand Down
Loading

0 comments on commit 15d0f68

Please sign in to comment.