summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-11-27 18:20:39 +0000
committerGitHub <noreply@github.com>2017-11-27 18:20:39 +0000
commitbba6b4c23ccf556656aac6d12c25c21713179209 (patch)
tree9a7f4bdd9082d987b41f73273ebd0b7b29bfc031
parentd4ea0423a2c65a626daca89880811416a9d02040 (diff)
parentb0114deabcb472b5cc7bde21ec9ccab98a618930 (diff)
downloadale-bba6b4c23ccf556656aac6d12c25c21713179209.zip
Merge pull request #1169 from benjie/master
Add support for linting GraphQL with ESLint
-rw-r--r--README.md2
-rw-r--r--ale_linters/graphql/eslint.vim9
-rw-r--r--doc/ale-graphql.txt8
-rw-r--r--doc/ale-typescript.txt2
-rw-r--r--doc/ale.txt3
5 files changed, 21 insertions, 3 deletions
diff --git a/README.md b/README.md
index 9715409b..c5f63f34 100644
--- a/README.md
+++ b/README.md
@@ -102,7 +102,7 @@ formatting.
| FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) |
| 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) !! |
-| 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) |
| 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) |
diff --git a/ale_linters/graphql/eslint.vim b/ale_linters/graphql/eslint.vim
new file mode 100644
index 00000000..dfcbf9d9
--- /dev/null
+++ b/ale_linters/graphql/eslint.vim
@@ -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',
+\})
diff --git a/doc/ale-graphql.txt b/doc/ale-graphql.txt
index 5ceb5ca7..de412762 100644
--- a/doc/ale-graphql.txt
+++ b/doc/ale-graphql.txt
@@ -3,6 +3,14 @@ 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*
===============================================================================
diff --git a/doc/ale-typescript.txt b/doc/ale-typescript.txt
index d31ac71e..d83a2dfe 100644
--- a/doc/ale-typescript.txt
+++ b/doc/ale-typescript.txt
@@ -5,7 +5,7 @@ ALE TypeScript Integration *ale-typescript-options*
===============================================================================
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
options for `eslint` too. See: |ale-javascript-eslint|.
diff --git a/doc/ale.txt b/doc/ale.txt
index 0b8a0c55..d1afb423 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -74,6 +74,7 @@ CONTENTS *ale-contents*
gofmt...............................|ale-go-gofmt|
gometalinter........................|ale-go-gometalinter|
graphql...............................|ale-graphql-options|
+ eslint..............................|ale-graphql-eslint|
gqlint..............................|ale-graphql-gqlint|
handlebars............................|ale-handlebars-options|
ember-template-lint.................|ale-handlebars-embertemplatelint|
@@ -294,7 +295,7 @@ Notes:
* FusionScript: `fusion-lint`
* GLSL: glslang
* Go: `gofmt`, `goimports`, `go vet`, `golint`, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!!
-* GraphQL: `gqlint`
+* GraphQL: `eslint`, `gqlint`
* Haml: `haml-lint`
* Handlebars: `ember-template-lint`
* Haskell: `ghc`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `stack-ghc-mod`, `hlint`, `hdevtools`, `hfmt`