{"_id":"eslint-plugin-import-path","_rev":"2-d8764dccb54ee75bf1cbfa104deb3f8a","name":"eslint-plugin-import-path","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"eslint-plugin-import-path","version":"0.0.1","description":"eslint plugin to check import paths via regex","keywords":["eslint","eslintplugin","eslint-plugin"],"main":"lib/index.js","directories":{"lib":"lib","test":"test"},"devDependencies":{"babel-eslint":"^10.0.1","eslint":"^5.7.0","mocha":"^5.2.0"},"scripts":{"test":"mocha ./test/*.js"},"repository":{"type":"git","url":"git+https://github.com/andrienko/eslint-plugin-import-path.git"},"author":{"name":"andrienko"},"license":"MIT","bugs":{"url":"https://github.com/andrienko/eslint-plugin-import-path/issues"},"homepage":"https://github.com/andrienko/eslint-plugin-import-path#readme","gitHead":"562e501ee72d5e06da330069591f4750a6245091","_id":"eslint-plugin-import-path@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"andrienko","email":"evolmate@gmail.com"},"dist":{"integrity":"sha512-5Kird2LutBPexP8qexAxGDhh20vv68MZllXNslQ77iiKYTyv/ZUDDDWWtfL6rTanzDSd+4fLUi8zGRyjbMJZKA==","shasum":"a4c013fa46170b312ceef369249c6031fd4fd262","tarball":"https://registry.npmjs.org/eslint-plugin-import-path/-/eslint-plugin-import-path-0.0.1.tgz","fileCount":10,"unpackedSize":9659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx69rCRA9TVsSAnZWagAATxoQAJadHKN4DeItWpkEFggX\nd1IqNgOIh6mwSy/LbvFJzdinhb2NEt9r91GaJ+h1fK1YYb4EnBeD/QmZuhfq\nsjNhks8RYPyRc/GgD/9W5urQbl5yAEMvtJuacl+8p7IjpyujycAfU55LI962\n62uM8/laOntL6mKnTE2upf0Ik0fzZ5+EJQqGg27XN8S4OzbUMGDhb2id1R06\nCJG4CD7d/D2r8Fb3Lg+E4hljTIxMrW3s/7o1sUhT9Ou79uemOd32Ze+DkBxG\nO0SQFjJmCCLLvksl8rn8sQEuMwxilCGq/0yP3cgwLWMvWFwvxOQbYeua4GpB\n5YkOOIPxsr1jicYVW2c5ogsWOYVw/Pw2omAqulatKWA1Z+z3+zS5K+j3Y/9a\nALWb1zIo7MOEcUJhFOPDHZxLGJ+5ZjyZOLRf4rVvLQLOlvgRUO2Wpb00BhKa\nzjaHJ675E3FW4GZO1Rm5AJZcTv5nb9m2P459D0PS0QwbU+fPj6SNjUd2/myh\nPF98rGlM3k6AEduC2L3gO/3BynbbyOw9AooJYi1Vp0e3UfSj9OkfEW7YcWlQ\nlanA5ykf3IIdvmZ00cS586HJXIZzry+EZaAcwwgnnzkhmL7LHIEGVURAZWg7\nWRvMAR9MfY/s10SdJj4jAezqJx/tuvf5RPVLROtfXG//b1Wd0TF4FD53U1Cp\nATu8\r\n=G+2A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJ7ZDzOOAkdPS1tlQ/qkkRFk/27jaS9shHc4saLdb1MAIgAtJn6xWZegjxY03l56a3POtAaouCBN/jRCrPZ8nEzKE="}]},"maintainers":[{"name":"andrienko","email":"evolmate@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-import-path_0.0.1_1539813226496_0.3460401580062258"},"_hasShrinkwrap":false},"0.0.2":{"name":"eslint-plugin-import-path","version":"0.0.2","description":"eslint plugin to check import paths via regex","keywords":["eslint","eslintplugin","eslint-plugin"],"main":"lib/index.js","directories":{"lib":"lib","test":"test"},"devDependencies":{"babel-eslint":"^10.0.1","eslint":"^5.7.0","mocha":"^5.2.0"},"scripts":{"test":"mocha ./test/*.js"},"repository":{"type":"git","url":"git+https://github.com/andrienko/eslint-plugin-import-path.git"},"author":{"name":"andrienko"},"license":"MIT","bugs":{"url":"https://github.com/andrienko/eslint-plugin-import-path/issues"},"homepage":"https://github.com/andrienko/eslint-plugin-import-path#readme","gitHead":"1a38967d2926d0b46039a7e504db78d68092dd30","_id":"eslint-plugin-import-path@0.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"andrienko","email":"evolmate@gmail.com"},"dist":{"integrity":"sha512-Y9655CH80iYk2ZyhyZiDPPlekS/RyvL3TLUw9ixG+t2A1SysO84fsgGnK1DojneuqjGKjongBsOhpYhLVVaYgA==","shasum":"e1d7851faa70bf1a9e6f89b7e03cb2f61f6467d4","tarball":"https://registry.npmjs.org/eslint-plugin-import-path/-/eslint-plugin-import-path-0.0.2.tgz","fileCount":10,"unpackedSize":9738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx7IYCRA9TVsSAnZWagAAmiIP/22peaLmKOFlTrw+KOmD\nbDiyWJp3alN8oJBDYjU+D/ilxi97UlEVKkon5KmGyYsDjGmTxT9PZed4kIDh\nF65i5ii2CR8N62AQr15iPu4RTIKF0/U/6KxM3IHCIY+lcNMb6MHUgQ3M3uwe\nEPhbNCvDBZeQB5R8/YrAacsr6ScWqqIkeytoXz1Bu/MVrNZSH0HiqE3iaqVP\nJLtpzoWIygW4heLX7hftJZbOQznBw3yx5g3Sgf7fnfvfcOUxmB4LPTY5QEa5\nfc7U83EjFwcyMY9cgg6VcBHa5vEuXe7+Qu8ujotcoX7FQjp68CisHCrNjfKA\n5E36g+FB1CfstjX8wC6KhmQw9Lqq5Tu4I5lPWoae1aGk3DhL0D3VHxiZ1BAh\nddfaAkDqFt4j/i2jhUMZgyRWuup0uJ2bkKVNltxazKDYevlgBDOCnjojwQTF\ndCWFD8/b9FzHOlVhxi9cTMjW3QR70x3svXZXqA0Od2ITvz1dH41OPJaVTh3/\nnq7syICIfJ1MYiwxmXQkjhol7eBgvDCuEYJZsUunwHrh5vXfk95Cexn91+6K\nDUHSGF3y2S7WvsuD43gaoEgIgGYnZNlOixIA908qzSoHXlExdleimXQJRmqu\n/puWW5V/igq5E22K3b1x6Ns68Yu60epny9435Z9gt5c1vSGNkZA2dyR/t+BM\nsXQZ\r\n=F6aK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmOQULc8wNgt1uhXPEiAGjKShotV+RipsjahkR3Oq2sQIgU85FHIP3RhCtVQSISheyZ0hMbVRUC/zAOWdcVyLzeZM="}]},"maintainers":[{"name":"andrienko","email":"evolmate@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-import-path_0.0.2_1539813911253_0.38257539039441224"},"_hasShrinkwrap":false}},"time":{"created":"2018-10-17T21:53:46.496Z","0.0.1":"2018-10-17T21:53:46.668Z","modified":"2022-05-01T16:19:24.452Z","0.0.2":"2018-10-17T22:05:11.530Z"},"maintainers":[{"name":"andrienko","email":"evolmate@gmail.com"}],"description":"eslint plugin to check import paths via regex","homepage":"https://github.com/andrienko/eslint-plugin-import-path#readme","keywords":["eslint","eslintplugin","eslint-plugin"],"repository":{"type":"git","url":"git+https://github.com/andrienko/eslint-plugin-import-path.git"},"author":{"name":"andrienko"},"bugs":{"url":"https://github.com/andrienko/eslint-plugin-import-path/issues"},"license":"MIT","readme":"# eslint-plugin-import-path\n\nA tiny ESLint plugin to check import paths for errors. Currently it allows you do two simple things:\ncheck strings for regexes (you can define these) and check imports depth.\n\nWebStorm sometimes tends to do weird things - it does not respect module root sometimes and adds something\nlike `../../../../stores/SettingStore` instead of `stores/SettingStore` - and also it sometimes adds \n`/index` to the end of filenames after refactoring - so my `import Component from 'Component'` turns\ninto `import Component from 'Component/index'`. I tend to miss these and I don't like to see them in\nmy code.\n\nThere's a gorgeous `eslint-plugin-import`, but it lacked these two simple features, so I wrote this one.\nIt is even somewhat covered with unit tests and should be stable enough to use during development.\n\n## Usage\n\nInstall it: (of course you have to have eslint installed)\n\n    npm install eslint-plugin-import-path --save-dev\n\nAdd `import-path` to the plugins section of your `.eslintrc` configuration file.\n\n    {\n      \"plugins\": [\"import-path\"]\n    }\n\nConfigure the rules you need in rules section of .eslintrc.\n\n    {\n      \"plugins\": [\"import-path\"],\n      \n      \"rules\": {\n        \"import-path/parent-depth\": [\"warn\", 2],\n        \"import-path/forbidden\": [\"error\", [\"/index$\"]]\n      }\n    }\n\n## Rules\n\n#### import-path/forbidden\n\nBasically a regex match. Lets you specify a regex string (or a number of them) to highlight import paths\nthat match it. Couple examples:\n    \nYou can simply pass a regex string as a second argument:\n    \n    \"import-path/forbidden\": [\"warning\", \"/index$\"]\n\nOr an array of regex strings:    \n\n    \"import-path/forbidden\": [\"error\", [\"/index$\", \"badword\"]]\n    \nOr an array of objects. In case you use objects - its `match` property should contain regex string.\nYou can also provide `message` to be displayed for this very match    \n    \n    \"import-path/forbidden\": [\"warning\", [\n      {\n        \"match\": \"/index$\",\n        \"message\": \"Index on the end of path is redundant\"\n      }\n    ]]\n    \nWith objects can also use `contains` prop to define a string that will be checked for occurrence. It\nis not a regex, but a simple string the path will be checked for.\n    \n    \"import-path/forbidden\": [\"warning\", [\n      {\n        \"contains\": \"badword\",\n        \"message\": \"Do not use paths containing 'badword'\"\n      },\n    ]]\n\n#### import-path/parent-depth\n\nThe rule checks if you used too many parent directory references. \n\nFollowing rule:\n\n    \"import-path/parent-depth\": [\"warn\", 4]\n    \nWill cause a warning here:\n\n    import whatever from '../../../../../something';\n    \n...but won't cause it here:\n\n    import whatever from '../../something'\n    \n...Of course, you could achieve this using `forbidden` rule, too:\n\n    \"import-path/forbidden\": [\"warning\", [\n      {\n        \"match\": \"^(\\.\\./){2,}\",\n        \"message\": \"More than two parent directories referenced\"\n      },\n    ]]\n\n### Export paths\n\nOh, export paths are also checked. Something like `export { Whatever } from 'somewhere/index'` will\nalso get checked.\n","readmeFilename":"README.md"}