{"name":"eslint-plugin-filenames","version":"1.3.0","description":"Eslint rule for consistent filenames.","main":"index.js","scripts":{"test":"npm run lint && npm run unit-test --coverage && npm run check-coverage","lint":"eslint .","unit-test":"istanbul test --dir build/coverage _mocha test -- --recursive --reporter dot","check-coverage":"istanbul check-coverage --statement 100 --branch 100 --function 100 --lines 100","report-coverage-html":"istanbul report --dir  build/coverage html","coveralls":"cat ./build/coverage/lcov.info | coveralls"},"dependencies":{"lodash.camelcase":"4.3.0","lodash.kebabcase":"4.1.1","lodash.snakecase":"4.1.1","lodash.upperfirst":"4.3.1"},"devDependencies":{"chai":"3.5.0","coveralls":"2.13.0","eslint":"^2.0.0","eslint-plugin-filenames":"^1.0.0","istanbul":"0.4.5","mocha":"3.2.0","sinon":"2.1.0"},"peerDependencies":{"eslint":"*"},"repository":{"type":"git","url":"git://github.com/selaux/eslint-plugin-filenames.git"},"author":{"name":"Stefan Lau","email":"github@stefanlau.com"},"license":"MIT","bugs":{"url":"https://github.com/selaux/eslint-plugin-filenames/issues"},"homepage":"https://github.com/selaux/eslint-plugin-filenames","keywords":["eslint","eslintplugin","eslint-plugin","file","filename","path"],"gitHead":"70efd650a628a105049bf6c95eb928f1b381796f","_id":"eslint-plugin-filenames@1.3.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.0","_npmUser":{"name":"selaux","email":"github@stefanlau.com"},"dist":{"integrity":"sha512-LqgDl4bmitJ4CZXyjPZKo0M5D/wFT6ABcjWisjfCIBMUPw3h80bjwIb1iPnbi/EOTCzT5O1qaH3pVX8kvNPvOw==","shasum":"126b26bc87fc7c50cb38713097feb372f76aa103","tarball":"http://registry-npm.ywwl.com/eslint-plugin-filenames/download/eslint-plugin-filenames-1.3.0.tgz","fileCount":12,"unpackedSize":15234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGja1CRA9TVsSAnZWagAAgeYP/1kadpLAD72n8yz5k9BW\nSbZPLh9LxRuy7fKu7RgLRnWki5yWIZp0Q+x/gw4EC7uODeQ/dAQRBEawUpzd\nUv3I8nilG11AiBOXR7FgWNMzBYXek/k7w/5h1m+axq+ynctsYVDkxNYTywlb\ndM9jGHAksDAHsU6594YTzp1VD8XTZzd7y1Tr66302ZEBxauHTOehHWQBTKMY\n+wdKImGvjw4QQIwzvEBJRcdlkhmYAX0iuliBwbBdb2OKcfrSRfmugcSFmEG/\nRyzMEy0hg894LwLGG64y8cmgTMHM5fx7SWjvz4BZ4OrLY01Xjoroc3Q+w/9M\nf09CkS892ErWyG58cbg8RiGWrh0mZ+/BENqo2KovvDsJ90lLVB5YSsVS6yad\nTLgL7SDGwIL/5nnI6mRor9XUETyOZ6V/D6Hbxe2ypAgawV4+nb3NIqD3jTTY\n/ya7xk8XvsHhr/WGThpEPM62168tk7+khx9whmXXnuRO+q1yaK8qaech+m14\nNDRo4QQrIKkcHXCpz68aoRNi+TuGgkWKcM4ZBWsPdRtAcXXAnpFsgYCnvG2v\niNEup0U2hq4YstqyReZ53fNNrbxazhYXQTIIhlpod6qZbFxIJpAyhjI1rZRv\nbc+/nj7SSDD2H1tfEpei8W/Bln/Ab/C1w6mexuh5MxXO9NpRRxJyOzF8SRy9\nASkn\r\n=mJSX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZZIXfecLZzgOLfJmbklgjnfvJSGI1mA+GI1KGiUa3lQIhAPqnaBhAmSEmIEP/CIaLkqrrJFgJiUa0t7Lsi0SevU1Y"}],"size":4607,"noattachment":false,"key":"/eslint-plugin-filenames/-/eslint-plugin-filenames-1.3.0.tgz"},"maintainers":[{"name":"selaux","email":"github@stefanlau.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-filenames_1.3.0_1528444596347_0.8556737801519396"},"_hasShrinkwrap":false,"readme":"# eslint-plugin-filenames\n\n[![NPM Version](https://img.shields.io/npm/v/eslint-plugin-filenames.svg?style=flat-square)](https://www.npmjs.org/package/eslint-plugin-filenames)\n[![Build Status](https://img.shields.io/travis/selaux/eslint-plugin-filenames.svg?style=flat-square)](https://travis-ci.org/selaux/eslint-plugin-filenames)\n[![Coverage Status](https://img.shields.io/coveralls/selaux/eslint-plugin-filenames.svg?style=flat-square)](https://coveralls.io/r/selaux/eslint-plugin-filenames?branch=master)\n[![Dependencies](https://img.shields.io/david/selaux/eslint-plugin-filenames.svg?style=flat-square)](https://david-dm.org/selaux/eslint-plugin-filenames)\n\nAdds [eslint](http://eslint.org/) rules to ensure consistent filenames for your javascript files.\n\n__Please note__: This plugin will only lint the filenames of the `.js`, `.jsx` files you are linting with eslint. It will ignore other files that are not linted with eslint.\n\n## Enabling the plugin\n\nThis plugin requires a version of `eslint>=1.0.0` to be installed as a peer dependency.\n\nModify your `.eslintrc` file to load the plugin and enable the rules you want to use.\n\n```json\n{\n  \"plugins\": [\n    \"filenames\"\n  ],\n  \"rules\": {\n    \"filenames/match-regex\": 2,\n    \"filenames/match-exported\": 2,\n    \"filenames/no-index\": 2\n  }\n}\n```\n\n## Rules\n\n### Consistent Filenames via regex (match-regex)\n\nA rule to enforce a certain file naming convention using a regular expression.\n\nThe convention can be configured using a regular expression (the default is `camelCase.js`). Additionally\nexporting files can be ignored with a second configuration parameter.\n\n```json\n\"filenames/match-regex\": [2, \"^[a-z_]+$\", true]\n```\n\nWith these configuration options, `camelCase.js` will be reported as an error while `snake_case.js` will pass.\nAdditionally the files that have a named default export (according to the logic in the `match-exported` rule) will be\nignored.  They could be linted with the `match-exported` rule. Please note that exported function calls are not\nrespected in this case.\n\n### Matching Exported Values (match-exported)\n\nMatch the file name against the default exported value in the module. Files that dont have a default export will\nbe ignored. The exports of `index.js` are matched against their parent directory.\n\n```js\n// Considered problem only if the file isn't named foo.js or foo/index.js\nexport default function foo() {}\n\n// Considered problem only if the file isn't named Foo.js or Foo/index.js\nmodule.exports = class Foo() {}\n\n// Considered problem only if the file isn't named someVariable.js or someVariable/index.js\nmodule.exports = someVariable;\n\n// Never considered a problem\nexport default { foo: \"bar\" };\n```\n\nIf your filename policy doesn't quite match with your variable naming policy, you can add one or multiple transforms:\n\n```json\n\"filenames/match-exported\": [ 2, \"kebab\" ]\n```\n\nNow, in your code:\n\n```js\n// Considered problem only if file isn't named variable-name.js or variable-name/index.js\nexport default function variableName;\n```\n\nAvailable transforms:\n'[snake](https://www.npmjs.com/package/lodash.snakecase)',\n'[kebab](https://www.npmjs.com/package/lodash.kebabcase)',\n'[camel](https://www.npmjs.com/package/lodash.camelcase)', and\n'pascal' (camel-cased with first letter in upper case).\n\nFor multiple transforms simply specify an array like this (null in this case stands for no transform):\n\n```json\n\"filenames/match-exported\": [2, [ null, \"kebab\", \"snake\" ] ]\n```\n\nIf you prefer to use suffixes for your files (e.g. `Foo.react.js` for a React component file),\nyou can use a second configuration parameter. It allows you to remove parts of a filename matching a regex pattern\nbefore transforming and matching against the export.\n\n```json\n\"filenames/match-exported\": [ 2, null, \"\\\\.react$\" ]\n```\n\nNow, in your code:\n\n```js\n// Considered problem only if file isn't named variableName.react.js, variableName.js or variableName/index.js\nexport default function variableName;\n```\n\nIf you also want to match exported function calls you can use the third option (a boolean flag).\n\n```json\n\"filenames/match-exported\": [ 2, null, null, true ]\n```\n\nNow, in your code:\n\n```js\n// Considered problem only if file isn't named functionName.js or functionName/index.js\nexport default functionName();\n```\n\n### Don't allow index.js files (no-index)\n\nHaving a bunch of `index.js` files can have negative influence on developer experience, e.g. when\nopening files by name. When enabling this rule. `index.js` files will always be considered a problem.\n\n## Changelog\n\n#### 1.3.2\n\n- Fix issue with `match-regex` and `getExportedName`\n\n#### 1.3.1\n\n- Put breaking change from `1.3.0` behind a flag\n\n#### 1.3.0\n\n- Support call expressions as named exports\n\n#### 1.2.0\n- Introduce `strip` option for `match-exported`\n- Introduce support for multiple transform options\n- Introduce `pascal` transform\n\n#### 1.1.0\n- Introduce `transform` option for `match-exported`\n\n#### 1.0.0\n- Split rule into `match-regex`, `match-exported` and `no-index`\n\n#### 0.2.0\n- Add match-exported flags\n\n#### 0.1.2\n- Fix example in README\n\n#### 0.1.1\n- Fix: Text via stdin always passes\n- Tests: Travis builds also run on node 0.12 and iojs now\n\n#### 0.1.0\n- Initial Release\n","publish_time":1528444596499,"_cnpm_publish_time":1528444596499,"dist-tags":{"latest":"1.3.2"}}