eslint-plugin-import
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -6,6 +6,17 @@ # Change Log | ||
## [Unreleased] | ||
...add changes/fixes here... | ||
## [1.7.0] - 2016-05-06 | ||
### Added | ||
- [`newline-after-import`], new rule. ([#245], thanks [@singles]) | ||
- Added an `optionalDependencies` option to [`no-extraneous-dependencies`] to allow/forbid optional dependencies ([#266], thanks [@jfmengels]). | ||
- Added `newlines-between` option to [`order`] rule ([#298], thanks [@singles]) | ||
- add [`no-mutable-exports`] rule ([#290], thanks [@josh]) | ||
- [`import/extensions` setting]: a whitelist of file extensions to parse as modules | ||
and search for `export`s. If unspecified, all extensions are considered valid (for now). | ||
In v2, this will likely default to `['.js', MODULE_EXT]`,. ([#297], to fix [#267]) | ||
## resolvers/webpack: Unreleased | ||
### Fixed | ||
- [`extensions`]: fallback to source path for extension enforcement if imported | ||
module is not resolved. Also, never report for builtins (i.e. `path`). ([#296]) | ||
## resolvers/webpack/0.2.4 - 2016-04-29 | ||
### Changed | ||
@@ -105,3 +116,3 @@ - automatically find webpack config with `interpret`-able extensions ([#287], thanks [@taion]) | ||
- don't crash on self references ([#210]) | ||
- correct cache behavior in `eslint_d` for deep namespaces (#200) | ||
- correct cache behavior in `eslint_d` for deep namespaces ([#200]) | ||
@@ -177,2 +188,3 @@ ## [1.0.3] - 2016-02-26 | ||
[`import/ignore` setting]: ./README.md#importignore | ||
[`import/extensions` setting]: ./README.md#importextensions | ||
@@ -192,3 +204,9 @@ [`no-unresolved`]: ./docs/rules/no-unresolved.md | ||
[`named`]: ./docs/rules/named.md | ||
[`newline-after-import`]: ./docs/rules/newline-after-import.md | ||
[`no-mutable-exports`]: ./docs/rules/no-mutable-exports.md | ||
[#298]: https://github.com/benmosher/eslint-plugin-import/pull/298 | ||
[#297]: https://github.com/benmosher/eslint-plugin-import/pull/297 | ||
[#296]: https://github.com/benmosher/eslint-plugin-import/pull/296 | ||
[#290]: https://github.com/benmosher/eslint-plugin-import/pull/290 | ||
[#289]: https://github.com/benmosher/eslint-plugin-import/pull/289 | ||
@@ -203,2 +221,3 @@ [#288]: https://github.com/benmosher/eslint-plugin-import/pull/288 | ||
[#247]: https://github.com/benmosher/eslint-plugin-import/pull/247 | ||
[#245]: https://github.com/benmosher/eslint-plugin-import/pull/245 | ||
[#243]: https://github.com/benmosher/eslint-plugin-import/pull/243 | ||
@@ -209,4 +228,4 @@ [#241]: https://github.com/benmosher/eslint-plugin-import/pull/241 | ||
[#211]: https://github.com/benmosher/eslint-plugin-import/pull/211 | ||
[#164]: https://github.com/benmosher/eslint-plugin-import/pull/164 | ||
[#157]: https://github.com/benmosher/eslint-plugin-import/pull/157 | ||
[#164]: https://github.com/benmosher/eslint-plugin-import/pull/164 | ||
@@ -216,2 +235,4 @@ [#286]: https://github.com/benmosher/eslint-plugin-import/issues/286 | ||
[#272]: https://github.com/benmosher/eslint-plugin-import/issues/272 | ||
[#267]: https://github.com/benmosher/eslint-plugin-import/issues/267 | ||
[#266]: https://github.com/benmosher/eslint-plugin-import/issues/266 | ||
[#216]: https://github.com/benmosher/eslint-plugin-import/issues/216 | ||
@@ -228,3 +249,4 @@ [#214]: https://github.com/benmosher/eslint-plugin-import/issues/214 | ||
[Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v1.6.1...HEAD | ||
[Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v1.7.0...HEAD | ||
[1.7.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.6.1...v1.7.0 | ||
[1.6.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.6.0...v1.6.1 | ||
@@ -262,1 +284,2 @@ [1.6.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.5.0...1.6.0 | ||
[@SimenB]: https://github.com/SimenB | ||
[@josh]: https://github.com/josh |
@@ -5,2 +5,32 @@ 'use strict'; | ||
exports.default = ignore; | ||
var _path = require('path'); | ||
var _es6Set = require('es6-set'); | ||
var _es6Set2 = _interopRequireDefault(_es6Set); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// one-shot memoized | ||
var cachedSet = void 0, | ||
lastSettings = void 0; | ||
function validExtensions(_ref) { | ||
var settings = _ref.settings; | ||
if (cachedSet && settings === lastSettings) { | ||
return cachedSet; | ||
} | ||
// todo: add 'mjs'? | ||
lastSettings = settings; | ||
// breaking: default to '.js' | ||
// cachedSet = new Set(settings['import/extensions'] || [ '.js' ]) | ||
cachedSet = 'import/extensions' in settings ? new _es6Set2.default(settings['import/extensions']) : { has: function has() { | ||
return true; | ||
} }; // the set of all elements | ||
return cachedSet; | ||
} | ||
function ignore(path, context) { | ||
@@ -10,2 +40,5 @@ // ignore node_modules by default | ||
// check extension whitelist first (cheap) | ||
if (!validExtensions(context).has((0, _path.extname)(path))) return true; | ||
if (ignoreStrings.length === 0) return false; | ||
@@ -20,2 +53,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvcmUvaWdub3JlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztrQkFBd0I7QUFBVCxTQUFTLE1BQVQsQ0FBZ0IsSUFBaEIsRUFBc0IsT0FBdEIsRUFBK0I7O0FBRTVDLE1BQUksZ0JBQWdCLFFBQVEsUUFBUixDQUFpQixlQUFqQixJQUNoQixHQUFHLE1BQUgsQ0FBVSxRQUFRLFFBQVIsQ0FBaUIsZUFBakIsQ0FBVixDQURnQixHQUVoQixDQUFDLGNBQUQsQ0FGZ0IsQ0FGd0I7O0FBTTVDLE1BQUksY0FBYyxNQUFkLEtBQXlCLENBQXpCLEVBQTRCLE9BQU8sS0FBUCxDQUFoQzs7QUFFQSxPQUFLLElBQUksSUFBSSxDQUFKLEVBQU8sSUFBSSxjQUFjLE1BQWQsRUFBc0IsR0FBMUMsRUFBK0M7QUFDN0MsUUFBSSxRQUFRLElBQUksTUFBSixDQUFXLGNBQWMsQ0FBZCxDQUFYLENBQVIsQ0FEeUM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ByZXR1cm4gdHJ1ZVxuXG4gIGlmIChpZ25vcmVTdHJpbmdzLmxlbmd0aCA9PT0gMCkgcmV0dXJuIGZhbHNlXG5cbiAgZm9yICh2YXIgaSA9IDA7IGkgPCBpZ25vcmVTdHJpbmdzLmxlbmd0aDsgaSsrKSB7XG4gICAgdmFyIHJlZ2V4ID0gbmV3IFJlZ0V4cChpZ25vcmVTdHJpbmdzW2ldKVxuICAgIGlmIChyZWdleC50ZXN0KHBhdGgpKSByZXR1cm4gdHJ1ZVxuICB9XG5cbiAgcmV0dXJuIGZhbHNlXG59XG4iXX0= |
'use strict'; | ||
exports.__esModule = true; | ||
exports.isBuiltIn = isBuiltIn; | ||
exports.default = resolveImportType; | ||
@@ -66,2 +67,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvcmUvaW1wb3J0VHlwZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7a0JBc0R3Qjs7QUF0RHhCOzs7O0FBQ0E7Ozs7QUFDQTs7QUFFQTs7Ozs7O0FBRUEsU0FBUyxRQUFULENBQWtCLEtBQWxCLEVBQXlCO0FBQ3ZCLFNBQU87V0FBTTtHQUFOLENBRGdCO0NBQXpCOztBQUlBLFNBQVMsU0FBVCxDQUFtQixJQUFuQixFQUF5QjtBQUN2QixTQUFPLHlCQUFlLE9BQWYsQ0FBdUIsSUFBdkIsTUFBaUMsQ0FBQyxDQUFELENBRGpCO0NBQXpCOztBQUlBLElBQU0sdUJBQXVCLEtBQXZCO0FBQ04sU0FBUyxnQkFBVCxDQUEwQixJQUExQixFQUFnQyxJQUFoQyxFQUFzQztBQUNwQyxNQUFJLENBQUMscUJBQXFCLElBQXJCLENBQTBCLElBQTFCLENBQUQsRUFBa0MsT0FBTyxLQUFQLENBQXRDO0FBQ0EsU0FBUSxDQUFDLElBQUQsSUFBUyxDQUFDLENBQUQsR0FBSyxLQUFLLE9BQUwsQ0FBY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bXG4gIFtpc0J1aWx0SW4sIGNvbnN0YW50KCdidWlsdGluJyldLFxuICBbaXNFeHRlcm5hbE1vZHVsZSwgY29uc3RhbnQoJ2V4dGVybmFsJyldLFxuICBbaXNTY29wZWQsIGNvbnN0YW50KCdleHRlcm5hbCcpXSxcbiAgW2lzSW50ZXJuYWxNb2R1bGUsIGNvbnN0YW50KCdpbnRlcm5hbCcpXSxcbiAgW2lzUmVsYXRpdmVUb1BhcmVudCwgY29uc3RhbnQoJ3BhcmVudCcpXSxcbiAgW2lzSW5kZXgsIGNvbnN0YW50KCdpbmRleCcpXSxcbiAgW2lzUmVsYXRpdmVUb1NpYmxpbmcsIGNvbnN0YW50KCdzaWJsaW5nJyldLFxuICBbY29uc3RhbnQodHJ1ZSksIGNvbnN0YW50KCd1bmtub3duJyldLFxuXSlcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gcmVzb2x2ZUltcG9ydFR5cGUobmFtZSwgY29udGV4dCkge1xuICByZXR1cm4gdHlwZVRlc3QobmFtZSwgcmVzb2x2ZShuYW1lLCBjb250ZXh0KSlcbn1cbiJdfQ== |
@@ -11,2 +11,3 @@ 'use strict'; | ||
'export': require('./rules/export'), | ||
'no-mutable-exports': require('./rules/no-mutable-exports'), | ||
'extensions': require('./rules/extensions'), | ||
@@ -24,2 +25,3 @@ | ||
'order': require('./rules/order'), | ||
'newline-after-import': require('./rules/newline-after-import'), | ||
@@ -34,5 +36,8 @@ // metadata-based | ||
// useful stuff for folks using React | ||
'react': require('../config/react'), | ||
// shhhh... work in progress "secret" rules | ||
'stage-0': require('../config/stage-0') | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFPLElBQU0sd0JBQVE7QUFDbkIsbUJBQWlCLFFBQVEsdUJBQVIsQ0FBakI7QUFDQSxXQUFTLFFBQVEsZUFBUixDQU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var _resolve = require('../core/resolve'); | ||
@@ -14,6 +18,4 @@ | ||
var _lodash = require('lodash.endswith'); | ||
var _importType = require('../core/importType'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -44,13 +46,20 @@ | ||
var importPath = source.value; | ||
// don't enforce anything on builtins | ||
if ((0, _importType.isBuiltIn)(importPath)) return; | ||
var resolvedPath = (0, _resolve2.default)(importPath, context); | ||
var extension = _path2.default.extname(resolvedPath).substring(1); | ||
if (!(0, _lodash2.default)(importPath, extension)) { | ||
// get extension from resolved path, if possible. | ||
// for unresolved, use source value. | ||
var extension = _path2.default.extname(resolvedPath || importPath).substring(1); | ||
if (!extension || !(0, _lodash2.default)(importPath, extension)) { | ||
if (isUseOfExtensionEnforced(extension)) { | ||
context.report({ | ||
node: source, | ||
message: 'Missing file extension "' + extension + '" for "' + importPath + '"' | ||
message: 'Missing file extension ' + (extension ? '"' + extension + '" ' : '') + 'for "' + importPath + '"' | ||
}); | ||
} | ||
} else { | ||
} else if (extension) { | ||
if (!isUseOfExtensionEnforced(extension) && isResolvableWithoutExtension(importPath)) { | ||
@@ -80,2 +89,2 @@ context.report({ | ||
}]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL2V4dGVuc2lvbnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7O0FBRUEsT0FBTyxPQUFQLEdBQWlCLFVBQVUsT0FBVixFQUFtQjtBQUNsQyxNQUFNLGdCQUFnQixRQUFRLE9BQVIsQ0FBZ0IsQ0FBaEIsS0FBc0IsT0FBdEIsQ0FEWTs7QUFHbEMsV0FBUyx3QkFBVCxDQUFrQyxTQUFsQyxFQUE2QztBQUMzQyxRQUFJLFFBQU8scUVBQVAsS0FBeUIsUUFBekIsRUFBbUM7Q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UuZXhwb3J0cy5zY2hlbWEgPSBbXG4gIHtcbiAgICBvbmVPZjogW1xuICAgICAge1xuICAgICAgICBlbnVtOiBbICdhbHdheXMnLCAnbmV2ZXInIF0sXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiAnb2JqZWN0JyxcbiAgICAgICAgcGF0dGVyblByb3BlcnRpZXM6IHtcbiAgICAgICAgICAnLionOiB7IGVudW06IFsgJ2Fsd2F5cycsICduZXZlcicgXSB9LFxuICAgICAgICB9LFxuICAgICAgfSxcbiAgICBdLFxuICB9LFxuXVxuIl19 |
@@ -31,3 +31,4 @@ 'use strict'; | ||
dependencies: packageContent.dependencies || {}, | ||
devDependencies: packageContent.devDependencies || {} | ||
devDependencies: packageContent.devDependencies || {}, | ||
optionalDependencies: packageContent.optionalDependencies || {} | ||
}; | ||
@@ -40,10 +41,14 @@ } catch (e) { | ||
function missingErrorMessage(packageName) { | ||
return '\'' + packageName + '\' is not listed in the project\'s dependencies. ' + ('Run \'npm i -S ' + packageName + '\' to add it'); | ||
return '\'' + packageName + '\' should be listed in the project\'s dependencies. ' + ('Run \'npm i -S ' + packageName + '\' to add it'); | ||
} | ||
function devDepErrorMessage(packageName) { | ||
return '\'' + packageName + '\' is not listed in the project\'s dependencies, not devDependencies.'; | ||
return '\'' + packageName + '\' should be listed in the project\'s dependencies, not devDependencies.'; | ||
} | ||
function reportIfMissing(context, deps, allowDevDeps, node, name) { | ||
function optDepErrorMessage(packageName) { | ||
return '\'' + packageName + '\' should be listed in the project\'s dependencies, ' + 'not optionalDependencies.'; | ||
} | ||
function reportIfMissing(context, deps, allowDevDeps, allowOptDeps, node, name) { | ||
if ((0, _importType2.default)(name, context) !== 'external') { | ||
@@ -54,9 +59,21 @@ return; | ||
if (deps.dependencies[packageName] === undefined) { | ||
if (!allowDevDeps) { | ||
context.report(node, devDepErrorMessage(packageName)); | ||
} else if (deps.devDependencies[packageName] === undefined) { | ||
context.report(node, missingErrorMessage(packageName)); | ||
} | ||
var isInDeps = deps.dependencies[packageName] !== undefined; | ||
var isInDevDeps = deps.devDependencies[packageName] !== undefined; | ||
var isInOptDeps = deps.optionalDependencies[packageName] !== undefined; | ||
if (isInDeps || allowDevDeps && isInDevDeps || allowOptDeps && isInOptDeps) { | ||
return; | ||
} | ||
if (isInDevDeps && !allowDevDeps) { | ||
context.report(node, devDepErrorMessage(packageName)); | ||
return; | ||
} | ||
if (isInOptDeps && !allowOptDeps) { | ||
context.report(node, optDepErrorMessage(packageName)); | ||
return; | ||
} | ||
context.report(node, missingErrorMessage(packageName)); | ||
} | ||
@@ -67,2 +84,3 @@ | ||
var allowDevDeps = options.devDependencies !== false; | ||
var allowOptDeps = options.optionalDependencies !== false; | ||
var deps = getDependencies(context); | ||
@@ -77,7 +95,7 @@ | ||
ImportDeclaration: function ImportDeclaration(node) { | ||
reportIfMissing(context, deps, allowDevDeps, node, node.source.value); | ||
reportIfMissing(context, deps, allowDevDeps, allowOptDeps, node, node.source.value); | ||
}, | ||
CallExpression: function handleRequires(node) { | ||
if ((0, _staticRequire2.default)(node)) { | ||
reportIfMissing(context, deps, allowDevDeps, node, node.arguments[0].value); | ||
reportIfMissing(context, deps, allowDevDeps, allowOptDeps, node, node.arguments[0].value); | ||
} | ||
@@ -91,6 +109,7 @@ } | ||
'properties': { | ||
'devDependencies': { 'type': 'boolean' } | ||
'devDependencies': { 'type': 'boolean' }, | ||
'optionalDependencies': { 'type': 'boolean' } | ||
}, | ||
'additionalProperties': false | ||
}]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL25vLWV4dHJhbmVvdXMtZGVwZW5kZW5jaWVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUE7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7OztBQUVBLFNBQVMsZUFBVCxDQUF5QixPQUF6QixFQUFrQztBQUNoQyxNQUFNLFdBQVcsZ0JBQU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kZS5hcmd1bWVudHNbMF0udmFsdWUpXG4gICAgICB9XG4gICAgfSxcbiAgfVxufVxuXG5tb2R1bGUuZXhwb3J0cy5zY2hlbWEgPSBbXG4gIHtcbiAgICAndHlwZSc6ICdvYmplY3QnLFxuICAgICdwcm9wZXJ0aWVzJzoge1xuICAgICAgJ2RldkRlcGVuZGVuY2llcyc6IHsgJ3R5cGUnOiAnYm9vbGVhbicgfSxcbiAgICAgICdvcHRpb25hbERlcGVuZGVuY2llcyc6IHsgJ3R5cGUnOiAnYm9vbGVhbicgfSxcbiAgICB9LFxuICAgICdhZGRpdGlvbmFsUHJvcGVydGllcyc6IGZhbHNlLFxuICB9LFxuXVxuIl19 |
@@ -45,3 +45,3 @@ 'use strict'; | ||
function report(context, imported, outOfOrder, order) { | ||
function reportOutOfOrder(context, imported, outOfOrder, order) { | ||
outOfOrder.forEach(function (imp) { | ||
@@ -55,3 +55,3 @@ var found = (0, _lodash2.default)(imported, function hasHigherRank(importedItem) { | ||
function makeReport(context, imported) { | ||
function makeOutOfOrderReport(context, imported) { | ||
var outOfOrder = findOutOfOrder(imported); | ||
@@ -65,6 +65,6 @@ if (!outOfOrder.length) { | ||
if (reversedOrder.length < outOfOrder.length) { | ||
report(context, reversedImported, reversedOrder, 'after'); | ||
reportOutOfOrder(context, reversedImported, reversedOrder, 'after'); | ||
return; | ||
} | ||
report(context, imported, outOfOrder, 'before'); | ||
reportOutOfOrder(context, imported, outOfOrder, 'before'); | ||
} | ||
@@ -121,2 +121,25 @@ | ||
function makeNewlinesBetweenReport(context, imported, newlinesBetweenImports) { | ||
var getLineDifference = function getLineDifference(currentImport, previousImport) { | ||
return currentImport.node.loc.start.line - previousImport.node.loc.start.line; | ||
}; | ||
var previousImport = imported[0]; | ||
imported.slice(1).forEach(function (currentImport) { | ||
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) { | ||
context.report(previousImport.node, 'There should be no empty line within import group'); | ||
} | ||
} else { | ||
if (getLineDifference(currentImport, previousImport) > 1) { | ||
context.report(previousImport.node, 'There should be no empty line between import groups'); | ||
} | ||
} | ||
previousImport = currentImport; | ||
}); | ||
} | ||
module.exports = function importOrderRule(context) { | ||
@@ -162,3 +185,8 @@ var options = context.options[0] || {}; | ||
'Program:exit': function reportAndReset() { | ||
makeReport(context, imported); | ||
makeOutOfOrderReport(context, imported); | ||
if ('newlines-between' in options) { | ||
makeNewlinesBetweenReport(context, imported, options['newlines-between']); | ||
} | ||
imported = []; | ||
@@ -182,2 +210,5 @@ }, | ||
type: 'array' | ||
}, | ||
'newlines-between': { | ||
enum: ['always', 'never'] | ||
} | ||
@@ -187,2 +218,2 @@ }, | ||
}]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL29yZGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7O0FBRUEsSUFBTSxnQkFBZ0IsQ0FBQyxTQUFELEVBQVksVUFBWixFQUF3QixRQUF4QixFQUFrQyxTQUFsQyxFQUE2QyxPQUE3QyxDQUFoQjs7OztBQUlOLFNBQVMsT0FBVCxDQUFpQixLQUFqQixFQUF3QjtBQUN0QixTQUFPLE1BQU0sR0FBTixDQUFVLFVBQVUsQ0FBVixFQUFhO0FBQzVCLFdBQU87QUFDTCxZQUFNLEVBQUUsSUFBRjtBQUNOLFlBQU0sQ0FBQyxFQUFFLElBQUY7QUFDUCxZQUFNLEVBQUUsSUFBRjtLQUhSLENBRDRCO0dBQWIsQ0FBVixDQU1KLE9BTkksRUFBUCxDQURzQjtDQUF4Qjs7QUFVQSxTQUFTLGNBQVQsQ0FBd0IsUUFBeEIsRUFBa0M7QUFDaEMsTUF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ICAgaW1wb3J0ZWQgPSBbXVxuICAgIH0sXG4gICAgRnVuY3Rpb25EZWNsYXJhdGlvbjogaW5jcmVtZW50TGV2ZWwsXG4gICAgRnVuY3Rpb25FeHByZXNzaW9uOiBpbmNyZW1lbnRMZXZlbCxcbiAgICBBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbjogaW5jcmVtZW50TGV2ZWwsXG4gICAgQmxvY2tTdGF0ZW1lbnQ6IGluY3JlbWVudExldmVsLFxuICAgICdGdW5jdGlvbkRlY2xhcmF0aW9uOmV4aXQnOiBkZWNyZW1lbnRMZXZlbCxcbiAgICAnRnVuY3Rpb25FeHByZXNzaW9uOmV4aXQnOiBkZWNyZW1lbnRMZXZlbCxcbiAgICAnQXJyb3dGdW5jdGlvbkV4cHJlc3Npb246ZXhpdCc6IGRlY3JlbWVudExldmVsLFxuICAgICdCbG9ja1N0YXRlbWVudDpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMuc2NoZW1hID0gW1xuICB7XG4gICAgdHlwZTogJ29iamVjdCcsXG4gICAgcHJvcGVydGllczoge1xuICAgICAgZ3JvdXBzOiB7XG4gICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICB9LFxuICAgICAgJ25ld2xpbmVzLWJldHdlZW4nOiB7XG4gICAgICAgIGVudW06IFsgJ2Fsd2F5cycsICduZXZlcicgXSxcbiAgICAgIH0sXG4gICAgfSxcbiAgICBhZGRpdGlvbmFsUHJvcGVydGllczogZmFsc2UsXG4gIH0sXG5dXG4iXX0= |
{ | ||
"name": "eslint-plugin-import", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"description": "Import with sanity.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -33,2 +33,3 @@ # eslint-plugin-import | ||
* Forbid the use of extraneous packages ([`no-extraneous-dependencies`]) | ||
* Forbid the use of mutable exports with `var` or `let`. ([`no-mutable-exports`]) | ||
@@ -40,2 +41,3 @@ [`export`]: ./docs/rules/export.md | ||
[`no-extraneous-dependencies`]: ./docs/rules/no-extraneous-dependencies.md | ||
[`no-mutable-exports`]: ./docs/rules/no-mutable-exports.md | ||
@@ -59,2 +61,3 @@ **Module systems:** | ||
* Enforce a convention in module import order ([`order`]) | ||
* Enforce a newline after import statements ([`newline-after-import`]) | ||
@@ -66,2 +69,3 @@ [`imports-first`]: ./docs/rules/imports-first.md | ||
[`order`]: ./docs/rules/order.md | ||
[`newline-after-import`]: ./docs/rules/newline-after-import.md | ||
@@ -151,2 +155,17 @@ | ||
#### `import/extensions` | ||
A whitelist of file extensions that will be parsed as modules and inspected for | ||
`export`s. | ||
This will default to `['.js']` in the next major revision of this plugin, unless | ||
you are using the `react` shared config, in which case it is specified as `['.js', '.jsx']`. | ||
Note that this is different from (and likely a subset of) any `import/resolver` | ||
extensions settings, which may include `.json`, `.coffee`, etc. which will still | ||
factor into the `no-unresolved` rule. | ||
Also, `import/ignore` patterns will overrule this whitelist, so `node_modules` that | ||
end in `.js` will still be ignored by default. | ||
#### `import/ignore` | ||
@@ -153,0 +172,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
266795
41
2180
297