Merge pull request #1169 from benjie/master

Add support for linting GraphQL with ESLint
This commit is contained in:
w0rp 2017-11-27 18:20:39 +00:00 committed by GitHub
commit bba6b4c23c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 3 deletions

View File

@ -102,7 +102,7 @@ formatting.
| FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) | | FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) |
| GLSL | [glslang](https://github.com/KhronosGroup/glslang) | | GLSL | [glslang](https://github.com/KhronosGroup/glslang) |
| Go | [gofmt](https://golang.org/cmd/gofmt/), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/), [golint](https://godoc.org/github.com/golang/lint), [gometalinter](https://github.com/alecthomas/gometalinter) !!, [go build](https://golang.org/cmd/go/) !!, [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) !!, [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) !! | | Go | [gofmt](https://golang.org/cmd/gofmt/), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/), [golint](https://godoc.org/github.com/golang/lint), [gometalinter](https://github.com/alecthomas/gometalinter) !!, [go build](https://golang.org/cmd/go/) !!, [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) !!, [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) !! |
| GraphQL | [gqlint](https://github.com/happylinks/gqlint) | | GraphQL | [eslint](http://eslint.org/), [gqlint](https://github.com/happylinks/gqlint) |
| Haml | [haml-lint](https://github.com/brigade/haml-lint) | | Haml | [haml-lint](https://github.com/brigade/haml-lint) |
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) | | Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
| Haskell | [ghc](https://www.haskell.org/ghc/), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools), [hfmt](https://github.com/danstiner/hfmt) | | Haskell | [ghc](https://www.haskell.org/ghc/), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools), [hfmt](https://github.com/danstiner/hfmt) |

View File

@ -0,0 +1,9 @@
" Author: Benjie Gillam <code@benjiegillam.com>
" Description: eslint for GraphQL files
call ale#linter#Define('graphql', {
\ 'name': 'eslint',
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
\ 'callback': 'ale#handlers#eslint#Handle',
\})

View File

@ -2,6 +2,14 @@
ALE GraphQL Integration *ale-graphql-options* ALE GraphQL Integration *ale-graphql-options*
===============================================================================
eslint *ale-graphql-eslint*
The `eslint` linter for GraphQL uses the JavaScript options for `eslint`; see:
|ale-javascript-eslint|.
You will need the GraphQL ESLint plugin installed for this to work.
=============================================================================== ===============================================================================
gqlint *ale-graphql-gqlint* gqlint *ale-graphql-gqlint*

View File

@ -5,7 +5,7 @@ ALE TypeScript Integration *ale-typescript-options*
=============================================================================== ===============================================================================
eslint *ale-typescript-eslint* eslint *ale-typescript-eslint*
Becauase of how TypeScript compiles code to JavaScript and how interrelated Because of how TypeScript compiles code to JavaScript and how interrelated
the two languages are, the `eslint` linter for TypeScript uses the JavaScript the two languages are, the `eslint` linter for TypeScript uses the JavaScript
options for `eslint` too. See: |ale-javascript-eslint|. options for `eslint` too. See: |ale-javascript-eslint|.

View File

@ -74,6 +74,7 @@ CONTENTS *ale-contents*
gofmt...............................|ale-go-gofmt| gofmt...............................|ale-go-gofmt|
gometalinter........................|ale-go-gometalinter| gometalinter........................|ale-go-gometalinter|
graphql...............................|ale-graphql-options| graphql...............................|ale-graphql-options|
eslint..............................|ale-graphql-eslint|
gqlint..............................|ale-graphql-gqlint| gqlint..............................|ale-graphql-gqlint|
handlebars............................|ale-handlebars-options| handlebars............................|ale-handlebars-options|
ember-template-lint.................|ale-handlebars-embertemplatelint| ember-template-lint.................|ale-handlebars-embertemplatelint|
@ -294,7 +295,7 @@ Notes:
* FusionScript: `fusion-lint` * FusionScript: `fusion-lint`
* GLSL: glslang * GLSL: glslang
* Go: `gofmt`, `goimports`, `go vet`, `golint`, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!! * Go: `gofmt`, `goimports`, `go vet`, `golint`, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!!
* GraphQL: `gqlint` * GraphQL: `eslint`, `gqlint`
* Haml: `haml-lint` * Haml: `haml-lint`
* Handlebars: `ember-template-lint` * Handlebars: `ember-template-lint`
* Haskell: `ghc`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `stack-ghc-mod`, `hlint`, `hdevtools`, `hfmt` * Haskell: `ghc`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `stack-ghc-mod`, `hlint`, `hdevtools`, `hfmt`