{"_id":"eslint-plugin-no-unsafe-regex","_rev":"4-bd9178a1f2399e8ff785333128a663a5","name":"eslint-plugin-no-unsafe-regex","description":"ESLint rules to disallow unsafe regular expressions.","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"eslint-plugin-no-unsafe-regex","version":"0.0.0","description":"ESLint rules to disallow unsafe regular expressions.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","codecov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/codecov/coverage --report lcovonly -- -R spec && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/eslint-plugin-no-unsafe-regex.git"},"keywords":["eslint","eslintplugin","plugin","javascript","js","style","guide","styleguide","syntax","lint","jshint","jslint","code","policy","quality","standard","rules","regex","regexp","regular","expression","safe","unsafe"],"bugs":{"url":"https://github.com/kgryte/eslint-plugin-no-unsafe-regex/issues"},"dependencies":{"safe-regex":"*"},"devDependencies":{"chai":"3.x.x","codecov.io":"^0.1.5","eslint":"^1.4.3","istanbul":"^0.3.0","mocha":"2.x.x"},"license":"MIT","gitHead":"8843b5180bbafbdd622dcc196a618df53cad0d7c","homepage":"https://github.com/kgryte/eslint-plugin-no-unsafe-regex#readme","_id":"eslint-plugin-no-unsafe-regex@0.0.0","_shasum":"335acc75031a37d4c964831d694ee83af15ccd97","_from":".","_npmVersion":"2.14.2","_nodeVersion":"0.12.4","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"335acc75031a37d4c964831d694ee83af15ccd97","tarball":"https://registry.npmjs.org/eslint-plugin-no-unsafe-regex/-/eslint-plugin-no-unsafe-regex-0.0.0.tgz","integrity":"sha512-bCxrFKzgST1/3VuiBKdea9dRRQnmUIkuqlLTjivj2TsyMw/kaNtaNCldXaH/zcG4jWzvVR9DBDo1zANic2aAHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4sw9PUBSdlJlocgOOQ0tXGpPc5M4bKUPVHk6HXhCocQIhAIWq1xlni5muuVe5c4dEpLpK9dtoEVacSM1wGJfvSPTp"}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]},"1.0.0":{"name":"eslint-plugin-no-unsafe-regex","version":"1.0.0","description":"ESLint rules to disallow unsafe regular expressions.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","codecov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/codecov/coverage --report lcovonly -- -R spec && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/eslint-plugin-no-unsafe-regex.git"},"keywords":["eslint","eslintplugin","plugin","javascript","js","style","guide","styleguide","syntax","lint","jshint","jslint","code","policy","quality","standard","rules","regex","regexp","regular","expression","safe","unsafe"],"bugs":{"url":"https://github.com/kgryte/eslint-plugin-no-unsafe-regex/issues"},"dependencies":{"safe-regex":"*"},"devDependencies":{"chai":"3.x.x","codecov.io":"^0.1.5","eslint":"^1.4.3","istanbul":"^0.3.0","mocha":"2.x.x"},"license":"MIT","gitHead":"e69fce58f03d70007be6d0cdd917fd4020b7bed2","homepage":"https://github.com/kgryte/eslint-plugin-no-unsafe-regex#readme","_id":"eslint-plugin-no-unsafe-regex@1.0.0","_shasum":"d8eab7e62da8fe5cdb58ff68e0be087bb80091dc","_from":".","_npmVersion":"2.14.2","_nodeVersion":"0.12.4","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"d8eab7e62da8fe5cdb58ff68e0be087bb80091dc","tarball":"https://registry.npmjs.org/eslint-plugin-no-unsafe-regex/-/eslint-plugin-no-unsafe-regex-1.0.0.tgz","integrity":"sha512-wn+K8vj5Rsok1vXG7GC6QFrdxW5zWrqdnVXf0+XEWrJmP70U6apMzTfNVGO6RJKK6r4DhG7cSVWlD7KArYOTug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICM+IRTwpbO+FT9KTvTQqwOomHT7usWwZxmyMNcf/yZ2AiArg7LKQkdl/6abTsYn18uwe5roG6tx+0RKMs8REEQb4A=="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]}},"readme":"Rules: No Unsafe Regex\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> [ESLint](http://eslint.org/) rules to disallow [unsafe](https://github.com/substack/safe-regex) regular expressions.\n\n\n## Installation\n\n``` bash\n$ npm install eslint-plugin-no-unsafe-regex\n```\n\n\n## Usage\n\n### Plugin\n\nTo use the [plugin](http://eslint.org/docs/user-guide/configuring#configuring-plugins) in an `.eslintrc` file,\n\n``` javascript\n{\n\t'plugins': [\n\t\t'no-unsafe-regex'\n\t]\n}\n```\n\nwhere `no-unsafe-regex` is shorthand for `eslint-plugin-no-unsafe-regex`. To configure plugin rules,\n\n``` javascript\n{\n\t'plugins': [\n\t\t'no-unsafe-regex'\n\t],\n\t'rules': {\n\t\t'no-unsafe-regex/no-unsafe-regex': 2\n\t}\n}\n```\n\nwhere a [plugin](http://eslint.org/docs/user-guide/configuring#configuring-plugins) rule must be prefixed with the [plugin](http://eslint.org/docs/user-guide/configuring#configuring-plugins) name and a `/`; e.g., `no-unsafe-regex/<rule>`.\n\n\n### Module\n\n``` javascript\nvar plugin = require( 'eslint-plugin-no-unsafe-regex' );\n```\n\n#### plugin\n\n[ESLint](http://eslint.org/) rules to disallow [unsafe](https://github.com/substack/safe-regex) regular expressions.\n\n``` javascript\nconsole.dir( plugin );\n/*\n\t{\n\t\t'rules': {\n\t\t\t'no-unsafe-regex': <rule>\n\t\t},\n\t\t'rulesConfig': {\n\t\t\t'no-unsafe-regex': 2\n\t\t}\n\t}\n*/\n```\n\n\n## Notes\n\n*\tIn order to use the [plugin](http://eslint.org/docs/user-guide/configuring#configuring-plugins), the plugin __must__ first be installed as a `node_modules` dependency.\n*\tThe plugin __only__ validates [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) __literals__ and regular expressions created using the [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) constructor and __literal__ arguments.\n\n\t``` javascript\n\tvar re;\n\n\t// Validated:\n\tre = /beep/;\n\n\t// Validated:\n\tre = new RegExp( 'beep', 'i' );\n\n\t// Not validated:\n\tstr = 'beep';\n\tre = new RegExp( str, 'i' );\n\n\t// Not validated:\n\tre = new RegExp( new Array( 5 ).join( 'ab' ) );\n\t```\n\n\tValidating regular expressions created using non-literal arguments would require reconstructing an execution context, which is beyond the scope of this module. For example, consider\n\n\t``` javascript\n\tvar getStr = require( './path/to/my/string' ),\n\t\tstr = getStr();\n\n\tvar re = new RegExp( str );\n\t```\n\n\tIf the return value of `getStr` is dynamic, validation is impossible.\n\n\n\n## Examples\n\n``` javascript\nmodule.exports = {\n\t'env': {\n\t\t'node': true\n\t},\n\t'plugins': [\n\t\t// Declare the plugin:\n\t\t'no-unsafe-regex'\n\t],\n\t'rules': {\n\t\t'no-path-concat': 2,\n\t\t'no-process-exit': 0,\n\t\t'no-sync': 1,\n\t\t'no-mixed-requires': [ 2, false ],\n\n\t\t// Prefix a plugin rule with `{{plugin_name}}/`:\n\t\t'no-unsafe-regex/no-unsafe-regex': 2\n\t}\n};\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n## Tests\n\n### Unit\n\nUnit tests use the [Mocha](http://mochajs.org/) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright &copy; 2015. Athan Reines.\n\n\n[npm-image]: http://img.shields.io/npm/v/eslint-plugin-no-unsafe-regex.svg\n[npm-url]: https://npmjs.org/package/eslint-plugin-no-unsafe-regex\n\n[travis-image]: http://img.shields.io/travis/kgryte/eslint-plugin-no-unsafe-regex/master.svg\n[travis-url]: https://travis-ci.org/kgryte/eslint-plugin-no-unsafe-regex\n\n[codecov-image]: https://img.shields.io/codecov/c/github/kgryte/eslint-plugin-no-unsafe-regex/master.svg\n[codecov-url]: https://codecov.io/github/kgryte/eslint-plugin-no-unsafe-regex?branch=master\n\n[dependencies-image]: http://img.shields.io/david/kgryte/eslint-plugin-no-unsafe-regex.svg\n[dependencies-url]: https://david-dm.org/kgryte/eslint-plugin-no-unsafe-regex\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/eslint-plugin-no-unsafe-regex.svg\n[dev-dependencies-url]: https://david-dm.org/dev/kgryte/eslint-plugin-no-unsafe-regex\n\n[github-issues-image]: http://img.shields.io/github/issues/kgryte/eslint-plugin-no-unsafe-regex.svg\n[github-issues-url]: https://github.com/kgryte/eslint-plugin-no-unsafe-regex/issues\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2022-06-17T20:37:33.299Z","created":"2015-09-17T19:36:21.692Z","0.0.0":"2015-09-17T19:36:21.692Z","1.0.0":"2015-09-17T19:38:48.214Z"},"homepage":"https://github.com/kgryte/eslint-plugin-no-unsafe-regex#readme","keywords":["eslint","eslintplugin","plugin","javascript","js","style","guide","styleguide","syntax","lint","jshint","jslint","code","policy","quality","standard","rules","regex","regexp","regular","expression","safe","unsafe"],"repository":{"type":"git","url":"git://github.com/kgryte/eslint-plugin-no-unsafe-regex.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/kgryte/eslint-plugin-no-unsafe-regex/issues"},"license":"MIT","readmeFilename":"README.md"}