{"_id":"eslint-plugin-eggache","_rev":"1212876","name":"eslint-plugin-eggache","description":"custom eslint rule for egg RTFM issues","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"time":{"modified":"2021-10-13T05:46:31.000Z","created":"2018-02-08T09:18:33.989Z","1.0.0":"2018-02-08T09:18:33.989Z"},"users":{},"author":{"name":"TZ","email":"atian25@qq.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/eggjs/eslint-plugin-eggache.git"},"versions":{"1.0.0":{"name":"eslint-plugin-eggache","version":"1.0.0","description":"custom eslint rule for egg RTFM issues","dependencies":{},"devDependencies":{"autod":"^3.0.1","egg-bin":"^4.3.7","egg-ci":"^1.8.0","eslint":"^4.17.0","eslint-config-egg":"^6.0.0","is-type-of":"^1.2.0","webstorm-disable-index":"^1.2.0"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && egg-bin pkgfiles && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && egg-bin pkgfiles --check && npm run cov","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 8"},"repository":{"type":"git","url":"git+ssh://git@github.com/eggjs/eslint-plugin-eggache.git"},"files":["index.js","lib"],"author":{"name":"TZ","email":"atian25@qq.com"},"license":"MIT","gitHead":"54c825fe5a2cc000a0e828442319690c1c84ed9d","bugs":{"url":"https://github.com/eggjs/eslint-plugin-eggache/issues"},"homepage":"https://github.com/eggjs/eslint-plugin-eggache#readme","_id":"eslint-plugin-eggache@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"1f8f98c698d2b511519fbdefbae78fe230487aa4","size":2959,"noattachment":false,"key":"/eslint-plugin-eggache/-/eslint-plugin-eggache-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-eggache/download/eslint-plugin-eggache-1.0.0.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-eggache_1.0.0_1518081513887_0.7711942009861403"},"_hasShrinkwrap":false,"publish_time":1518081513989,"_cnpm_publish_time":1518081513989}},"readme":"# eslint-plugin-eggache\n\ncustom eslint rule for egg RTFM questions\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![NPM download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/eslint-plugin-eggache.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/eslint-plugin-eggache\n[travis-image]: https://img.shields.io/travis/{{org}}/eslint-plugin-eggache.svg?style=flat-square\n[travis-url]: https://travis-ci.org/{{org}}/eslint-plugin-eggache\n[codecov-image]: https://codecov.io/gh/{{org}}/eslint-plugin-eggache/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/{{org}}/eslint-plugin-eggache\n[david-image]: https://img.shields.io/david/{{org}}/eslint-plugin-eggache.svg?style=flat-square\n[david-url]: https://david-dm.org/{{org}}/eslint-plugin-eggache\n[snyk-image]: https://snyk.io/test/npm/eslint-plugin-eggache/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/eslint-plugin-eggache\n[download-image]: https://img.shields.io/npm/dm/eslint-plugin-eggache.svg?style=flat-square\n[download-url]: https://npmjs.org/package/eslint-plugin-eggache\n\n## Usage\n\n```bash\nnpm i eslint-plugin-eggache --save\n```\n\nAdd `eggache` to the plugins section of your `.eslintrc` configuration file.\n\n```js\n// ${app_root}/.eslintrc\n{\n  \"extends\": [\n    \"plugin:eggache/recommended\"\n  ]\n}\n```\n\nBy default it enable all the recommended rules, if you want to custom, just configure the rules section.\n\n```js\n// ${app_root}/.eslintrc\n{\n  \"extends\": [\n    \"plugin:eggache/recommended\"\n  ],\n  \"rules\": {\n    'eggache/no-override-exports': [ 'error' ],\n    'eggache/no-unexpected-plugin-keys': 'error',\n  }\n}\n```\n\n## Rules\n\n### no-override-exports\n\nA common mistake that newbie will make - override `module.exports` and `exports`.\n\n```js\n/* eslint eggache/no-override-exports: [ 'error' ] */\n\n// config/config.default.js\nexports.view = {};\n\nmodule.exports = appInfo => {\n  const config = exports = {};\n  config.keys = '123456';\n  return config;\n}\n```\n\n**Options**:\n\nThe first options is a boolean, default to false, means only check:\n- `config/config.*.js`\n- `config/plugin.*.js`\n\nset it to `true` means to check all files.\n\n```js\n/* eslint eggache/no-override-exports: [ 'error', true ] */\n\n// due to options `true`, this will pass the lint\n// ${app_root}/app.js\nmodule.exports = exports = {};\nexports.keys = '123456';\n```\n\n### no-unexpected-plugin-keys\n\nSometimes, developer will confuse `plugin.js` and `config.default.js`.\n\n`plugin.js` only allow `[ 'enable', 'package', 'path', 'env' ]` and it control whether to load a plugin.\n\nThe plugin's `config` should write to `config/config.{env}.js`.\n\n```js\n/* eslint eggache/no-unexpected-plugin-keys: [ 'error' ] */\n\n// config/plugin.js\nmodule.exports = {\n  test: {\n    enable: true,\n    package: 'egg-test',\n    someConfig: 'should not place here',\n  },\n}\n```","_attachments":{},"homepage":"https://github.com/eggjs/eslint-plugin-eggache#readme","bugs":{"url":"https://github.com/eggjs/eslint-plugin-eggache/issues"},"license":"MIT"}