{"engines":{"node":">= 4"},"main":"index.js","license":"MIT","name":"eslint-import-resolver-alias","version":"1.0.3","description":"a simple Node behavior import resolution plugin for eslint-plugin-import, supporting module alias.","scripts":{"test":"mocha test/test.js --require test/setup.js","cov":"istanbul cover node_modules/mocha/bin/_mocha -i index.js -- test/test.js --require test/setup.js"},"keywords":["eslint","eslintplugin","modules","alias","eslint-plugin-import"],"author":{"name":"johvin"},"devDependencies":{"istanbul":"^1.0.0-alpha.2","mocha":"^3.2.0"},"gitHead":"6ca48194e1b770f6e4d590f3c3e5cb5ef3c29d28","_id":"eslint-import-resolver-alias@1.0.3","_shasum":"297c4023e9de33e09724b519c261fa7be0f1842e","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"johvin","email":"johvin10@gmail.com"},"dist":{"shasum":"297c4023e9de33e09724b519c261fa7be0f1842e","tarball":"http://registry-npm.ywwl.com/eslint-import-resolver-alias/download/eslint-import-resolver-alias-1.0.3.tgz","integrity":"sha512-MPsdzbrX0Yu4RmOq3bwWeO417zsah/rVTnyJfRh/QlMpD+/U13csT++FhsXeXTKfsO89FXIvXD1u2doVL+nnaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3obKvM1d1GAXrSTk2bSfgXXMlSHrXYvcNX53C5BoAPwIhAKzGJkISaraLFZ3fjbewLshOltYchosuuYzAiuAXY7lC"}],"size":2981,"noattachment":false,"key":"/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.0.3.tgz"},"maintainers":[{"name":"johvin","email":"johvin10@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/eslint-import-resolver-alias-1.0.3.tgz_1484201571461_0.2065103338100016"},"directories":{},"readme":"# eslint-import-resolver-alias\n\n[![Version npm][version]](http://browsenpm.org/package/eslint-import-resolver-alias)\n![Version node][node]\n[![Build Status][build]](https://travis-ci.org/johvin/eslint-import-resolver-alias)\n[![Download][download]](https://www.npmjs.com/package/eslint-import-resolver-alias)\n[![Dependencies][david]](https://david-dm.org/johvin/eslint-import-resolver-alias)\n![peerDependencies][peer]\n[![Coverage Status][cover]](https://coveralls.io/github/johvin/eslint-import-resolver-alias?branch=master)\n[![Known Vulnerabilities][vulnerabilities]](https://snyk.io/test/npm/eslint-import-resolver-alias)\n[![License][license]](https://opensource.org/licenses/MIT)\n\n[version]: http://img.shields.io/npm/v/eslint-import-resolver-alias.svg?style=flat-square\n[node]: https://img.shields.io/node/v/eslint-import-resolver-alias/latest.svg?style=flat-square\n[build]: http://img.shields.io/travis/johvin/eslint-import-resolver-alias/master.svg?style=flat-square\n[download]: https://img.shields.io/npm/dm/eslint-import-resolver-alias.svg?style=flat-square\n[david]: https://img.shields.io/david/johvin/eslint-import-resolver-alias.svg?style=flat-square\n[peer]: https://img.shields.io/david/peer/johvin/eslint-import-resolver-alias.svg?style=flat-square\n[cover]: http://img.shields.io/coveralls/johvin/eslint-import-resolver-alias/master.svg?style=flat-square\n[vulnerabilities]: https://snyk.io/test/npm/eslint-import-resolver-alias/badge.svg?style=flat-square\n[license]: https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square\n\n\nThis is a simple Node.js module import resolution plugin for [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import), which supports native Node.js module resolution, module alias/mapping and custom file extensions.\n\n\n## Installation\n\nPrerequisites: Node.js >=4.x and corresponding version of npm.\n\n```shell\nnpm install eslint-plugin-import eslint-import-resolver-alias --save-dev\n```\n\n\n## Usage\n\nPass this resolver and its parameters to `eslint-plugin-import` using your `eslint` config file, `.eslintrc` or `.eslintrc.js`.\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import/resolver': {\n      alias: {\n        map: [\n          ['babel-polyfill', 'babel-polyfill/dist/polyfill.min.js'],\n          ['helper', './utils/helper'],\n          ['material-ui/DatePicker', '../custom/DatePicker'],\n          ['material-ui', 'material-ui-ie10']\n        ],\n        extensions: ['.ts', '.js', '.jsx', '.json']\n      }\n    }\n  }\n};\n```\n\nNote:\n\n- The alias config object contains two properties, `map` and `extensions`, both of which are array types\n- The item of `map` array is also array type which contains 2 string\n    + The first string represents the alias of module name or path\n    + The second string represents the actual module name or path\n- The `map` item `['helper', './utils/helper']` means that the modules which match `helper` or `helper/*` will be resolved to `./utils/helper` or `./utils/helper/*` which are located relative to the `process current working directory` (almost the project root directory). If you just want to resolve `helper` to `./utils/helper`, use `['^helper$', './utils/helper']` instead. See [issue #3](https://github.com/johvin/eslint-import-resolver-alias/issues/3)\n- The order of 'material-ui/DatePicker' and 'material-ui' cannot be reversed, otherwise the alias rule 'material-ui/DatePicker' does not work\n- The default value of `extensions` property is `['.js', '.json', '.node']` if it is assigned to an empty array or not specified\n\n*If the `extensions` property is not specified, the config object can be simplified to the `map` array.*\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import/resolver': {\n      alias: [\n        ['babel-polyfill', 'babel-polyfill/dist/polyfill.min.js'],\n        ['helper', './utils/helper'],\n        ['material-ui/DatePicker', '../custom/DatePicker'],\n        ['material-ui', 'material-ui-ie10']\n      ]\n    }\n  }\n};\n```\n\nWhen the config is not a valid object (such as `true`), the resolver falls back to native Node.js module resolution.\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import/resolver': {\n      alias: true\n    }\n  }\n};\n```\n","publish_time":1484201573352,"_cnpm_publish_time":1484201573352,"dist-tags":{"latest":"1.1.2"}}