Skip to content

Commit

Permalink
fix: add flat-map-polyfill to dependencies and use in `no-undefined-t…
Browse files Browse the repository at this point in the history
…ypes` in place of (unpublished and large) core-js
  • Loading branch information
brettz9 committed Jun 21, 2019
1 parent 8254e70 commit 142ac17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependencies": {
"comment-parser": "^0.5.5",
"debug": "^4.1.1",
"flat-map-polyfill": "^0.3.8",
"jsdoctypeparser": "4.0.0",
"lodash": "^4.17.11"
},
Expand All @@ -22,7 +23,6 @@
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-istanbul": "^5.1.4",
"chai": "^4.2.0",
"core-js": "^3.1.4",
"eslint": "^5.14.1",
"eslint-config-canonical": "^17.1.1",
"gitdown": "^2.5.8",
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noUndefinedTypes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line import/no-unassigned-import
import 'core-js/stable/array/flat-map';
import 'flat-map-polyfill';
import _ from 'lodash';
import {parse as parseType, traverse} from 'jsdoctypeparser';
import iterateJsdoc, {parseComment} from '../iterateJsdoc';
Expand Down

2 comments on commit 142ac17

@binury
Copy link

@binury binury commented on 142ac17 Aug 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is polluting Array.prototype

@gajus
Copy link
Owner

@gajus gajus commented on 142ac17 Aug 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brettz9 – I am going to agree with this. It is not up to individual libraries to bring their own polyfills.

Apps can polyfill as much they want. Libraries must be isolated to their package.

Please use lodash provided flatMap.

Please sign in to comment.