{"_id":"eslint-plugin-restrict-imports","_rev":"3-a7008a7013bc9ee46071b706d96db3e2","name":"eslint-plugin-restrict-imports","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"eslint-plugin-restrict-imports","version":"0.0.1","description":"Eslint plugin to ban specified imports in specified directories","keywords":["eslint","eslintplugin","eslint-plugin"],"author":{"name":"Bill Lynch"},"main":"lib/index.js","scripts":{"test":"mocha tests --recursive","lint":"eslint .","prettier":"prettier --write ."},"dependencies":{"prettier":"^2.1.2","requireindex":"~1.1.0"},"devDependencies":{"eslint":"^7.1.0","mocha":"^7.2.0"},"engines":{"node":">=0.10.0"},"license":"ISC","_id":"eslint-plugin-restrict-imports@0.0.1","dist":{"shasum":"37daf3cc9827d26059850fe22fa3c2e0a455221d","integrity":"sha512-EpuSjXGZJxmRLLgzC8wej5mhSqyGauzpH5QUdN9hb0NkQzF22wKPp69IFwDNjWjqeGLZV1qT8SZuu/7MtxxsCA==","tarball":"https://registry.npmjs.org/eslint-plugin-restrict-imports/-/eslint-plugin-restrict-imports-0.0.1.tgz","fileCount":17,"unpackedSize":79225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeg8XCRA9TVsSAnZWagAAXXoP/2X5Buad1/Cyyes6z1Sa\n0rNgkxPM5yklJLMq5kp0JCQJb6mNT2nGZG2oNg9WH3QaGHheZjLX/yNOXIGW\nEmGHOVVASQcTbde03/3FaRPP3iSsUFDReYaZ4DqW+rHCsp79xZmMesGDNbqD\nS5cjPPwN25TVeN4FP0h/+6lpkAfhkCW6mvNS/Li2F86qG7yQY0vLZDi6yUXM\nXPCP0QyDaT+h2kOx0otWrAmaNKUr4WrCFVQYrLErVf1cQxIkKuseiJKXws+O\nxkztvZcHRyAHd5J7tGTUX4PwSAzRGwYR2RuyPcvfphFkvmHxBMXNa/SfK57I\n30Q+u3LY2g+PCkduR2mZ7+vu5iJIkJ9SF3EsIngd/+3UvdP4ZYvbn5rbr18k\nbC+oeHB4fkeuMmwvnOvSUWuJ/A4IjWqjHskWfg7zjSFHQhSx4mGXzhbWjEQ3\n9RiRjnR/HhW8SE0KM0b3PvTsv3mqnEdy8XgZb96Lj3GEwJkPpucmO0vjOkoe\nd/7dp28NEaGJySZYelmN/6KWzLr9rpqyIvJQVV+ZsAPuocLDcX/VynktY/D7\nRslcVjOeYjOujPmpeP9IeM+1HITn+5Nhv2bUZgES6GD4JApKxoKd68kVXX8D\nd8u6VXdRlUSUN3fPYvayDpaFhRwFxFvUMmHbhm8WeBmFWWUg9qZH8G7/QFpS\n3bOF\r\n=j/3X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdfegDf72lmod7t/vYMbK/qiMn2jSLoEZbDsSbAqKDDQIhANkNNrTWrFgETnC4o6b6TiHAcQMKsrsUqIgsNGdBvlS4"}]},"maintainers":[{"name":"billlynch","email":"bl-dev@outlook.com"}],"_npmUser":{"name":"billlynch","email":"bl-dev@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-restrict-imports_0.0.1_1601834775395_0.2721488233887106"},"_hasShrinkwrap":false},"0.0.2":{"name":"eslint-plugin-restrict-imports","version":"0.0.2","description":"Eslint plugin to ban specified imports in specified directories","keywords":["eslint","eslintplugin","eslint-plugin"],"author":{"name":"Bill Lynch"},"main":"lib/index.js","scripts":{"test":"mocha tests --recursive","lint":"eslint .","prettier":"prettier --write ."},"dependencies":{"prettier":"^2.1.2","requireindex":"~1.1.0"},"devDependencies":{"eslint":"^7.1.0","mocha":"^7.2.0"},"engines":{"node":">=0.10.0"},"license":"ISC","_id":"eslint-plugin-restrict-imports@0.0.2","dist":{"shasum":"2d2a2da82eeddc60f7cf1d55061c947134d02706","integrity":"sha512-wGIfpBDehuv5jrV9sYjAk/quCo6ntof4/OoAv36EGWFpzF8NNQr74b+zA6g8yZkm8F5TrEFcsihIBNjIGNy33w==","tarball":"https://registry.npmjs.org/eslint-plugin-restrict-imports/-/eslint-plugin-restrict-imports-0.0.2.tgz","fileCount":17,"unpackedSize":79236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfej1UCRA9TVsSAnZWagAA/84P/Ru9D+SpZaLHyUqYyDWi\n9Tjz4LUq5UwbZqzvWfNIOnr95eUU6WZ7V/UR5eTDinRHnbrMPLfenYaiCaxK\nxaDUt2zXm3rlnUILgRrBNnK7NNItSGRTG7Cz1u2bLfpe9S5YzxdMy6DNTLhe\nq8aITwi/CDj82qe/XbOnYCSkKLmGynOwitt6MKsTrG/6FU2YGVmOenh+X0H/\nRGnI4PBYlrlCDejr3L9hcpkCj/QL37jvpUsy6D+oDzAIVjCo5HKJnB6/Mejf\nvw1Nf73vCCWD/O9xhbysaedZd8SGa23pjZu55YLgrDygx0IGeBD0fEP2jIwv\nnUVqz/bJ6iq5ZjUkROnM4H6aOngIcoXOh95FhjTLZ+xqLlBHXIOqCV7f45Q7\nY8UPHzjFmjKSxYhlOUQBzRRLE9/0aRNRpF4Tv9iGb+0aQygGW4Rw7SrawbG7\nMjgC0SmLQt60i1bfydWR0P/ie38T2sV1kOzRVBSJU1QAzXUea+aoQBL6f3c4\nn1K6OtujdW3l/IScy+HLxCoNp9DTEIDSqixegx0Umm6MtJKLutVedIVZX7jp\nS08CA8CjfBMjhtgSTvVsUJaK7Y4q0/a7SfIkbat58+PYrRqtN/M4QWfuWNHZ\nioaIbG9baxwvB0SL4/OZeNbYhsIwMxp9FM6PfrgOigsPrRSmx3C5O3Fn83yH\nWlmy\r\n=Ri3w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLNaF60KwgYYVR3c/FnoV/PO9/gPU0rJLjgzKP3Ob8GAIhALLE00Ev/sFrKJlE2u7EbXL0YURc8IFUZdgUfBQ7P0vu"}]},"maintainers":[{"name":"billlynch","email":"bl-dev@outlook.com"}],"_npmUser":{"name":"billlynch","email":"bl-dev@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-restrict-imports_0.0.2_1601846611798_0.5313731725360953"},"_hasShrinkwrap":false},"0.0.3":{"name":"eslint-plugin-restrict-imports","version":"0.0.3","description":"Eslint plugin to ban specified imports in specified directories","keywords":["eslint","eslintplugin","eslint-plugin"],"author":{"name":"Bill Lynch"},"main":"lib/index.js","scripts":{"test":"mocha tests --recursive","lint":"eslint .","prettier":"prettier --write ."},"dependencies":{"requireindex":"~1.1.0"},"devDependencies":{"eslint":"^7.1.0","prettier":"^2.1.2","mocha":"^7.2.0"},"engines":{"node":">=0.10.0"},"license":"ISC","_id":"eslint-plugin-restrict-imports@0.0.3","dist":{"shasum":"3e6fe87215582072b93b36874720092eb86f7b4f","integrity":"sha512-/KpPnsudIGYZNFvagnyULYyixuvvoqNaKPucCgsaOxTKuzPauoQJXAJ/AsJTjLt6U/K7NtjUJf7MtKAqSpozaw==","tarball":"https://registry.npmjs.org/eslint-plugin-restrict-imports/-/eslint-plugin-restrict-imports-0.0.3.tgz","fileCount":17,"unpackedSize":79236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfevqfCRA9TVsSAnZWagAABLQQAJtBj+oi5aVuzXbntnGy\nWCplZrOlkhVh8UhSAgMKj1thHF+PUQFiDVCHftQn5AfAXUtTdPT5kO3dc5kt\nLt49z4hypO3PIERUBfnvyDDvLsZiRVtNOvFVajAhSvtMYxETXmTPIHXwY+3g\nzmAObYDKgnsgxVXZaBe2U4P3e0PdxAZgQGCKg9n64hU4GWav/n3FFQl49qHT\nV4ihn0HTDtSmzYnETcWKAJwT6Lsqyd3xxsJ4g5sCPnaqtS00Dx1O7aPEbx0b\nR9HFJ+ulV26hanRAbV8R2p6OsmT4Hukln3ZcVs4YjP3qrEcwrguacinYCkGd\n6KgncasGjkxe1HIYPkNHjW/Mqf6VUAeKfAJyderJWR3tGtQ/6MMco/w4LfUJ\nbkFCYn04/l0tAY3XxNfyiqGrj/QpdWzOUseupBh1sBeHVQQ7Y+1gyjFk+oJN\nNr16UP0fc26ulSUYrZaIT32BMvjcvcSZNbafQA5ifaRtTgkXXLph/xvIKQVW\nhkTIZMroStYK3H7Fnnv8cTvNQWamwjP3ql6LZARs7CnzJdfQaBjjtk3OPDu5\npOwliiP3rtMgBt4X9krLFW7pEg6nLAVJ+YhCjr1ydqdx/z1drjdTJzKL7Pij\nPmTM1xbYVV+BOGLVHJRZ86JJT9Ol1phvuFrzHmSQ3dKsauGHJfAHX8voZGA1\nswLA\r\n=txDV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQfVorLDjW5K/kHR3SSdLa3DgaURH7BWkSATDeLLiExAiEA8vboePOiRKbhZMHvTDbvxKUIBDrg7Y1EtoN7ddRSO/A="}]},"maintainers":[{"name":"billlynch","email":"bl-dev@outlook.com"}],"_npmUser":{"name":"billlynch","email":"bl-dev@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-restrict-imports_0.0.3_1601895071217_0.1522098204462825"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-04T18:06:15.395Z","0.0.1":"2020-10-04T18:06:15.535Z","modified":"2022-05-01T16:52:54.388Z","0.0.2":"2020-10-04T21:23:31.967Z","0.0.3":"2020-10-05T10:51:11.340Z"},"maintainers":[{"name":"billlynch","email":"bl-dev@outlook.com"}],"description":"Eslint plugin to ban specified imports in specified directories","keywords":["eslint","eslintplugin","eslint-plugin"],"author":{"name":"Bill Lynch"},"license":"ISC","readme":"# eslint-plugin-restrict-imports\n[![CircleCI](https://circleci.com/gh/Billlynch/eslint-plugin-restrict-imports.svg?style=svg)](https://circleci.com/gh/Billlynch/eslint-plugin-restrict-imports)\n\nEslint plugin to ban specified imports in specified directories\n\nThis is useful to ban not using a barrelled import in multi-package repositories.\n\n## Installation\n\nYou'll first need to install [ESLint](http://eslint.org):\n\n```\n$ npm i eslint --save-dev\n```\n\nNext, install `eslint-plugin-restrict-imports`:\n\n```\n$ npm install eslint-plugin-restrict-imports --save-dev\n```\n\n## Usage\n\nAdd `restrict-imports` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:\n\n```json\n{\n    \"plugins\": [\"restrict-imports\"]\n}\n```\n\nThen configure the rules you want to use under the rules section.\n\n```json\n{\n    \"rules\": {\n        \"restrict-imports/restrict-imports\": [\n            \"error\",\n            {\n                \"../../clientA(.*)\": {\n                    \"locations\": [\"(.*)/clientB(.*)\"],\n                    \"message\": \"Do not import client A in client B\"\n                },\n                \"(.*)/common/(.*)\": {\n                    \"locations\": [\"(.*)/client(.*)\"],\n                    \"message\": \"Use barrelled import '@common'\"\n                }\n            }\n        ]\n    }\n}\n```\n\nRule configuration:\n\n```json\n[\n    \"error\",\n    {\n        \"../../clientA(.*)\": {                              // regex for the import path to ban\n            \"locations\": [\"(.*)/clientB(.*)\"],              // regex for the absoulte file names to enforce in\n            \"message\": \"Do not import client A in client B\" // optional - customised error message\n        }\n    }\n]\n```\n\nDefault Rule configuration:\n\n```json\n[\n    \"error\",\n    {\n        \"/(.*)\": {                // Ban absoulte imports\n            \"locations\": [\"(.*)\"] // in all files\n        }\n    }\n]\n```\n\n## Supported Rules\n\n-   restrict-imports - Ban imports from a location in any directory.\n","readmeFilename":"README.md"}