{"name":"eslint-plugin-filenames","version":"0.1.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":"1.10.0","eslint-tester":"0.4.0","istanbul":"0.3.5","mocha":"2.1.0","eslint":">=0.9.0","coveralls":"2.11.2"},"peerDependencies":{"eslint":">=0.9.0"},"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":"706edac951c133cde6a6c25941287097f1505be7","_id":"eslint-plugin-filenames@0.1.0","_shasum":"e88aeb65a86f66baac913229ce6a5dfc5a18e508","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"selaux","email":"github@stefanlau.com"},"maintainers":[{"name":"selaux","email":"github@stefanlau.com"}],"dist":{"shasum":"e88aeb65a86f66baac913229ce6a5dfc5a18e508","tarball":"http://registry-npm.ywwl.com/eslint-plugin-filenames/download/eslint-plugin-filenames-0.1.0.tgz","integrity":"sha512-ruCoF469CMw/yDf5PMRNha1iJ+/abcg8aVgwiPqaCnyVy4DvqxTt1rrK078J/WLrsF36lwUI58bvHrMFHBwaAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+RlKgrWB4jo7IRGqUnjIq8P28G5W7PxXXOaJJyDJ+/wIgW4a+i9YfFDCSKfAC9tTqysLYP++iuKzumvQ6ojKEQeM="}],"size":1865,"noattachment":false,"key":"/eslint-plugin-filenames/-/eslint-plugin-filenames-0.1.0.tgz"},"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":1420899842875,"_cnpm_publish_time":1420899842875,"dist-tags":{"latest":"1.3.2"}}