Skip to content

Commit 7d71310

Browse files
committed
Drop array.prototype.flatmap
1 parent 50492fe commit 7d71310

File tree

10 files changed

+17
-10
lines changed

10 files changed

+17
-10
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
},
102102
"dependencies": {
103103
"array.prototype.flat": "^1.3.1",
104-
"array.prototype.flatmap": "^1.3.1",
105104
"debug": "^3.2.7",
106105
"doctrine": "^2.1.0",
107106
"eslint-import-resolver-node": "^0.3.7",

src/rules/export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import ExportMap, { recursivePatternCapture } from '../ExportMap';
22
import docsUrl from '../docsUrl';
3-
import flatMap from 'array.prototype.flatmap';
43

54
const includes = Function.bind.bind(Function.prototype.call)(Array.prototype.includes);
5+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
66

77
/*
88
Notes on TypeScript namespaces aka TSModuleDeclaration:

tests/src/rules/namespace.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { test, SYNTAX_CASES, getTSParsers, testVersion, testFilePath, parsers } from '../utils';
22
import { RuleTester } from 'eslint';
3-
import flatMap from 'array.prototype.flatmap';
3+
4+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
45

56
const ruleTester = new RuleTester({ env: { es6: true } });
67
const rule = require('rules/namespace');

tests/src/rules/newline-after-import.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { RuleTester } from 'eslint';
2-
import flatMap from 'array.prototype.flatmap';
32
import semver from 'semver';
43
import { version as tsEslintVersion } from 'typescript-eslint-parser/package.json';
54

65
import { getTSParsers, parsers, testVersion } from '../utils';
76

7+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
8+
89
const IMPORT_ERROR_MESSAGE = 'Expected 1 empty line after import statement not followed by another import.';
910
const IMPORT_ERROR_MESSAGE_MULTIPLE = (count) => `Expected ${count} empty lines after import statement not followed by another import.`;
1011
const REQUIRE_ERROR_MESSAGE = 'Expected 1 empty line after require statement not followed by another require.';

tests/src/rules/no-cycle.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { parsers, test as _test, testFilePath, testVersion as _testVersion } from '../utils';
22

33
import { RuleTester } from 'eslint';
4-
import flatMap from 'array.prototype.flatmap';
4+
5+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
56

67
const ruleTester = new RuleTester();
78
const rule = require('rules/no-cycle');

tests/src/rules/no-duplicates.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import jsxConfig from '../../../config/react';
55
import { RuleTester } from 'eslint';
66
import eslintPkg from 'eslint/package.json';
77
import semver from 'semver';
8-
import flatMap from 'array.prototype.flatmap';
8+
9+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
910

1011
const ruleTester = new RuleTester();
1112
const rule = require('rules/no-duplicates');

tests/src/rules/no-dynamic-require.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { parsers, test, testVersion } from '../utils';
22

33
import { RuleTester } from 'eslint';
4-
import flatMap from 'array.prototype.flatmap';
4+
5+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
56

67
const ruleTester = new RuleTester();
78
const rule = require('rules/no-dynamic-require');

tests/src/rules/no-extraneous-dependencies.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import path from 'path';
44
import fs from 'fs';
55

66
import { RuleTester } from 'eslint';
7-
import flatMap from 'array.prototype.flatmap';
7+
8+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
89

910
const ruleTester = new RuleTester();
1011
const typescriptRuleTester = new RuleTester(typescriptConfig);

tests/src/rules/no-internal-modules.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { RuleTester } from 'eslint';
2-
import flatMap from 'array.prototype.flatmap';
32
import rule from 'rules/no-internal-modules';
43

54
import { test, testFilePath, getTSParsers } from '../utils';
65

6+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
7+
78
const ruleTester = new RuleTester();
89

910
ruleTester.run('no-internal-modules', rule, {

tests/src/rules/order.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import { test, getTSParsers, getNonDefaultParsers, testFilePath, parsers } from
33
import { RuleTester } from 'eslint';
44
import eslintPkg from 'eslint/package.json';
55
import semver from 'semver';
6-
import flatMap from 'array.prototype.flatmap';
76
import { resolve } from 'path';
87
import isCoreModule from 'is-core-module';
98
import { default as babelPresetFlow } from 'babel-preset-flow';
109

10+
const flatMap = Function.bind.bind(Function.prototype.call)(Array.prototype.flatMap);
11+
1112
const ruleTester = new RuleTester();
1213
const flowRuleTester = new RuleTester({
1314
parser: resolve(__dirname, '../../../node_modules/babel-eslint'),

0 commit comments

Comments
 (0)