Skip to content

Commit 6ac573e

Browse files
committed
ci: fix jest/cypress clash that broke eslint locally
1 parent f96d9d0 commit 6ac573e

File tree

13 files changed

+100
-37
lines changed

13 files changed

+100
-37
lines changed

.eslintrc.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* This source code is licensed under the license found in the
66
* LICENSE file in the root directory of this source tree.
77
*
8-
* @flow
98
*/
109

1110
module.exports = {
@@ -21,9 +20,9 @@ module.exports = {
2120
},
2221
},
2322
settings: {
24-
'react': {
25-
'version': 'detect'
26-
}
23+
react: {
24+
version: 'detect',
25+
},
2726
},
2827
// https://github.com/sindresorhus/globals/blob/master/globals.json
2928
env: {
@@ -33,7 +32,6 @@ module.exports = {
3332
jest: true,
3433
mocha: true,
3534
browser: true,
36-
'cypress/globals': true
3735
},
3836

3937
extends: ['prettier', 'plugin:import/typescript', 'plugin:react/recommended'],
@@ -292,9 +290,19 @@ module.exports = {
292290
'prefer-object-spread/prefer-object-spread': 1,
293291
},
294292

295-
plugins: ['babel', 'import', 'flowtype', 'prefer-object-spread', 'cypress'],
293+
plugins: ['babel', 'import', 'flowtype', 'prefer-object-spread'],
296294

297295
overrides: [
296+
// Cypress plugin, global, etc only for cypress directory
297+
// https://github.com/cypress-io/eslint-plugin-cypress
298+
// cypress clashes with jest expect()
299+
{
300+
files: ['**/cypress/**'],
301+
plugins: ['cypress'],
302+
env: {
303+
'cypress/globals': true,
304+
},
305+
},
298306
// Rules for TypeScript only
299307
{
300308
files: ['*.ts', '*.tsx'],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"jest-environment-jsdom": "^24.8.0",
8181
"jest-environment-jsdom-global": "^1.2.0",
8282
"lerna": "^3.16.4",
83+
"mkdirp": "^0.5.1",
8384
"mocha": "6.1.4",
8485
"prettier": "^1.18.2",
8586
"rimraf": "^3.0.0",

packages/codemirror-graphql/.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/codemirror-graphql/package.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@
1414
},
1515
"license": "MIT",
1616
"files": [
17-
"esm",
18-
"*.js",
19-
"*.flow",
17+
"hint.esm.js",
18+
"hint.js",
19+
"hint.js.flow",
20+
"info.esm.js",
21+
"info.js",
22+
"info.js.flow",
23+
"jump.esm.js",
24+
"jump.js",
25+
"jump.js.flow",
26+
"lint.esm.js",
27+
"lint.js",
28+
"lint.js.flow",
29+
"mode.esm.js",
30+
"mode.js",
31+
"mode.js.flow",
2032
"utils",
2133
"variables",
2234
"results"
@@ -31,7 +43,7 @@
3143
"build": "yarn build-clean && yarn build-js && yarn build-esm && yarn build-flow .",
3244
"build-js": "babel src --root-mode upward --ignore src/__tests__ --out-dir . && babel src --root-mode upward --ignore src/__tests__ --out-dir esm && node ../../resources/renameFileExtensions.js './esm/**/*.js' . .esm.js",
3345
"build-esm": "ESM=true babel src --root-mode upward --ignore src/__tests__ --out-dir esm",
34-
"build-clean": "rimraf {mode,hint,info,jump,lint}.{js,js.flow} && rimraf esm results utils variables coverage __tests__",
46+
"build-clean": "rimraf {mode,hint,info,jump,lint}.{js,esm.js,js.flow} && rimraf esm results utils variables coverage __tests__",
3547
"build-flow": "node ../../resources/buildFlow.js",
3648
"watch": "babel --optional runtime resources/watch.js | node",
3749
"prepublish": "node ../../resources/prepublish.js",

packages/graphiql/.babelrc.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/graphiql/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@
3535
"build-demo": "cp resources/index.html .",
3636
"check": "flow check",
3737
"dev": "babel-node test/server.js",
38+
<<<<<<< HEAD
3839
"e2e": "yarn e2e:server && cypress run && kill -9 `cat test/pid`",
3940
"e2e:server": "PORT=8080 node test/e2e-server & wait-on http://localhost:8080",
41+
=======
42+
"e2e": "yarn e2e:server && cypress run",
43+
"e2e:server": "PORT=8080 node test/e2e-server & ; wait-on http://localhost:8080",
44+
>>>>>>> ci: fix jest/cypress clash that broke eslint locally
4045
"test": "node ../../resources/runTests ENZYME=true"
4146
},
4247
"lint-staged": {

packages/graphql-language-service-types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"main": "dist/index.js",
2424
"module": "esm/index.js",
25-
"typings": "src/index.ts",
25+
"typings": "dist/index.d.ts",
2626
"scripts": {
2727
"build": "yarn run build-ts && yarn run build-flow",
2828
"build-ts": "tsc",

packages/graphql-language-service-utils/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
},
1515
"license": "MIT",
1616
"files": [
17-
"dist",
18-
"esm"
17+
"dist"
1918
],
2019
"keywords": [
2120
"graphql"
@@ -40,5 +39,8 @@
4039
"dependencies": {
4140
"graphql-config": "2.2.1",
4241
"graphql-language-service-types": "^1.5.0"
42+
},
43+
"devDependencies": {
44+
"@types/jest": "^24.0.23"
4345
}
4446
}

packages/graphql-language-service-utils/src/file.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ describe('requireFile', () => {
6060
);
6161
});
6262
it('should require file with no extension using js', async () => {
63-
const config = await requireFile(path.join(__dirname, '../../../jest.config'));
63+
const config = await requireFile(
64+
path.join(__dirname, '../../../jest.config'),
65+
);
6466
await expect(config.collectCoverage).toEqual(true);
6567
});
6668
it('should require file with no extension using json', async () => {

packages/graphql-language-service-utils/tsconfig.esm.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"compilerOptions": {
44
"rootDir": "./src",
55
"outDir": "./esm",
6-
}
6+
},
7+
"references": [
8+
{
9+
"path": "../graphql-language-service-types"
10+
}
11+
]
712
}

0 commit comments

Comments
 (0)