{"name":"eslint-plugin-filenames","version":"1.0.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"},"devDependencies":{"chai":"2.1.1","coveralls":"2.11.2","eslint":">=1.0.0","istanbul":"0.3.7","mocha":"2.2.1","sinon":"1.17.3"},"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":"61fe53bb0034c253111650042a0357ab9dedafde","_id":"eslint-plugin-filenames@1.0.0","_shasum":"a8428fd549e8046e4ce9d8cbf3579faf69ae6f7c","_from":".","_npmVersion":"3.8.8","_nodeVersion":"6.0.0","_npmUser":{"name":"selaux","email":"github@stefanlau.com"},"dist":{"shasum":"a8428fd549e8046e4ce9d8cbf3579faf69ae6f7c","tarball":"http://registry-npm.ywwl.com/eslint-plugin-filenames/download/eslint-plugin-filenames-1.0.0.tgz","integrity":"sha512-qJFeKuz2hdc74QGKzCEACP1CzBTVScJOA7PWW8e9OFVrYJDq++agVqIXo2dzE85i9bisc9zNA0mLdjUR0BFyKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgA326G7SoNwEGQ1j10Nh06rceeodeu72YHTOiSDqHywIgaqee8BpKf8paiVjAEqol73Iutqb3us0yoHUfNflYVy8="}],"size":3684,"noattachment":false,"key":"/eslint-plugin-filenames/-/eslint-plugin-filenames-1.0.0.tgz"},"maintainers":[{"name":"selaux","email":"github@stefanlau.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/eslint-plugin-filenames-1.0.0.tgz_1463506085940_0.48310997732914984"},"directories":{},"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":1463506088324,"_cnpm_publish_time":1463506088324,"dist-tags":{"latest":"1.3.2"}}