Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

adding eslint-plugin-graphql as dependency #165

Merged
merged 1 commit into from
Sep 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

<!-- ## Unreleased -->
## Unreleased

### Added

* Added `shopify/graphql` config using new `eslint-plugin-graphql` (`2.1.1.`) dependency. ([#165](https://github.com/Shopify/eslint-plugin-shopify/pull/165))

## [24.0.0] - 2018-08-30

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ This plugin also provides the following tool-specific configurations, which can
- [mocha](lib/config/mocha.js): Use this for projects that use [mocha](http://mochajs.org)/ [sinon](http://sinonjs.org)/ [chai](http://chaijs.com) for testing.
- [ava](lib/config/ava.js): Use this for projects that use the [AVA test runner](https://github.com/sindresorhus/ava).
- [flow](lib/config/flow.js): Use this for projects that use [flow](http://flowtype.org) for type checking.
- [graphql](lib/config/graphql.js): Use this for projects that use [graphql-config](https://github.com/prisma/graphql-config) for graphql validation.
- [jquery](lib/config/jquery.js): Use this for projects that use [jQuery](http://jquery.com).
- [polaris](lib/config/polaris.js): Use this for projects that use [Shopify’s React Polaris components](https://polaris.shopify.com/components/get-started).
- [prettier](lib/config/prettier.js): Use [prettier](https://github.com/prettier/prettier) for consistent formatting. Extending this Shopify's prettier config will [override](https://github.com/prettier/eslint-config-prettier/blob/master/index.js) the default Shopify eslint rules in favor of prettier formatting. Prettier must be installed within your project, as eslint-plugin-shopify does not provide the dependency itself.
Expand Down
2 changes: 2 additions & 0 deletions lib/config/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
'babel',
'chai-expect',
'flowtype',
'graphql',
'import',
'jest',
'jsx-a11y',
Expand Down Expand Up @@ -50,6 +51,7 @@ module.exports = {
require('./rules/babel'),
require('./rules/chai-expect'),
require('./rules/flowtype'),
require('./rules/graphql'),
require('./rules/import'),
require('./rules/jest'),
require('./rules/jsx-a11y'),
Expand Down
7 changes: 7 additions & 0 deletions lib/config/graphql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
parser: 'babel-eslint',

plugins: ['graphql'],

rules: require('./rules/graphql'),
};
4 changes: 4 additions & 0 deletions lib/config/rules/graphql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
// uses graphql-config for schema mapping
'graphql/template-strings': ['error', {env: 'literal'}],
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"eslint": "^5.4.0",
"eslint-index": "^1.4.0",
"eslint-plugin-shopify": "file:./.",
"graphql": "^0.13.0",
"isparta": "^4.0.0",
"istanbul": "^0.4.5",
"mocha": "^5.1.1",
Expand All @@ -85,6 +86,7 @@
"eslint-plugin-babel": "5.1.0",
"eslint-plugin-chai-expect": "1.1.1",
"eslint-plugin-flowtype": "2.41.0",
"eslint-plugin-graphql": "2.1.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jest": "21.22.0",
"eslint-plugin-jsx-a11y": "6.1.1",
Expand Down
1 change: 1 addition & 0 deletions tests/lib/config/.graphqlconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
schemaPath: schema.graphql
3 changes: 3 additions & 0 deletions tests/lib/config/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Foo {
bar: String!
}
69 changes: 67 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,13 @@ core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"

cross-fetch@2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.2.tgz#a47ff4f7fc712daba8f6a695a11c948440d45723"
dependencies:
node-fetch "2.1.2"
whatwg-fetch "2.0.4"

cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
Expand Down Expand Up @@ -1531,6 +1538,13 @@ eslint-plugin-flowtype@2.41.0:
dependencies:
lodash "^4.15.0"

eslint-plugin-graphql@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-graphql/-/eslint-plugin-graphql-2.1.1.tgz#dae5d597080075320ea8e98795056309ffe73a18"
dependencies:
graphql-config "^2.0.1"
lodash "^4.11.1"

eslint-plugin-import@2.14.0:
version "2.14.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8"
Expand Down Expand Up @@ -1608,7 +1622,7 @@ eslint-plugin-react@7.11.1:
prop-types "^15.6.2"

"eslint-plugin-shopify@file:./.":
version "23.1.0"
version "24.0.0"
dependencies:
babel-eslint "9.0.0"
eslint-config-prettier "3.0.1"
Expand All @@ -1617,6 +1631,7 @@ eslint-plugin-react@7.11.1:
eslint-plugin-babel "5.1.0"
eslint-plugin-chai-expect "1.1.1"
eslint-plugin-flowtype "2.41.0"
eslint-plugin-graphql "2.1.1"
eslint-plugin-import "2.14.0"
eslint-plugin-jest "21.22.0"
eslint-plugin-jsx-a11y "6.1.1"
Expand All @@ -1628,6 +1643,7 @@ eslint-plugin-react@7.11.1:
eslint-plugin-react "7.11.1"
eslint-plugin-sort-class-members "1.3.1"
eslint-plugin-typescript "0.12.0"
graphql "^0.13.0"
merge "1.2.0"
pascal-case "^2.0.1"
pkg-dir "2.0.0"
Expand Down Expand Up @@ -2122,6 +2138,35 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.4:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"

graphql-config@^2.0.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-2.2.1.tgz#5fd0ec77ac7428ca5fb2026cf131be10151a0cb2"
dependencies:
graphql-import "^0.7.1"
graphql-request "^1.5.0"
js-yaml "^3.10.0"
lodash "^4.17.4"
minimatch "^3.0.4"

graphql-import@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/graphql-import/-/graphql-import-0.7.1.tgz#4add8d91a5f752d764b0a4a7a461fcd93136f223"
dependencies:
lodash "^4.17.4"
resolve-from "^4.0.0"

graphql-request@^1.5.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-1.8.2.tgz#398d10ae15c585676741bde3fc01d5ca948f8fbe"
dependencies:
cross-fetch "2.2.2"

graphql@^0.13.0:
version "0.13.2"
resolved "http://registry.npmjs.org/graphql/-/graphql-0.13.2.tgz#4c740ae3c222823e7004096f832e7b93b2108270"
dependencies:
iterall "^1.2.1"

growl@1.10.3:
version "1.10.3"
resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f"
Expand Down Expand Up @@ -2507,6 +2552,10 @@ istanbul@^0.4.0, istanbul@^0.4.5:
which "^1.1.1"
wordwrap "^1.0.0"

iterall@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7"

jest-docblock@^21.0.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"
Expand All @@ -2526,7 +2575,7 @@ js-yaml@3.x, js-yaml@^3.9.1:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^3.11.0:
js-yaml@^3.10.0, js-yaml@^3.11.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
dependencies:
Expand Down Expand Up @@ -2655,6 +2704,10 @@ lodash@^3.10.1:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"

lodash@^4.11.1:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"

lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.6.1, lodash@~4.17.0:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
Expand Down Expand Up @@ -2807,6 +2860,10 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"

node-fetch@2.1.2:
version "2.1.2"
resolved "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5"

node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
Expand Down Expand Up @@ -3356,6 +3413,10 @@ resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"

resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"

resolve@1.1.x:
version "1.1.7"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
Expand Down Expand Up @@ -3802,6 +3863,10 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"

whatwg-fetch@2.0.4:
version "2.0.4"
resolved "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"

whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
Expand Down