Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
GQLint is a GraphQL linter with custom rules.
Please create tickets with new ideas for GraphQL rules.
npm:
npm install -g gqlint
Usage: gqlint [options] <path>
Lint GraphQL queries and schemas.
Options:
-h, --help output usage information
-V, --version output the version number
-r, --reporter <reporter> the reporter to use: stylish (default), compact, json
-c, --config <config> the config file to use: .gqlint (default)
You can also use the tool get-graphql-schema to lint your running API.
get-graphql-schema https://graphql-url.com/graphql | gqlint --reporter codeframe
The Codeframe reporter is used to also show the position of the error within the code.
You can create your own .gqlint file which contains the list of rules you want to check, and to what severity. This is mostly the same format as used by ESLint.
{
"rules": {
"camelcase": "warn",
"fieldname.typename": "warn",
"relay.connection": "warn",
"relay.id": "warn",
"singular.mutations": "warn"
}
}
The keys of the rules object are the names of the GQLint rules we currently have in GQLint. The value is the error level of the rule and can be one of these values:
"off"
or 0
- turn the rule off"warn"
or 1
- turn the rule on as a warning (doesn't affect exit code)"error"
or 2
- turn the rule on as an error (exit code will be 1)The three error levels allow you control over how GQLint applies rules.
I created a plugin for ALE in the plugins/vim folder. You can add this to your vim config after installing the tool. If you want me to make a plugin for your editor, please open an issue (or a PR).
FAQs
GraphQL Linter
The npm package gqlint receives a total of 4 weekly downloads. As such, gqlint popularity was classified as not popular.
We found that gqlint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.