Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQl #4

Open
vuki656 opened this issue Apr 13, 2022 · 1 comment
Open

GraphQl #4

vuki656 opened this issue Apr 13, 2022 · 1 comment

Comments

@vuki656
Copy link
Contributor

vuki656 commented Apr 13, 2022

https://github.com/B2o5T/graphql-eslint/blob/master/docs/README.md

@vuki656 vuki656 changed the title [New Ruleset]: Graphql GraphQl May 4, 2022
@vuki656
Copy link
Contributor Author

vuki656 commented May 10, 2022

Working setup for oem-dashboard

Notes

  • Everything needs to be put in the overrides since we cant have root-level config linting everything, and then an override linting specific files since there will be conflict.
  • Schema was put at the root of the project as there were issues setting up the glob to find it in a very nested place
{
    "overrides": [
        {
            "extends": [
                "@rimac-technology/eslint-config/core",
                "@rimac-technology/eslint-config/react"
            ],
            "files": ["*.tsx", ".ts"],
            "parser": "@typescript-eslint/parser",
            "parserOptions": {
                "project": "./tsconfig.json"
            },
            "rules": {
                "etc/no-deprecated": [
                    "error",
                    {
                        "ignored": {
                            "preProcessSnapshot": "name",
                            "postProcessSnapshot": "name",
                            "returnValue": "name"
                        }
                    }
                ]
            }
        },
        {
            "files": [
                "**/__tests__/**/*.[jt]s?(x)",
                "**/?(*.)+(spec|test).[jt]s?(x)"
            ],
            "extends": [
                "@rimac-technology/eslint-config/testing-library",
                "@rimac-technology/eslint-config/jest"
            ]
        },
        {
            "files": ["**/*.gql"],
            "parser": "@graphql-eslint/eslint-plugin",
            "plugins": ["@graphql-eslint"],
            "rules": {
                "@graphql-eslint/alphabetize": [
                    "error",
                    {
                        "selections": [
                            "FragmentDefinition",
                            "OperationDefinition"
                        ],
                        "variables": ["OperationDefinition"],
                        "arguments": [
                            "FieldDefinition",
                            "Field",
                            "DirectiveDefinition",
                            "Directive"
                        ]
                    }
                ]
            },
            "parserOptions": {
                "schema": "./schema.graphql"
            }
        }
    ]
}

@vuki656 vuki656 transferred this issue from RimacTechnology/eslint-config-rimac Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant