diff --git a/package.json b/package.json index dbd82ad792..efbbb21a02 100644 --- a/package.json +++ b/package.json @@ -50,24 +50,24 @@ "devDependencies": { "@ava/babel": "^1.0.1", "@lubien/fixture-beta-package": "^1.0.0-beta.1", - "@typescript-eslint/parser": "^2.33.0", - "ava": "^3.8.2", + "@typescript-eslint/parser": "^3.4.0", + "ava": "^3.9.0", "babel-eslint": "^10.1.0", - "chalk": "^4.0.0", - "eslint": "^7.0.0", + "chalk": "^4.1.0", + "eslint": "^7.3.0", "eslint-ava-rule-tester": "^4.0.0", - "eslint-plugin-eslint-plugin": "^2.2.1", - "execa": "^4.0.1", + "eslint-plugin-eslint-plugin": "^2.3.0", + "execa": "^4.0.2", "listr": "^0.14.3", - "nyc": "^15.0.1", + "nyc": "^15.1.0", "outdent": "^0.7.1", "pify": "^5.0.0", - "typescript": "^3.9.2", - "vue-eslint-parser": "^7.0.0", - "xo": "^0.30.0" + "typescript": "^3.9.5", + "vue-eslint-parser": "^7.1.0", + "xo": "^0.32.0" }, "peerDependencies": { - "eslint": ">=7.0.0" + "eslint": ">=7.3.0" }, "ava": { "babel": true, @@ -95,6 +95,7 @@ { "files": "rules/utils/*.js", "rules": { + "eslint-plugin/prefer-object-rule": "off", "eslint-plugin/require-meta-docs-url": "off" } }, @@ -107,14 +108,7 @@ ], "rules": { "strict": "error", - "array-callback-return": [ - "error", - { - "allowImplicit": true - } - ], - "unicorn/no-null": "error", - "unicorn/string-content": "off" + "unicorn/no-null": "error" } } } diff --git a/test/prefer-array-find.js b/test/prefer-array-find.js index 8f6a211611..b2576ebd19 100644 --- a/test/prefer-array-find.js +++ b/test/prefer-array-find.js @@ -312,24 +312,23 @@ ruleTester.run('prefer-array-find', rule, { ] }] }, - // // TODO: enable this test when ESLint support `nullish coalescing operator` - // { - // code: 'const [foo = a ?? b] = array.filter(bar)', - // output: 'const [foo = a ?? b] = array.filter(bar)', - // errors: [{ - // messageId: ERROR_DESTRUCTURING_DECLARATION, - // suggestions: [ - // { - // messageId: SUGGESTION_NULLISH_COALESCING_OPERATOR, - // output: 'const foo = array.find(bar) ?? (a ?? b)' - // }, - // { - // messageId: SUGGESTION_LOGICAL_OR_OPERATOR, - // output: 'const foo = array.find(bar) || (a ?? b)' - // } - // ] - // }] - // }, + { + code: 'const [foo = a ?? b] = array.filter(bar)', + output: 'const [foo = a ?? b] = array.filter(bar)', + errors: [{ + messageId: ERROR_DESTRUCTURING_DECLARATION, + suggestions: [ + { + messageId: SUGGESTION_NULLISH_COALESCING_OPERATOR, + output: 'const foo = array.find(bar) ?? (a ?? b)' + }, + { + messageId: SUGGESTION_LOGICAL_OR_OPERATOR, + output: 'const foo = array.find(bar) || (a ?? b)' + } + ] + }] + }, { code: 'const [foo = a || b] = array.filter(bar)', output: 'const [foo = a || b] = array.filter(bar)',