eslint-plugin-import
Advanced tools
Comparing version 1.8.0 to 1.8.1
@@ -6,2 +6,15 @@ # Change Log | ||
## resolvers/webpack/0.2.5 - 2016-05-23 | ||
### Added | ||
- Added support for multiple webpack configs ([#181], thanks [@GreenGremlin]) | ||
## [1.8.1] - 2016-05-23 | ||
### Fixed | ||
- `export * from 'foo'` now properly ignores a `default` export from `foo`, if any. ([#328]/[#332], thanks [@jkimbo]) | ||
This impacts all static analysis of imported names. ([`default`], [`named`], [`namespace`], [`export`]) | ||
- Make [`order`]'s `newline-between` option handle multiline import statements ([#313], thanks [@singles]) | ||
- Make [`order`]'s `newline-between` option handle not assigned import statements ([#313], thanks [@singles]) | ||
- Make [`order`]'s `newline-between` option ignore `require` statements inside object literals ([#313], thanks [@singles]) | ||
- [`prefer-default-export`] properly handles deep destructuring, `export * from ...`, and files with no exports. ([#342]+[#343], thanks [@scottnonnenberg]) | ||
## [1.8.0] - 2016-05-11 | ||
@@ -210,2 +223,4 @@ ### Added | ||
[`named`]: ./docs/rules/named.md | ||
[`default`]: ./docs/rules/default.md | ||
[`export`]: ./docs/rules/export.md | ||
[`newline-after-import`]: ./docs/rules/newline-after-import.md | ||
@@ -215,2 +230,4 @@ [`no-mutable-exports`]: ./docs/rules/no-mutable-exports.md | ||
[#343]: https://github.com/benmosher/eslint-plugin-import/pull/343 | ||
[#332]: https://github.com/benmosher/eslint-plugin-import/pull/332 | ||
[#322]: https://github.com/benmosher/eslint-plugin-import/pull/322 | ||
@@ -241,3 +258,6 @@ [#316]: https://github.com/benmosher/eslint-plugin-import/pull/316 | ||
[#342]: https://github.com/benmosher/eslint-plugin-import/issues/342 | ||
[#328]: https://github.com/benmosher/eslint-plugin-import/issues/328 | ||
[#317]: https://github.com/benmosher/eslint-plugin-import/issues/317 | ||
[#313]: https://github.com/benmosher/eslint-plugin-import/issues/313 | ||
[#286]: https://github.com/benmosher/eslint-plugin-import/issues/286 | ||
@@ -259,3 +279,4 @@ [#281]: https://github.com/benmosher/eslint-plugin-import/issues/281 | ||
[Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v1.8.0...HEAD | ||
[Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v1.8.1...HEAD | ||
[1.8.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.8.0...v1.8.1 | ||
[1.8.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.7.0...v1.8.0 | ||
@@ -298,1 +319,3 @@ [1.7.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.6.1...v1.7.0 | ||
[@gavriguy]: https://github.com/gavriguy | ||
[@jkimbo]: https://github.com/jkimbo | ||
[@scottnonnenberg]: https://github.com/scottnonnenberg |
@@ -280,22 +280,25 @@ 'use strict'; | ||
for (var _iterator = this.dependencies.values(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
// default exports must be explicitly re-exported (#328) | ||
if (name !== 'default') { | ||
for (var _iterator = this.dependencies.values(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var dep = _ref; | ||
var dep = _ref; | ||
var innerMap = dep(); | ||
var innerMap = dep(); | ||
// todo: report as unresolved? | ||
if (!innerMap) continue; | ||
// todo: report as unresolved? | ||
if (!innerMap) continue; | ||
if (innerMap.has(name)) return true; | ||
if (innerMap.has(name)) return true; | ||
} | ||
} | ||
@@ -335,27 +338,30 @@ | ||
for (var _iterator2 = this.dependencies.values(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
var _ref2; | ||
// default exports must be explicitly re-exported (#328) | ||
if (name !== 'default') { | ||
for (var _iterator2 = this.dependencies.values(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
var _ref2; | ||
if (_isArray2) { | ||
if (_i2 >= _iterator2.length) break; | ||
_ref2 = _iterator2[_i2++]; | ||
} else { | ||
_i2 = _iterator2.next(); | ||
if (_i2.done) break; | ||
_ref2 = _i2.value; | ||
} | ||
if (_isArray2) { | ||
if (_i2 >= _iterator2.length) break; | ||
_ref2 = _iterator2[_i2++]; | ||
} else { | ||
_i2 = _iterator2.next(); | ||
if (_i2.done) break; | ||
_ref2 = _i2.value; | ||
} | ||
var dep = _ref2; | ||
var dep = _ref2; | ||
var innerMap = dep(); | ||
// todo: report as unresolved? | ||
if (!innerMap) continue; | ||
var innerMap = dep(); | ||
// todo: report as unresolved? | ||
if (!innerMap) continue; | ||
// safeguard against cycles | ||
if (innerMap.path === this.path) continue; | ||
// safeguard against cycles | ||
if (innerMap.path === this.path) continue; | ||
var innerValue = innerMap.hasDeep(name); | ||
if (innerValue.found) { | ||
innerValue.path.unshift(this); | ||
return innerValue; | ||
var innerValue = innerMap.hasDeep(name); | ||
if (innerValue.found) { | ||
innerValue.path.unshift(this); | ||
return innerValue; | ||
} | ||
} | ||
@@ -386,25 +392,28 @@ } | ||
for (var _iterator3 = this.dependencies.values(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
var _ref3; | ||
// default exports must be explicitly re-exported (#328) | ||
if (name !== 'default') { | ||
for (var _iterator3 = this.dependencies.values(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
var _ref3; | ||
if (_isArray3) { | ||
if (_i3 >= _iterator3.length) break; | ||
_ref3 = _iterator3[_i3++]; | ||
} else { | ||
_i3 = _iterator3.next(); | ||
if (_i3.done) break; | ||
_ref3 = _i3.value; | ||
} | ||
if (_isArray3) { | ||
if (_i3 >= _iterator3.length) break; | ||
_ref3 = _iterator3[_i3++]; | ||
} else { | ||
_i3 = _iterator3.next(); | ||
if (_i3.done) break; | ||
_ref3 = _i3.value; | ||
} | ||
var dep = _ref3; | ||
var dep = _ref3; | ||
var innerMap = dep(); | ||
// todo: report as unresolved? | ||
if (!innerMap) continue; | ||
var innerMap = dep(); | ||
// todo: report as unresolved? | ||
if (!innerMap) continue; | ||
// safeguard against cycles | ||
if (innerMap.path === this.path) continue; | ||
// safeguard against cycles | ||
if (innerMap.path === this.path) continue; | ||
var innerValue = innerMap.get(name); | ||
if (innerValue !== undefined) return innerValue; | ||
var innerValue = innerMap.get(name); | ||
if (innerValue !== undefined) return innerValue; | ||
} | ||
} | ||
@@ -430,3 +439,3 @@ | ||
return dep().forEach(function (v, n) { | ||
return callback.call(thisArg, v, n, _this); | ||
return n !== 'default' && callback.call(thisArg, v, n, _this); | ||
}); | ||
@@ -533,2 +542,2 @@ }); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvcmUvZ2V0RXhwb3J0cy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztRQXNYZ0I7O0FBdFhoQjs7QUFDQTs7OztBQUVBOztJQUFZOztBQUVaOztBQUNBOztJQUFZOztBQUVaOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUVBOzs7Ozs7OztBQUVBLElBQU0sY0FBYyxzQkFBZDs7Ozs7Ozs7QUFRTixJQUFNLGFBQWEsSUFBSSxNQUFKLENBQVcsZ0NBQVgsQ0FBYjs7SUFFZTtBQUNuQixXQURtQixTQUNuQixDQUFZLElBQVosRUFBa0I7MEJBREMsV0FDRDs7QUFDaEIsU0FBSyxJQUF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aWVyLm5hbWUpKSByZXR1cm5cblxuICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHJlc29sdmVJbXBvcnQobmFtZXNwYWNlcy5nZXQoaWRlbnRpZmllci5uYW1lKSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBhZGROYW1lc3BhY2Uob2JqZWN0LCBpZGVudGlmaWVyKSB7XG4gICAgICBjb25zdCBuc2ZuID0gZ2V0TmFtZXNwYWNlKGlkZW50aWZpZXIpXG4gICAgICBpZiAobnNmbikge1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqZWN0LCAnbmFtZXNwYWNlJywgeyBnZXQ6IG5zZm4gfSlcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIG9iamVjdFxuICAgIH1cblxuXG4gICAgYXN0LmJvZHkuZm9yRWFjaChmdW5jdGlvbiAobikge1xuXG4gICAgICBpZiAobi50eXBlID09PSAnRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uJykge1xuICAgICAgICBjb25zdCBleHBvcnRNZXRhID0gY2FwdHVyZURvYyhuKVxuICAgICAgICBpZiAobi5kZWNsYXJhdGlvbi50eXBlID09PSAnSWRlbnRpZmllcicpIHtcbiAgICAgICAgICBhZGROYW1lc3BhY2UoZXhwb3J0TWV0YSwgbi5kZWNsYXJhdGlvbilcbiAgICAgICAgfVxuICAgICAgICBtLm5hbWVzcGFjZS5zZXQoJ2RlZmF1bHQnLCBleHBvcnRNZXRhKVxuICAgICAgICByZXR1cm5cbiAgICAgIH1cblxuICAgICAgaWYgKG4udHlwZSA9PT0gJ0V4cG9ydEFsbERlY2xhcmF0aW9uJykge1xuICAgICAgICBsZXQgcmVtb3RlTWFwID0gcmVtb3RlUGF0aChuKVxuICAgICAgICBpZiAocmVtb3RlTWFwID09IG51bGwpIHJldHVyblxuICAgICAgICBtLmRlcGVuZGVuY2llcy5zZXQocmVtb3RlTWFwLCAoKSA9PiBFeH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A9PlxuICAgICAgICAgICAgICAgIHJlY3Vyc2l2ZVBhdHRlcm5DYXB0dXJlKGQuaWQsIGlkID0+IG0ubmFtZXNwYWNlLnNldChpZC5uYW1lLCBjYXB0dXJlRG9jKGQsIG4pKSkpXG4gICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbi5zcGVjaWZpZXJzLmZvckVhY2goKHMpID0+IHtcbiAgICAgICAgICBjb25zdCBleHBvcnRNZXRhID0ge31cbiAgICAgICAgICBsZXQgbG9jYWxcblxuICAgICAgICAgIHN3aXRjaCAocy50eXBlKSB7XG4gICAgICAgICAgICBjYXNlICdFeHBvcnREZWZhdWx0U3BlY2lmaWVyJzpcbiAgICAgICAgICAgICAgaWYgKCFuLnNvdXJjZSkgcmV0dXJuXG4gICAgICAgICAgICAgIGxvY2FsID0gJ2RlZmF1bHQnXG4gICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICBjYXNlICdFeHBvcnROYW1lc3BhY2VTcGVjaWZpZXInOlxuICAgICAgICAgICAgICBtLm5hbWVzcGFjZS5zZXQocy5leHBvcnRlZC5uYW1lLCBPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0TWV0YSwgJ25hbWVzcGFjZScsIHtcbiAgICAgICAgICAgICAgICBnZXQoKSB7IHJldHVybiByZXNvbHZlSW1wb3J0KG4pIH0sXG4gICAgICAgICAgICAgIH0pKVxuICAgICAgICAgICAgICByZXR1cm5cbiAgICAgICAgICAgIGNhc2UgJ0V4cG9ydFNwZWNpZmllcic6XG4gICAgICAgICAgICAgIGlmICghbi5zb3VyY2UpIHtcbiAgICAgICAgICAgICAgICBtLm5hbWVzcGFjZS5zZXQocy5leHBvcnRlZC5uYW1lLCBhZGROYW1lc3BhY2UoZXhwb3J0TWV0YSwgcy5sb2NhbCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLy8gZWx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AgICAgICBsZXQgbnNcbiAgICAgICAgaWYgKG4uc3BlY2lmaWVycy5zb21lKHMgPT4gcy50eXBlID09PSAnSW1wb3J0TmFtZXNwYWNlU3BlY2lmaWVyJyAmJiAobnMgPSBzKSkpIHtcbiAgICAgICAgICBuYW1lc3BhY2VzLnNldChucy5sb2NhbC5uYW1lLCBuKVxuICAgICAgICB9XG4gICAgICAgIHJldHVyblxuICAgICAgfVxuXG4gICAgICBpZiAobi50eXBlID09PSAnRXhwb3J0TmFtZWREZWNsYXJhdGlvbicpe1xuICAgICAgICAvLyBjYXB0dXJlIGRlY2xhcmF0aW9uXG4gICAgICAgIGlmIChuLmRlY2xhcmF0aW9uICE9IG51bGwpIHtcbiAgICAgICAgICBzd2l0Y2ggKG4uZGVjbGFyYXRpb24udHlwZSkge1xuICAgICAgICAgICAgY2FzZSAnRnVuY3Rpb25EZWNsYXJhdGlvbic6XG4gICAgICAgICAgICBjYXNlICdDbGFzc0RlY2xhcmF0aW9uJzpcbiAgICAgICAgICAgIGNhc2UgJ1R5cGVBbGlhcyc6IC8vIGZsb3d0eXBlIHdpdGggYmFiZWwtZXNsaW50IHBhcnNlclxuICAgICAgICAgICAgICBtLm5hbWVzcGFjZS5zZXQobi5kZWNsYXJhdGlvbi5pZC5uYW1lLCBjYXB0dXJlRG9jKG4pKVxuICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgY2FzZSAnVmFyaWFibGVEZWNsYXJhdGlvbic6XG4gICAgICAgICAgICAgIG4uZGVjbGFyYXRpb24uZGVjbGFyYXRpb25zLmZvckVhY2goKGQpID0+XG4gICAgICAgICAgICAgICAgcmVjdXJzaXZlUGF0dGVybkNhcHR1cmUoZC5pZCwgaWQgPT4gbS5uYW1lc3BhY2Uuc2V0KGlkLm5hbWUsIGNhcHR1cmVEb2MoZCwgbikpKSlcbiAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBuLnNwZWNpZmllcnMuZm9yRWFjaCgocykgPT4ge1xuICAgICAgICAgIGNvbnN0IGV4cG9ydE1ldGEgPSB7fVxuICAgICAgICAgIGxldCBsb2NhbFxuXG4gICAgICAgICAgc3dpdGNoIChzLnR5cGUpIHtcbiAgICAgICAgICAgIGNhc2UgJ0V4cG9ydERlZmF1bHRTcGVjaWZpZXInOlxuICAgICAgICAgICAgICBpZiAoIW4uc291cmNlKSByZXR1cm5cbiAgICAgICAgICAgICAgbG9jYWwgPSAnZGVmYXVsdCdcbiAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgIGNhc2UgJ0V4cG9ydE5hbWVzcGFjZVNwZWNpZmllcic6XG4gICAgICAgICAgICAgIG0ubmFtZXNwYWNlLnNldChzLmV4cG9ydGVkLm5hbWUsIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRNZXRhLCAnbmFtZXNwYWNlJywge1xuICAgICAgICAgICAgICAgIGdldCgpIHsgcmV0dXJuIHJlc29sdmVJbXBvcnQobikgfSxcbiAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICAgIHJldHVyblxuICAgICAgICAgICAgY2FzZSAnRXhwb3J0U3BlY2lmaWVyJzpcbiAgICAgICAgICAgICAgaWYgKCFuLnNvdXJjZSkge1xuICAgICAgICAgICAgICAgIG0ubmFtZXNwYWNlLnNldChzLmV4cG9ydGVkLm5hbWUsIGFkZE5hbWVzcGFjZShleHBvcnRNZXRhLCBzLmxvY2FsKSlcbiAgICAgICAgICAgICAgICByZXR1cm5cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAvLyBlbHNlIGZhbGxzIHRocm91Z2hcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgIGxvY2FsID0gcy5sb2NhbC5uYW1lXG4gICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gdG9kbzogSlNEb2NcbiAgICAgICAgICBtLnJlZXhwb3J0cy5zZXQocy5leHBvcnRlZC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JuLnR5cGUpIHtcbiAgICBjYXNlICdJZGVudGlmaWVyJzogLy8gYmFzZSBjYXNlXG4gICAgICBjYWxsYmFjayhwYXR0ZXJuKVxuICAgICAgYnJlYWtcblxuICAgIGNhc2UgJ09iamVjdFBhdHRlcm4nOlxuICAgICAgcGF0dGVybi5wcm9wZXJ0aWVzLmZvckVhY2goKHsgdmFsdWUgfSkgPT4ge1xuICAgICAgICByZWN1cnNpdmVQYXR0ZXJuQ2FwdHVyZSh2YWx1ZSwgY2FsbGJhY2spXG4gICAgICB9KVxuICAgICAgYnJlYWtcblxuICAgIGNhc2UgJ0FycmF5UGF0dGVybic6XG4gICAgICBwYXR0ZXJuLmVsZW1lbnRzLmZvckVhY2goKGVsZW1lbnQpID0+IHtcbiAgICAgICAgaWYgKGVsZW1lbnQgPT0gbnVsbCkgcmV0dXJuXG4gICAgICAgIHJlY3Vyc2l2ZVBhdHRlcm5DYXB0dXJlKGVsZW1lbnQsIGNhbGxiYWNrKVxuICAgICAgfSlcbiAgICAgIGJyZWFrXG4gIH1cbn1cbiJdfQ== |
@@ -83,3 +83,4 @@ 'use strict'; | ||
remoteExports.forEach(function (v, name) { | ||
return (any = true) && addNamed(name, node); | ||
return name !== 'default' && (any = true) && // poor man's filter | ||
addNamed(name, node); | ||
}); | ||
@@ -133,2 +134,2 @@ | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL2V4cG9ydC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBOztBQUNBOzs7O0FBQ0E7Ozs7QUFFQTs7Ozs7O0FBRUEsT0FBTyxPQUFQLEdBQWlCLFVBQVUsT0FBVixFQUFtQjtBQUNsQyxNQUFNLFFBQVEsc0JBQVIsQ0FENEI7O0FBR2xDLFdBQVMsUUFBVCxDQUFrQixJQUFsQixFQUF3QixJQUF4QixFQUE4QjtBQUM1QixRQUFJLFFBQVEsTUFBTSxHQUFO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cyBmb3VuZCBpbiBtb2R1bGUgJyR7bm9kZS5zb3VyY2UudmFsdWV9Jy5gKVxuICAgICAgfVxuICAgIH0sXG5cbiAgICAnUHJvZ3JhbTpleGl0JzogZnVuY3Rpb24gKCkge1xuICAgICAgZm9yIChsZXQgW25hbWUsIG5vZGVzXSBvZiBuYW1lZCkge1xuICAgICAgICBpZiAobm9kZXMuc2l6ZSA8PSAxKSBjb250aW51ZVxuXG4gICAgICAgIGZvciAobGV0IG5vZGUgb2Ygbm9kZXMpIHtcbiAgICAgICAgICBpZiAobmFtZSA9PT0gJ2RlZmF1bHQnKSB7XG4gICAgICAgICAgICBjb250ZXh0LnJlcG9ydChub2RlLCAnTXVsdGlwbGUgZGVmYXVsdCBleHBvcnRzLicpXG4gICAgICAgICAgfSBlbHNlIGNvbnRleHQucmVwb3J0KG5vZGUsIGBNdWx0aXBsZSBleHBvcnRzIG9mIG5hbWUgJyR7bmFtZX0nLmApXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICB9XG59XG4iXX0= |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _lodash = require('lodash.findindex'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -14,39 +18,108 @@ | ||
function getLineDifference(node, nextToken) { | ||
return nextToken.loc.start.line - node.loc.start.line; | ||
} /** | ||
* @fileoverview Rule to enforce new line after import not followed by another import. | ||
* @author Radek Benkel | ||
*/ | ||
/** | ||
* @fileoverview Rule to enforce new line after import not followed by another import. | ||
* @author Radek Benkel | ||
*/ | ||
function ensureNoForbiddenKeyword(context, node, tokenToInspect, tokenValue) { | ||
if (!tokenToInspect) { | ||
return; | ||
function containsNodeOrEqual(outerNode, innerNode) { | ||
return outerNode.range[0] <= innerNode.range[0] && outerNode.range[1] >= innerNode.range[1]; | ||
} | ||
function getScopeBody(scope) { | ||
var body = scope.block.body; | ||
if (body.type === 'BlockStatement') { | ||
return body.body; | ||
} | ||
if (getLineDifference(node, tokenToInspect) === 1 && tokenToInspect.type === 'Keyword' && tokenToInspect.value !== tokenValue) { | ||
context.report({ | ||
loc: tokenToInspect.loc.start, | ||
message: 'Expected empty line after ' + tokenValue + ' statement not followed by another ' + tokenValue + '.' | ||
}); | ||
} | ||
return body; | ||
} | ||
function findNodeIndexInScopeBody(scope, nodeToFind) { | ||
var body = getScopeBody(scope); | ||
return (0, _lodash2.default)(body, function (node) { | ||
return containsNodeOrEqual(node, nodeToFind); | ||
}); | ||
} | ||
function getLineDifference(node, nextNode) { | ||
return nextNode.loc.start.line - node.loc.end.line; | ||
} | ||
module.exports = function (context) { | ||
var scopes = []; | ||
var scopeIndex = 0; | ||
function checkForNewLine(node, nextNode, type) { | ||
if (getLineDifference(node, nextNode) < 2) { | ||
var column = node.loc.start.column; | ||
if (node.loc.start.line !== node.loc.end.line) { | ||
column = 0; | ||
} | ||
context.report({ | ||
loc: { | ||
line: node.loc.end.line, | ||
column: column | ||
}, | ||
message: 'Expected empty line after ' + type + ' statement not followed by another ' + type + '.' | ||
}); | ||
} | ||
} | ||
return { | ||
ImportDeclaration: function ImportDeclaration(node) { | ||
var nextToken = context.getSourceCode(node).getTokenAfter(node); | ||
var parent = node.parent; | ||
ensureNoForbiddenKeyword(context, node, nextToken, 'import'); | ||
var nodePosition = parent.body.indexOf(node); | ||
var nextNode = parent.body[nodePosition + 1]; | ||
if (nextNode && nextNode.type !== 'ImportDeclaration') { | ||
checkForNewLine(node, nextNode, 'import'); | ||
} | ||
}, | ||
Program: function Program() { | ||
scopes.push({ scope: context.getScope(), requireCalls: [] }); | ||
}, | ||
CallExpression: function CallExpression(node) { | ||
var scope = context.getScope(); | ||
if ((0, _staticRequire2.default)(node)) { | ||
var nextTokens = context.getSourceCode(node).getTokensAfter(node, 2); | ||
var tokenToInspect = nextTokens.length > 1 && nextTokens[0].type === 'Punctuator' ? nextTokens[1] : nextTokens[0]; | ||
var currentScope = scopes[scopeIndex]; | ||
ensureNoForbiddenKeyword(context, node, tokenToInspect, 'require'); | ||
if (scope === currentScope.scope) { | ||
currentScope.requireCalls.push(node); | ||
} else { | ||
scopes.push({ scope: scope, requireCalls: [node] }); | ||
scopeIndex += 1; | ||
} | ||
} | ||
}, | ||
'Program:exit': function ProgramExit() { | ||
scopes.forEach(function (_ref) { | ||
var scope = _ref.scope; | ||
var requireCalls = _ref.requireCalls; | ||
requireCalls.forEach(function (node, index) { | ||
var scopeBody = getScopeBody(scope); | ||
var nodePosition = findNodeIndexInScopeBody(scope, node); | ||
var statementWithRequireCall = scopeBody[nodePosition]; | ||
var nextStatement = scopeBody[nodePosition + 1]; | ||
var nextRequireCall = requireCalls[index + 1]; | ||
if (nextRequireCall && containsNodeOrEqual(statementWithRequireCall, nextRequireCall)) { | ||
return; | ||
} | ||
if (nextStatement && (!nextRequireCall || !containsNodeOrEqual(nextStatement, nextRequireCall))) { | ||
checkForNewLine(statementWithRequireCall, nextStatement, 'require'); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL25ld2xpbmUtYWZ0ZXItaW1wb3J0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBS0E7Ozs7Ozs7Ozs7QUFNQSxTQUFTLGlCQUFULENBQTJCLElBQTNCLEVBQWlDLFNBQWpDLEVBQTRDO0FBQzFDLFNBQU8sVUFBVSxHQUFWLENBQWMsS0FBZCxDQUFvQixJQUFwQixHQUEyQixLQUFLLEdBQUwsQ0FBUyxLQUFULENBQWUsSUFBZixDQURRO0NBQTVDOzs7OztBQUlBLFNBQVMsd0JBQVQsQ0FBa0MsT0FBbEMsRUFBMkMsSUFBM0MsRUFBaUQsY0FBakQsRUFBaUUsVUFBakUsRUFBNkU7QUFDM0UsTUFBSSxDQUFDLGNBQUQsRUFBaUI7QUFDbkIsV0FEbUI7R0FBckI7O0FBS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ckVxdWFsKHN0YXRlbWVudFdpdGhSZXF1aXJlQ2FsbCwgbmV4dFJlcXVpcmVDYWxsKSkge1xuICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKG5leHRTdGF0ZW1lbnQgJiZcbiAgICAgICAgICAgICAoIW5leHRSZXF1aXJlQ2FsbCB8fCAhY29udGFpbnNOb2RlT3JFcXVhbChuZXh0U3RhdGVtZW50LCBuZXh0UmVxdWlyZUNhbGwpKSkge1xuXG4gICAgICAgICAgICBjaGVja0Zvck5ld0xpbmUoc3RhdGVtZW50V2l0aFJlcXVpcmVDYWxsLCBuZXh0U3RhdGVtZW50LCAncmVxdWlyZScpXG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfSlcbiAgICB9LFxuICB9XG59XG4iXX0= |
@@ -19,4 +19,43 @@ 'use strict'; | ||
function checkImports(imported, context) { | ||
for (var _iterator = imported.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var _ref2 = _ref; | ||
var _module = _ref2[0]; | ||
var nodes = _ref2[1]; | ||
if (nodes.size > 1) { | ||
for (var _iterator2 = nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
var _ref3; | ||
if (_isArray2) { | ||
if (_i2 >= _iterator2.length) break; | ||
_ref3 = _iterator2[_i2++]; | ||
} else { | ||
_i2 = _iterator2.next(); | ||
if (_i2.done) break; | ||
_ref3 = _i2.value; | ||
} | ||
var node = _ref3; | ||
context.report(node, '\'' + _module + '\' imported multiple times.'); | ||
} | ||
} | ||
} | ||
} | ||
module.exports = function (context) { | ||
var imported = new _es6Map2.default(); | ||
var typesImported = new _es6Map2.default(); | ||
return { | ||
@@ -26,7 +65,8 @@ 'ImportDeclaration': function ImportDeclaration(n) { | ||
var resolvedPath = (0, _resolve2.default)(n.source.value, context) || n.source.value; | ||
var importMap = n.importKind === 'type' ? typesImported : imported; | ||
if (imported.has(resolvedPath)) { | ||
imported.get(resolvedPath).add(n.source); | ||
if (importMap.has(resolvedPath)) { | ||
importMap.get(resolvedPath).add(n.source); | ||
} else { | ||
imported.set(resolvedPath, new _es6Set2.default([n.source])); | ||
importMap.set(resolvedPath, new _es6Set2.default([n.source])); | ||
} | ||
@@ -36,40 +76,7 @@ }, | ||
'Program:exit': function ProgramExit() { | ||
for (var _iterator = imported.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var _ref2 = _ref; | ||
var _module = _ref2[0]; | ||
var nodes = _ref2[1]; | ||
if (nodes.size > 1) { | ||
for (var _iterator2 = nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
var _ref3; | ||
if (_isArray2) { | ||
if (_i2 >= _iterator2.length) break; | ||
_ref3 = _iterator2[_i2++]; | ||
} else { | ||
_i2 = _iterator2.next(); | ||
if (_i2.done) break; | ||
_ref3 = _i2.value; | ||
} | ||
var node = _ref3; | ||
context.report(node, '\'' + _module + '\' imported multiple times.'); | ||
} | ||
} | ||
} | ||
checkImports(imported, context); | ||
checkImports(typesImported, context); | ||
} | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL25vLWR1cGxpY2F0ZXMuanMiXSwibmFtZXMiOltdLCJtYXB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dmVkIHBhdGggd2lsbCBjb3ZlciBhbGlhc2VkIGR1cGxpY2F0ZXNcbiAgICAgIGNvbnN0IHJlc29sdmVkUGF0aCA9IHJlc29sdmUobi5zb3VyY2UudmFsdWUsIGNvbnRleHQpIHx8IG4uc291cmNlLnZhbHVlXG4gICAgICBjb25zdCBpbXBvcnRNYXAgPSBuLmltcG9ydEtpbmQgPT09ICd0eXBlJyA/IHR5cGVzSW1wb3J0ZWQgOiBpbXBvcnRlZFxuXG4gICAgICBpZiAoaW1wb3J0TWFwLmhhcyhyZXNvbHZlZFBhdGgpKSB7XG4gICAgICAgIGltcG9ydE1hcC5nZXQocmVzb2x2ZWRQYXRoKS5hZGQobi5zb3VyY2UpXG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpbXBvcnRNYXAuc2V0KHJlc29sdmVkUGF0aCwgbmV3IFNldChbbi5zb3VyY2VdKSlcbiAgICAgIH1cbiAgICB9LFxuXG4gICAgJ1Byb2dyYW06ZXhpdCc6IGZ1bmN0aW9uICgpIHtcbiAgICAgIGNoZWNrSW1wb3J0cyhpbXBvcnRlZCwgY29udGV4dClcbiAgICAgIGNoZWNrSW1wb3J0cyh0eXBlc0ltcG9ydGVkLCBjb250ZXh0KVxuICAgIH0sXG4gIH1cbn1cbiJdfQ== |
@@ -119,4 +119,8 @@ 'use strict'; | ||
function makeNewlinesBetweenReport(context, imported, newlinesBetweenImports) { | ||
var getLineDifference = function getLineDifference(currentImport, previousImport) { | ||
return currentImport.node.loc.start.line - previousImport.node.loc.start.line; | ||
var getNumberOfEmptyLinesBetween = function getNumberOfEmptyLinesBetween(currentImport, previousImport) { | ||
var linesBetweenImports = context.getSourceCode().lines.slice(previousImport.node.loc.end.line, currentImport.node.loc.start.line - 1); | ||
return linesBetweenImports.filter(function (line) { | ||
return !line.trim().length; | ||
}).length; | ||
}; | ||
@@ -127,9 +131,9 @@ var previousImport = imported[0]; | ||
if (newlinesBetweenImports === 'always') { | ||
if (currentImport.rank !== previousImport.rank && getLineDifference(currentImport, previousImport) !== 2) { | ||
context.report(previousImport.node, 'There should be one empty line between import groups'); | ||
} else if (currentImport.rank === previousImport.rank && getLineDifference(currentImport, previousImport) >= 2) { | ||
if (currentImport.rank !== previousImport.rank && getNumberOfEmptyLinesBetween(currentImport, previousImport) === 0) { | ||
context.report(previousImport.node, 'There should be at least one empty line between import groups'); | ||
} else if (currentImport.rank === previousImport.rank && getNumberOfEmptyLinesBetween(currentImport, previousImport) > 0) { | ||
context.report(previousImport.node, 'There should be no empty line within import group'); | ||
} | ||
} else { | ||
if (getLineDifference(currentImport, previousImport) > 1) { | ||
if (getNumberOfEmptyLinesBetween(currentImport, previousImport) > 0) { | ||
context.report(previousImport.node, 'There should be no empty line between import groups'); | ||
@@ -195,6 +199,8 @@ } | ||
BlockStatement: incrementLevel, | ||
ObjectExpression: incrementLevel, | ||
'FunctionDeclaration:exit': decrementLevel, | ||
'FunctionExpression:exit': decrementLevel, | ||
'ArrowFunctionExpression:exit': decrementLevel, | ||
'BlockStatement:exit': decrementLevel | ||
'BlockStatement:exit': decrementLevel, | ||
'ObjectExpression:exit': decrementLevel | ||
}; | ||
@@ -215,2 +221,2 @@ }; | ||
}]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL29yZGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7O0FBRUEsSUFBTSxnQkFBZ0IsQ0FBQyxTQUFELEVBQVksVUFBWixFQUF3QixRQUF4QixFQUFrQyxTQUFsQyxFQUE2QyxPQUE3QyxDQUFoQjs7OztBQUlOLFNBQVMsT0FBVCxDQUFpQixLQUFqQixFQUF3QjtBQUN0QixTQUFPLE1BQU0sR0FBTixDQUFVLFVBQVUsQ0FBVixFQUFhO0FBQzVCLFdBQU87QUFDTCxZQUFNLEVBQUUsSUFBRjtBQUNOLFlBQU0sQ0F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VsLFxuICAgICdBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgJ0Jsb2NrU3RhdGVtZW50OmV4aXQnOiBkZWNyZW1lbnRMZXZlbCxcbiAgICAnT2JqZWN0RXhwcmVzc2lvbjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMuc2NoZW1hID0gW1xuICB7XG4gICAgdHlwZTogJ29iamVjdCcsXG4gICAgcHJvcGVydGllczoge1xuICAgICAgZ3JvdXBzOiB7XG4gICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICB9LFxuICAgICAgJ25ld2xpbmVzLWJldHdlZW4nOiB7XG4gICAgICAgIGVudW06IFsgJ2Fsd2F5cycsICduZXZlcicgXSxcbiAgICAgIH0sXG4gICAgfSxcbiAgICBhZGRpdGlvbmFsUHJvcGVydGllczogZmFsc2UsXG4gIH0sXG5dXG4iXX0= |
'use strict'; | ||
module.exports = function (context) { | ||
var namedExportCount = 0; | ||
var specifierExportCount = 0; | ||
var hasDefaultExport = false; | ||
var hasStarExport = false; | ||
var namedExportNode = null; | ||
return { | ||
@@ -17,6 +18,28 @@ 'ExportSpecifier': function ExportSpecifier(node) { | ||
}, | ||
'ExportNamedDeclaration': function ExportNamedDeclaration(node) { | ||
namedExportCount++; | ||
// if there are specifiers, node.declaration should be null | ||
if (!node.declaration) return; | ||
function captureDeclaration(identifierOrPattern) { | ||
if (identifierOrPattern.type === 'ObjectPattern') { | ||
// recursively capture | ||
identifierOrPattern.properties.forEach(function (property) { | ||
captureDeclaration(property.value); | ||
}); | ||
} else { | ||
// assume it's a single standard identifier | ||
specifierExportCount++; | ||
} | ||
} | ||
if (node.declaration.declarations) { | ||
node.declaration.declarations.forEach(function (declaration) { | ||
captureDeclaration(declaration.id); | ||
}); | ||
} | ||
namedExportNode = node; | ||
}, | ||
'ExportDefaultDeclaration': function ExportDefaultDeclaration() { | ||
@@ -26,4 +49,8 @@ hasDefaultExport = true; | ||
'ExportAllDeclaration': function ExportAllDeclaration() { | ||
hasStarExport = true; | ||
}, | ||
'Program:exit': function ProgramExit() { | ||
if (namedExportCount === 1 && specifierExportCount < 2 && !hasDefaultExport) { | ||
if (specifierExportCount === 1 && !hasDefaultExport && !hasStarExport) { | ||
context.report(namedExportNode, 'Prefer default export.'); | ||
@@ -34,2 +61,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL3ByZWZlci1kZWZhdWx0LWV4cG9ydC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQSxPQUFPLE9BQVAsR0FBaUIsVUFBUyxPQUFULEVBQWtCO0FBQ2pDLE1BQUksbUJBQW1CLENBQW5CLENBRDZCO0FBRWpDLE1BQUksdUJBQXVCLENBQXZCLENBRjZCO0FBR2pDLE1BQUksbUJBQW1CLEtBQW5CLENBSDZCO0FBSWpDLE1BQUksa0JBQWtCLElBQWxCLENBSjZCO0FBS2pDLFNBQU87QUFDTCx1QkFBbUIseUJBQVMsSUFBVCxFQUFlO0FBQ2hDLFVBQUksS0FBSyxRQUFMLENBQWMsSUFBZCxLQUF1QixTQUF2QixFQUFrQztBQUNwQywyQkFBbUIsSUFBbkIsQ0FEb0M7T0FBdEMsTUFFTztBQUNMLCtCQURLO0FBRUwsMEJBQWtCLElBQWxCLENBRks7T0FGUDtLQURpQjtBQVFuQiw4QkFBMEIsZ0NBQVMsSUFBVCxFQUFlO0FBQ3ZDLHlCQUR1QztBQUV2Qyx3QkFBa0IsSUFBbEIsQ0FGdUM7S0FBZjtBQUkxQixnQ0FBNEIsb0NBQVc7QUFDckMseUJBQW1CLElBQW5CLENBRHFDO0tBQVg7O0FBSTVCLG9CQUFnQix1QkFBVztBQUN6QixVQUFJLHFCQUFxQixDQUFyQixJQUEyQix1QkFBdUIsQ0FBdkIsSUFBNEIs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S5kZWNsYXJhdGlvbi5kZWNsYXJhdGlvbnMuZm9yRWFjaChmdW5jdGlvbihkZWNsYXJhdGlvbikge1xuICAgICAgICAgIGNhcHR1cmVEZWNsYXJhdGlvbihkZWNsYXJhdGlvbi5pZClcbiAgICAgICAgfSlcbiAgICAgIH1cblxuICAgICAgbmFtZWRFeHBvcnROb2RlID0gbm9kZVxuICAgIH0sXG5cbiAgICAnRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uJzogZnVuY3Rpb24oKSB7XG4gICAgICBoYXNEZWZhdWx0RXhwb3J0ID0gdHJ1ZVxuICAgIH0sXG5cbiAgICAnRXhwb3J0QWxsRGVjbGFyYXRpb24nOiBmdW5jdGlvbigpIHtcbiAgICAgIGhhc1N0YXJFeHBvcnQgPSB0cnVlXG4gICAgfSxcblxuICAgICdQcm9ncmFtOmV4aXQnOiBmdW5jdGlvbigpIHtcbiAgICAgIGlmIChzcGVjaWZpZXJFeHBvcnRDb3VudCA9PT0gMSAmJiAhaGFzRGVmYXVsdEV4cG9ydCAmJiAhaGFzU3RhckV4cG9ydCkge1xuICAgICAgICBjb250ZXh0LnJlcG9ydChuYW1lZEV4cG9ydE5vZGUsICdQcmVmZXIgZGVmYXVsdCBleHBvcnQuJylcbiAgICAgIH1cbiAgICB9LFxuICB9XG59XG4iXX0= |
{ | ||
"name": "eslint-plugin-import", | ||
"version": "1.8.0", | ||
"version": "1.8.1", | ||
"description": "Import with sanity.", | ||
@@ -77,2 +77,3 @@ "main": "lib/index.js", | ||
"lodash.find": "^4.3.0", | ||
"lodash.findindex": "^4.3.0", | ||
"object-assign": "^4.0.1", | ||
@@ -79,0 +80,0 @@ "pkg-up": "^1.0.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
284218
2308
13
+ Addedlodash.findindex@^4.3.0
+ Addedlodash.findindex@4.6.0(transitive)