Skip to content

Commit cbc41c2

Browse files
authored
chore: update to eslint@8 (jestjs#12356)
1 parent 2953433 commit cbc41c2

File tree

11 files changed

+227
-294
lines changed

11 files changed

+227
-294
lines changed

.eslintplugin/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ exports.rules = {
99
'ban-types-eventually': require('@typescript-eslint/eslint-plugin').rules[
1010
'ban-types'
1111
],
12-
'prefer-rest-params-eventually': require('eslint/lib/rules/prefer-rest-params'),
13-
'prefer-spread-eventually': require('eslint/lib/rules/prefer-spread'),
12+
'prefer-rest-params-eventually':
13+
require('eslint/use-at-your-own-risk').builtinRules.get(
14+
'prefer-rest-params',
15+
),
16+
'prefer-spread-eventually':
17+
require('eslint/use-at-your-own-risk').builtinRules.get('prefer-spread'),
1418
};

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"@types/jest": "^26.0.15",
2323
"@types/node": "~12.12.0",
2424
"@types/which": "^2.0.0",
25-
"@typescript-eslint/eslint-plugin": "^4.1.0",
26-
"@typescript-eslint/parser": "^4.1.0",
25+
"@typescript-eslint/eslint-plugin": "^5.11.0",
26+
"@typescript-eslint/parser": "^5.11.0",
2727
"ansi-regex": "^5.0.1",
2828
"ansi-styles": "^5.0.0",
2929
"camelcase": "^6.2.0",
@@ -32,15 +32,15 @@
3232
"codecov": "^3.0.0",
3333
"debug": "^4.0.1",
3434
"dedent": "^0.7.0",
35-
"eslint": "^7.7.0",
35+
"eslint": "^8.8.0",
3636
"eslint-config-prettier": "^8.1.0",
3737
"eslint-import-resolver-typescript": "^2.5.0",
3838
"eslint-plugin-eslint-comments": "^3.1.2",
3939
"eslint-plugin-import": "^2.6.0",
40-
"eslint-plugin-jest": "^24.0.0",
40+
"eslint-plugin-jest": "^26.1.0",
4141
"eslint-plugin-local": "^1.0.0",
4242
"eslint-plugin-markdown": "^1.0.0",
43-
"eslint-plugin-prettier": "^3.0.1",
43+
"eslint-plugin-prettier": "^4.0.0",
4444
"execa": "^5.0.0",
4545
"fast-check": "^2.0.0",
4646
"find-process": "^1.4.1",

packages/expect-utils/src/utils.ts

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
*/
88

9-
/* eslint-disable local/ban-types-eventually */
10-
119
import {isPrimitive} from 'jest-get-type';
1210
import {
1311
equals,

packages/expect/src/asymmetricMatchers.ts

-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const utils = Object.freeze({
3838
subsetEquality,
3939
});
4040

41-
// eslint-disable-next-line @typescript-eslint/ban-types
4241
function getPrototype(obj: object) {
4342
if (Object.getPrototypeOf) {
4443
return Object.getPrototypeOf(obj);
@@ -51,7 +50,6 @@ function getPrototype(obj: object) {
5150
return obj.constructor.prototype;
5251
}
5352

54-
// eslint-disable-next-line @typescript-eslint/ban-types
5553
export function hasProperty(obj: object | null, property: string): boolean {
5654
if (!obj) {
5755
return false;

packages/jest-jasmine2/src/jasmine/Suite.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2929
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3030
*/
3131

32-
/* eslint-disable local/ban-types-eventually, sort-keys, local/prefer-spread-eventually, local/prefer-rest-params-eventually */
32+
/* eslint-disable sort-keys, local/prefer-spread-eventually, local/prefer-rest-params-eventually */
3333

3434
import type {Config} from '@jest/types';
3535
import {convertDescriptorToString} from 'jest-util';

packages/jest-leak-detector/src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
/* eslint-disable local/ban-types-eventually */
9-
108
import {promisify} from 'util';
119
import {setFlagsFromString} from 'v8';
1210
import {runInNewContext} from 'vm';

packages/jest-snapshot/src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
/* eslint-disable local/ban-types-eventually */
9-
108
import * as fs from 'graceful-fs';
119
import type {Config} from '@jest/types';
1210
import type {FS as HasteFS} from 'jest-haste-map';

packages/jest-snapshot/src/printSnapshot.ts

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
/* eslint-disable local/ban-types-eventually */
9-
108
import chalk = require('chalk');
119
import {getObjectSubset} from '@jest/expect-utils';
1210
import {

packages/jest-snapshot/src/types.ts

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
/* eslint-disable local/ban-types-eventually */
9-
108
import type {MatcherState} from 'expect';
119
import type SnapshotState from './State';
1210

packages/pretty-format/src/plugins/DOMCollection.ts

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
/* eslint-disable local/ban-types-eventually */
9-
108
import {printListItems, printObjectProperties} from '../collections';
119
import type {Config, NewPlugin, Printer, Refs} from '../types';
1210

0 commit comments

Comments
 (0)