Skip to content

Commit

Permalink
jettisoned a bunch of pre-ES6 polyfill dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed Sep 29, 2016
1 parent 632e49a commit 9880ae7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 14 deletions.
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,10 @@
"contains-path": "^0.1.0",
"debug": "^2.2.0",
"doctrine": "1.3.x",
"es6-map": "^0.1.3",
"es6-set": "^0.1.4",
"eslint-import-resolver-node": "^0.2.0",
"eslint-module-utils": "^1.0.0",
"has": "^1.0.1",
"lodash.cond": "^4.3.0",
"lodash.endswith": "^4.0.1",
"lodash.find": "^4.3.0",
"lodash.findindex": "^4.3.0",
"minimatch": "^3.0.3",
"pkg-up": "^1.0.0"
},
Expand Down
3 changes: 1 addition & 2 deletions src/rules/extensions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from 'path'
import endsWith from 'lodash.endswith'
import has from 'has'
import assign from 'object-assign'

Expand Down Expand Up @@ -79,7 +78,7 @@ module.exports = {
// for unresolved, use source value.
const extension = path.extname(resolvedPath || importPath).substring(1)

if (!extension || !endsWith(importPath, extension)) {
if (!extension || !importPath.endsWith(extension)) {
if (isUseOfExtensionRequired(extension) && !isUseOfExtensionForbidden(extension)) {
context.report({
node: source,
Expand Down
4 changes: 1 addition & 3 deletions src/rules/newline-after-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
*/

import isStaticRequire from '../core/staticRequire'
import findIndex from 'lodash.findindex'

import debug from 'debug'

const log = debug('eslint-plugin-import:rules:newline-after-import')

//------------------------------------------------------------------------------
Expand All @@ -33,7 +31,7 @@ function getScopeBody(scope) {
}

function findNodeIndexInScopeBody(body, nodeToFind) {
return findIndex(body, (node) => containsNodeOrEqual(node, nodeToFind))
return body.findIndex((node) => containsNodeOrEqual(node, nodeToFind))
}

function getLineDifference(node, nextNode) {
Expand Down
3 changes: 1 addition & 2 deletions src/rules/no-internal-modules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import find from 'lodash.find'
import minimatch from 'minimatch'

import resolve from 'eslint-module-utils/resolve'
Expand Down Expand Up @@ -31,7 +30,7 @@ module.exports = {

// test if reaching to this destination is allowed
function reachingAllowed(importPath) {
return !!find(allowRegexps, re => re.test(importPath))
return allowRegexps.some(re => re.test(importPath))
}

// minimatch patterns are expected to use / path separators, like import
Expand Down
3 changes: 1 addition & 2 deletions src/rules/order.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'

import find from 'lodash.find'
import importType from '../core/importType'
import isStaticRequire from '../core/staticRequire'

Expand Down Expand Up @@ -34,7 +33,7 @@ function findOutOfOrder(imported) {

function reportOutOfOrder(context, imported, outOfOrder, order) {
outOfOrder.forEach(function (imp) {
const found = find(imported, function hasHigherRank(importedItem) {
const found = imported.find(function hasHigherRank(importedItem) {
return importedItem.rank > imp.rank
})
context.report(imp.node, '`' + imp.name + '` import should occur ' + order +
Expand Down

0 comments on commit 9880ae7

Please sign in to comment.