Skip to content

Commit e7244bd

Browse files
committed
chore: format/eslint fixes
1 parent c9dab6a commit e7244bd

File tree

3 files changed

+499
-94
lines changed

3 files changed

+499
-94
lines changed

.eslintrc.js

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
node: true,
3131
browser: true,
3232
jest: true,
33+
'jest/globals': true,
3334
},
3435

3536
extends: [
@@ -294,6 +295,9 @@ module.exports = {
294295
'react/prefer-stateless-function': 'error',
295296
'react/react-in-jsx-scope': 'error',
296297
'react/self-closing-comp': 'error',
298+
'react/display-name': 'warn',
299+
// Jest rules
300+
'jest/no-conditional-expect': 0,
297301
},
298302

299303
plugins: ['import', 'prefer-object-spread', '@typescript-eslint'],
@@ -310,14 +314,18 @@ module.exports = {
310314
},
311315
},
312316
{
317+
excludedFiles: ['**/cypress/**/*.{js,ts}'],
313318
files: [
314-
'packages/{*graphql-*,graphiql}/src/**',
315319
'**/__{tests,mocks}__/*.{js,jsx,ts,tsx}',
320+
'**/*.spec.{ts,js.jsx.tsx}',
316321
],
317322
extends: ['plugin:jest/recommended'],
318323
env: {
319324
'jest/globals': true,
320325
},
326+
rules: {
327+
'jest/no-conditional-expect': 0,
328+
},
321329
},
322330
// Rules for TypeScript only
323331
{
@@ -326,28 +334,6 @@ module.exports = {
326334
'no-unused-vars': 'off',
327335
},
328336
},
329-
// Rules for Babel & Flow only
330-
{
331-
files: ['packages/codemirror-graphql/src/**/*.js'],
332-
parser: 'babel-eslint',
333-
plugins: ['flowtype', 'babel'],
334-
rules: {
335-
// flowtype (https://github.com/gajus/eslint-plugin-flowtype)
336-
'flowtype/boolean-style': 1,
337-
'flowtype/define-flow-type': 1,
338-
'flowtype/no-dupe-keys': 0,
339-
'flowtype/no-primitive-constructor-types': 1,
340-
'flowtype/no-weak-types': 0,
341-
'flowtype/require-parameter-type': 0,
342-
'flowtype/require-return-type': 0,
343-
'flowtype/require-valid-file-annotation': 0,
344-
'flowtype/require-variable-type': 0,
345-
'flowtype/sort-keys': 0,
346-
'flowtype/type-id-match': 0,
347-
'flowtype/use-flow-type': 1,
348-
'flowtype/valid-syntax': 0,
349-
},
350-
},
351337
{
352338
// Converted from 'dependencies' options in ancient config
353339
files: ['**/spec/**', '**/sample-*/**'],

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"eslint": "eslint --ext=ts,js,jsx,tsx .",
5151
"lint": "yarn eslint && yarn lint-check && yarn pretty-check",
5252
"lint-fix": "yarn eslint --fix",
53-
"lint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
53+
"lint-check": "eslint-config-prettier .eslintrc.js",
5454
"check": "flow check --show-all-errors && yarn tsc --dry",
5555
"pretty": "node resources/pretty.js",
5656
"pretty-check": "node resources/pretty.js --check",
@@ -88,24 +88,24 @@
8888
"@types/prettier": "^2.0.0",
8989
"@types/theme-ui": "^0.3.1",
9090
"@types/ws": "^7.4.0",
91-
"@typescript-eslint/eslint-plugin": "^2.27.0",
92-
"@typescript-eslint/parser": "^2.27.0",
91+
"@typescript-eslint/eslint-plugin": "^4.14.0",
92+
"@typescript-eslint/parser": "^4.14.0",
9393
"babel-eslint": "^10.1.0",
9494
"babel-jest": "^25.3.0",
9595
"conventional-changelog-conventionalcommits": "^4.2.3",
9696
"copy": "^0.3.2",
9797
"cross-env": "^7.0.2",
9898
"cypress": "^4.7.0",
99-
"eslint": "^6.8.0",
100-
"eslint-config-prettier": "^6.10.1",
99+
"eslint": "^7.18.0",
100+
"eslint-config-prettier": "^7.2.0",
101101
"eslint-plugin-babel": "^5.3.0",
102102
"eslint-plugin-cypress": "^2.10.3",
103103
"eslint-plugin-flowtype": "4.7.0",
104104
"eslint-plugin-import": "^2.20.2",
105-
"eslint-plugin-jest": "^23.8.2",
106-
"eslint-plugin-prefer-object-spread": "1.2.1",
107-
"eslint-plugin-react": "7.19.0",
108-
"eslint-plugin-react-hooks": "^3.0.0",
105+
"eslint-plugin-jest": "^24.1.3",
106+
"eslint-plugin-prefer-object-spread": "^1.2.1",
107+
"eslint-plugin-react": "^7.22.0",
108+
"eslint-plugin-react-hooks": "^4.2.0",
109109
"fetch-mock": "6.5.2",
110110
"flow-bin": "^0.119.1",
111111
"graphql": "^15.4.0",

0 commit comments

Comments
 (0)