Skip to content

Commit

Permalink
ci: fix jest/cypress clash that broke eslint locally
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Nov 19, 2019
1 parent 4de9408 commit 3bed71b
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 20 deletions.
26 changes: 19 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

const defaultPlugins = ['babel', 'import', 'flowtype', 'prefer-object-spread'];

const defaultPresets = ['prettier', 'plugin:import/typescript', 'plugin:react/recommended'];

module.exports = {
root: true,
parser: 'babel-eslint',
Expand All @@ -21,9 +24,9 @@ module.exports = {
},
},
settings: {
'react': {
'version': 'detect'
}
react: {
version: 'detect',
},
},
// https://github.com/sindresorhus/globals/blob/master/globals.json
env: {
Expand All @@ -33,10 +36,9 @@ module.exports = {
jest: true,
mocha: true,
browser: true,
'cypress/globals': true
},

extends: ['prettier', 'plugin:import/typescript', 'plugin:react/recommended'],
extends: defaultPresets,

globals: {
atom: false,
Expand Down Expand Up @@ -292,9 +294,19 @@ module.exports = {
'prefer-object-spread/prefer-object-spread': 1,
},

plugins: ['babel', 'import', 'flowtype', 'prefer-object-spread', 'cypress'],
plugins: defaultPlugins,

overrides: [
// Cypress plugin, global, etc only for cypress directory
// https://github.com/cypress-io/eslint-plugin-cypress
// cypress clashes with jest expect()
{
files: ['**/cypress/**'],
plugins: [...defaultPlugins, 'cypress'],
env: {
'cypress/globals': true,
},
},
// Rules for TypeScript only
{
files: ['*.ts', '*.tsx'],
Expand Down
2 changes: 1 addition & 1 deletion packages/codemirror-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"peerDependencies": {
"codemirror": "^5.26.0",
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0"
"graphql": ">=^0.12.0 <=^14.0.0"
},
"dependencies": {
"graphql-language-service-interface": "^2.3.0",
Expand Down
10 changes: 10 additions & 0 deletions packages/graphiql/graphiql.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build-demo": "cp resources/index.html .",
"check": "flow check",
"dev": "babel-node test/server.js",
"e2e": "yarn e2e:server && cypress run && kill -9 `cat test/pid`",
"e2e": "yarn e2e:server && cypress run",
"e2e:server": "PORT=8080 node test/e2e-server & wait-on http://localhost:8080",
"test": "node ../../resources/runTests ENZYME=true"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-language-service-interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"prepublish": "node ../../resources/prepublish.js"
},
"peerDependencies": {
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0"
"graphql": ">=^0.12.0 <=^14.0.0"
},
"dependencies": {
"graphql-config": "2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-language-service-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"prepublish": "node ../../resources/prepublish.js"
},
"peerDependencies": {
"graphql": "^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0"
"graphql": ">=^0.10.0 <=^14.0.0"
},
"dependencies": {
"graphql-config": "2.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql-language-service-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"build-flow": "node ../../resources/buildFlow.js",
"prepublish": "node ../../resources/prepublish.js"
},
"peerDependencies": {
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0"
"peerDependencies": {
"graphql": ">=^0.12.0 <=^14.0.0"
},
"dependencies": {
"@babel/parser": "^7.4.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-language-service-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"prepublish": "node ../../resources/prepublish.js"
},
"peerDependencies": {
"graphql": "^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0"
"graphql": ">= ^0.10.0 <= ^14.0.0"
},
"dependencies": {
"graphql-config": "2.2.1"
Expand Down
8 changes: 5 additions & 3 deletions packages/graphql-language-service-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
},
"license": "MIT",
"files": [
"dist",
"esm"
"dist"
],
"keywords": [
"graphql"
Expand All @@ -35,10 +34,13 @@
"prepublish": "node ../../resources/prepublish.js"
},
"peerDependencies": {
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0"
"graphql": ">=^0.12.0 <=^14.0.0"
},
"dependencies": {
"graphql-config": "2.2.1",
"graphql-language-service-types": "^1.5.0"
},
"devDependencies": {
"@types/jest": "^24.0.23"
}
}
4 changes: 3 additions & 1 deletion packages/graphql-language-service-utils/src/file.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ describe('requireFile', () => {
);
});
it('should require file with no extension using js', async () => {
const config = await requireFile(path.join(__dirname, '../../../jest.config'));
const config = await requireFile(
path.join(__dirname, '../../../jest.config'),
);
await expect(config.collectCoverage).toEqual(true);
});
it('should require file with no extension using json', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-language-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"prepublish": "node ../../resources/prepublish.js"
},
"peerDependencies": {
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0"
"graphql": ">=^0.12.0 <=^14.0.0"
},
"dependencies": {
"@babel/polyfill": "7.4.4",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2556,6 +2556,13 @@
dependencies:
"@types/jest-diff" "*"

"@types/jest@^24.0.23":
version "24.0.23"
resolved "https://registry.npmjs.org/@types/jest/-/jest-24.0.23.tgz#046f8e2ade026fe831623e361a36b6fb9a4463e4"
integrity sha512-L7MBvwfNpe7yVPTXLn32df/EK+AMBFAFvZrRuArGs7npEWnlziUXK+5GMIUTI4NIuwok3XibsjXCs5HxviYXjg==
dependencies:
jest-diff "^24.3.0"

"@types/json-schema@^7.0.3":
version "7.0.3"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636"
Expand Down Expand Up @@ -8325,7 +8332,7 @@ jest-config@^24.9.0:
pretty-format "^24.9.0"
realpath-native "^1.1.0"

jest-diff@^24.9.0:
jest-diff@^24.3.0, jest-diff@^24.9.0:
version "24.9.0"
resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da"
integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==
Expand Down

0 comments on commit 3bed71b

Please sign in to comment.