{"_id":"@cody-greene/eslint-config","_rev":"10-af3a9fd3c27fa2c56dd2e008fea380e4","name":"@cody-greene/eslint-config","description":"> eslint@^2.2.0","dist-tags":{"latest":"3.3.3"},"versions":{"2.2.2":{"name":"@cody-greene/eslint-config","version":"2.2.2","gitHead":"5922e181c48c9548699b375a977a38bc52c455dd","description":"> eslint@^2.2.0","_id":"@cody-greene/eslint-config@2.2.2","scripts":{},"_shasum":"7e559018cc4f56ecadabffdb1dba86b681b8cfa7","_from":".","_npmVersion":"3.8.9","_nodeVersion":"4.4.4","_npmUser":{"name":"cody-greene","email":"cody@dudewoah.com"},"maintainers":[{"name":"cody-greene","email":"cody@dudewoah.com"}],"dist":{"shasum":"7e559018cc4f56ecadabffdb1dba86b681b8cfa7","tarball":"https://registry.npmjs.org/@cody-greene/eslint-config/-/eslint-config-2.2.2.tgz","integrity":"sha512-U00hl3uY90DBgSDIHQLISypcwZkPhpsf7am/1qaDa9UrQpvPpeAnnegbebWBNcV70OJeM2FK/pV625iHGJtIQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoVmlc89b+YSwscmt6x0IVD296A3U5rQSAU283UZe2CAiAyi3w3BIIBvMQtCHQqeCxGZNH0daxrcYPsDzsgWzb1Ow=="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/eslint-config-2.2.2.tgz_1466543585762_0.815899224486202"},"directories":{}},"2.13.0":{"name":"@cody-greene/eslint-config","version":"2.13.0","gitHead":"3f8f9e2b6c0af68abe0e3053dc653feea47c3a73","description":"> eslint@^2.2.0","_id":"@cody-greene/eslint-config@2.13.0","scripts":{},"_shasum":"fd0b680030464c8d6ab196623d02efba41a36119","_from":".","_npmVersion":"3.8.9","_nodeVersion":"4.4.4","_npmUser":{"name":"cody-greene","email":"cody@dudewoah.com"},"maintainers":[{"name":"cody-greene","email":"cody@dudewoah.com"}],"dist":{"shasum":"fd0b680030464c8d6ab196623d02efba41a36119","tarball":"https://registry.npmjs.org/@cody-greene/eslint-config/-/eslint-config-2.13.0.tgz","integrity":"sha512-UkNr6HNWRXDgJ2tDxDaUbjIPKmh3V59L8snJxEDsqsj3DlogWZHGBe2+YbbVrGXKuanzvxJdJJUc1NKETpdwtQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICWFOxI/i1kIcskPbD601ko7ZDtAkDHInJhm3BzD/A0aAiBxikEFG3YF+SN3WlSdX5TqM8gdjyQPrymVWAYovrWAFw=="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/eslint-config-2.13.0.tgz_1467129996791_0.7464909590780735"},"directories":{}},"3.3.0":{"name":"@cody-greene/eslint-config","version":"3.3.0","gitHead":"26a04242ed5f18cc405760e39d41d93ebf660e1d","description":"> eslint@^2.2.0","_id":"@cody-greene/eslint-config@3.3.0","scripts":{},"_shasum":"b91adb3b41974d0a7d109373c029f2ea6dfd27d9","_from":".","_npmVersion":"3.10.5","_nodeVersion":"4.4.7","_npmUser":{"name":"cody-greene","email":"cody@dudewoah.com"},"maintainers":[{"name":"cody-greene","email":"cody@dudewoah.com"}],"dist":{"shasum":"b91adb3b41974d0a7d109373c029f2ea6dfd27d9","tarball":"https://registry.npmjs.org/@cody-greene/eslint-config/-/eslint-config-3.3.0.tgz","integrity":"sha512-JFasIED11krtsIc4IdOsaQIuEmG8c7f6K7auLwbk7+lCkc9NM3lukOpNXntjEa6A+S4JeNk/QyvVLZiW84rM+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGOYqGKFtA2N3vvytxey5v0NiMqwi2MAWLdU8vyrF6vjAiA6sLEQvV7vyJzZBk1wVYYRpv1ahKSt3sZAVrNbCAQscQ=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/eslint-config-3.3.0.tgz_1471538229786_0.6201065792702138"},"directories":{}},"3.3.1":{"name":"@cody-greene/eslint-config","version":"3.3.1","gitHead":"6322f271d347d0b1935e102feae5f534f17437fb","description":"> eslint@^2.2.0","_id":"@cody-greene/eslint-config@3.3.1","scripts":{},"_shasum":"2f80b183b836ebfab895f3a3ccb0a4707713ef2e","_from":".","_npmVersion":"3.10.5","_nodeVersion":"4.4.7","_npmUser":{"name":"cody-greene","email":"cody@dudewoah.com"},"maintainers":[{"name":"cody-greene","email":"cody@dudewoah.com"}],"dist":{"shasum":"2f80b183b836ebfab895f3a3ccb0a4707713ef2e","tarball":"https://registry.npmjs.org/@cody-greene/eslint-config/-/eslint-config-3.3.1.tgz","integrity":"sha512-e3ED0Kok5l5fCFwfKsEKrndno52EEa4oINGV3GAyiyob4izk2WbA/yAL9CWQGmBWf6H9ILUehCPhIr+US98Nfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGctTCTjcNSw2nbA7zuZpP65MpsObQ1m1pVrYKp4PPUfAiACvCEPhJZo+dSg68MkDSlfAe7NX24DwOsUWbJE3fr5jg=="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/eslint-config-3.3.1.tgz_1473706878761_0.12435648497194052"},"directories":{}},"3.3.3":{"name":"@cody-greene/eslint-config","version":"3.3.3","gitHead":"1f797dc3c87f4ef99995abe3425ab19814c30dcd","description":"> eslint@^2.2.0","_id":"@cody-greene/eslint-config@3.3.3","_nodeVersion":"14.15.4","_npmVersion":"7.5.2","dist":{"integrity":"sha512-pWQTijmDU4IjYq84LIDmjJ30WaSfbEJ5XVHqJlaGzKucERK8d4o4mVicQSfJ6KcZjMb69ZE06Jxe5ZG/usPH7w==","shasum":"f57502f46ab43cae59d892b0c1391287f930cc75","tarball":"https://registry.npmjs.org/@cody-greene/eslint-config/-/eslint-config-3.3.3.tgz","fileCount":5,"unpackedSize":10133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgODIeCRA9TVsSAnZWagAAMxAP/ieyr6TCXdwex070b2VT\n/OggP/J0Gyp1IbS8W+gx4HP6cpwZq2qPJ/1YfhXr/mmg5GXsH+CIOiIvtlD0\nkDW9HoV8d4RcLABv61x4OLPgJYHeRKEiKjGFCilYU3Jn2fVfi/K4mqblW2hL\n50It5IVqtetn6XgIr+cLDiEs/PXC0PJyvJw0BAaA/dnaGTh78eynGBhaun/W\nHfzm2IDdaFUA0Zr0KlLTYGatMihn8M93dsFHGGjfSitk8KtK9aqQGdv39233\nJIClx4bgH4KP/Ywn0ftWjWweNcPLEmxvxxe7NTwj/LLVhAwWh8kCwuRnX4Zq\nALTnoC/LDZN++/Qap2N9KHP2RV2X7+j4p5Ps54L5hEvroYbN86L0Qt3NkbWy\n7s38MmE1EF+cyvtGocm6bDt/0TzPSUWWc2y74ky/1QfkawliiQGh4O7ANvBC\nVOtaN2HkDwJSFthXzJYP8QtsgLY/NdqfBhXixuMXPXFTZP0OvDpOfef4MM/k\nFjid4+JTgdbiMRCXCk7mp5SDsIyDtD2WwEYTXp64KgRC3Fn5s7m1l3QZoNin\na4vemjJrQ4SpFMz1RKl7SZRNE+4793PGTN1zFqYH8VAa+rdh1o4YDuTRPRqx\n/JhiO1tm9eFHGag5AT27YaGVOxACgvC+unx62K39puGV7aebKMgcyJIrs0B3\nw9h1\r\n=MqfJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEICHmBheFe1DvC3DLOTVj9dyrqx1tJFIpSQmAh6mmglDAIgOnV5nand7WiREmDrJPTD3FXYNt0HbuC57zDoqVWoYD8="}]},"_npmUser":{"name":"cody-greene","email":"cody@variable.run"},"directories":{},"maintainers":[{"name":"cody-greene","email":"cody@variable.run"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-config_3.3.3_1614295581947_0.46325806227459054"},"_hasShrinkwrap":false}},"readme":"> eslint@^2.2.0\n\n### Usage\nThis package offers two [eslint config][] files:\n- [lax.yml](lax.yml) only includes rules that help catch errors while promoting best practices\n- [strict.yml](strict.yml) extends `lax.yml` by adding opinionated styling rules\n\n> When installing this module manually: be sure to use `npm install cody-greene/eslint-config#vXXX`\n\nTo configure a project, add something like this to `package.json`:\n```json\n{\n  \"eslintConfig\": {\n    \"root\": true,\n    \"extends\": \"./node_modules/eslint-config/strict.yml\",\n    \"env\": {\n      \"browser\": true,\n      \"commonjs\": true,\n      \"es6\": true\n    },\n    \"parserOptions\": {\n      \"ecmaVersion\": 6,\n      \"ecmaFeatures\": {\n        \"experimentalObjectRestSpread\": true\n      },\n      \"sourceType\": \"module\"\n    }\n  },\n  \"devDependencies\": {\n    \"eslint-config\": \"cody-greene/eslint-config#v1.0.0\"\n  }\n}\n```\n\n> Once the project is configured, make sure the appropriate [eslint plugin][] is installed for real-time feedback.\n\n### Auto formatting\n`eslint --fix <file>` will automatically fix several issues from the `strict.yml` ruleset, including:\n```\narray-bracket-spacing\neqeqeq\nindent\nkeyword-spacing\nno-multi-spaces\nno-spaced-func\nobject-curly-spacing\nquotes\nsemi\nspace-before-function-paren\nspace-unary-ops\n```\n\n### Style rules\n- [no-trailing-spaces](#no-trailing-spaces)<a name='no-trailing-spaces'></a> Remove any trailing whitespace (configure your editor to do this automatically)\n\n- [eol-last](#eol-last)<a name='eol-last'></a> End files with a single newline character (configure your editor to do this automatically)\n\n- [indent](#indent)<a name='indent'></a> Use soft tabs set to 2 spaces (editor config). And try to limit lines to 100 columns. A complete `.editorconfig` is also provided. Install the plugin for [sublime, vim, etc][] if you'd rather have per-project indentation settings.\n\n> Why? Same line-length & indentation when looking at the editor, the terminal, or github. Viewing hard-tabs properly in the terminal means adding `tabs -2` to `~/.profile` as well as setting `git config --global core.pager 'less --tabs=1,3 --RAW-CONTROL-CHARS'`. Viewing tabs on github as less than the default 8-spaces requires a browser extension.\n\n- [semi](#semi)<a name='semi'></a> Never use semicolons\n\n- [quotes](#quotes)<a name='quotes'></a> Use `'single-quotes'` except when avoiding escape sequences e.g. an apostrophe\n\n- [space-before-function-paren](#space-before-function-paren)<a name='space-before-function-paren'></a> Place 1 space before the arguments list of anonymous functions\n```javascript\n// bad\ndoSomething(function(err, res) {\n  console.log(err, res)\n})\n\n// good\ndoSometing(function (err, res) {\n  console.log(err, res)\n})\n```\n\n- [no-space-func](#no-space-func)<a name='no-spaced-func'></a> Place no space between a function name the the arguments list\n\n- [keyword-spacing](#keyword-spacing)<a name='keyword-spacing'></a> Place 1 space before the opening parenthesis in control statements.\n```javascript\n// bad\nif(isJedi) {\n  fight ()\n}\n\n// good\nif (isJedi) {\n  fight()\n}\n```\n\n- [brace-style](#brace-style)<a name='brace-style'></a> Place 1 space before the leading brace. `else` & `if-else` should not be next to a closing brace.\n```javascript\n// bad\nif (foo){\n  bar()\n}else\n{\n  baz()\n}\n\n// good\nif (foo) {\n  bar()\n}\nelse {\n  baz()\n}\n\n// exception: one-liners (good)\nfunction test(){ return 'test' }\nif (foo) bar()\nelse baz()\n```\n\n- [block-spacing](#block-spacing) <a name='block-spacing'></a> Do not pad your blocks with blank lines\n```javascript\n// bad\nfunction bar() {\n\n  console.log(foo)\n\n}\n\n// good\nif (baz) {\n  console.log(qux)\n} else {\n  console.log(foo)\n}\n```\n\n- [space-in-parens](#space-in-parens) <a name='space-in-parens'></a> Do not add spaces inside parentheses\n```javascript\n// bad\nfunction bar( foo ) {\n  return foo + baz( qux )\n}\n\n// good\nif (foo) {\n  console.log(foo)\n}\n```\n\n- [array-bracket-spacing](#array-bracket-spacing) <a name='array-bracket-spacing'></a> Do not add spaces inside brackets\n```javascript\n// bad\nconst foo = [ 1, 2, 3 ]\nconsole.log(foo[ 0 ])\n\n// good\nconst foo = [1, 2, 3]\nconsole.log(foo[0])\n```\n\n- [operator-linebreak](#operator-linebreak)<a name='operator-linebreak'></a> When a statement is too long to fit on a single line, insert line breaks before operators\n```javascript\n// bad\nif (someCondition ||\n  otherCondition) {\n}\n\n// good\nif (someCondition\n  || otherCondition) {\n}\n```\n\n- [func-style](#func-style)<a name='func-style'></a> Use function declarations instead of function expressions\n```javascript\n// bad\nconst test = function (){ return 'hello' }\n\n// good\nfunction test(){ return 'hello' }\n\n// exception: arrow-functions\nconst test = () => 'hello'\n```\n\n- [one-var-declaration-per-line](#one-var-declaration-per-line)<a name='one-var-declaration-per-line'></a> Use one `var/let/const` declaration per variable\n\n> Why? It's easier to add/remove variables without messing with commas.\n> Also, v8 will de-optimize any blocks containing `let foo, bar` (but not `var foo, bar`)\n\n```javascript\n// bad\nconst foo = 867\n  , bar = 53\n  , baz = 0.9\n\n// good\nconst foo = 867\nconst bar = 53\nconst baz = 0.9\n```\n\n- [comments](#comments)<a name='comments'></a> Use `/** ... */` for multi-line jsdoc style comments\n```javascript\n/**\n * Post a new job for an active worker to execute\n * @example\n *   let redis = require('redis').createClient()\n *   // You may want to partially bind this:\n *   // enqueue = enqueue.bind(null, redis)\n *   enqueue(redis, {queue:'low', type:'ping'}, console.log)\n *   enqueue(redis, {queue:'hi', type:'ping', params: {\n *     foo: true,\n *     bar: 'baz'\n *   }}, console.log)\n * @param {RedisClient} redis\n * @param {string} opt.queue e.g. critical, high, low\n * @param {string} opt.type Name of the job handler\n * @param {object?} opt.params e.g. userid: '123' (may be null)\n * @param {number?} opt.time Delay the job until: epoch-time in milliseconds (default: no delay)\n * @param {function} done(err, id) Receives a unique job id if successful\n * @returns {boolean} false if redis command was added to offline queue\n */\nfunction enqueue(redis, opt, done) {}\n```\n\n- [todo](#todo)<a name='todo'></a> Use `TODO` & `FIXME` to annotate problems\n```javascript\nclass Calculator extends Abacus {\n  constructor() {\n    super()\n\n    // TODO: total should be configurable by an options param\n    this.total = 0\n  }\n}\n```\n\n- [naming](#naming)<a name='naming'></a> Avoid single letter variables. Be descriptive. Use PascalCase for classes and camelCase for everything else\n```javascript\n// bad\nfor (let i = 0; i < list.length; ++i) {\n  let e = list[i]\n  console.log(i, e)\n}\n\n// good\nfor (let index = 0; index < attendeeList.length; ++index) {\n  let person = attendeeList[index]\n  console.log(index, person)\n}\n```\n\n- [no-unneeded-ternary](#no-unneeded-ternary)<a name='no-unneeded-ternary'></a> Don't use conditional expressions that can be expressed with simpler constructs\n```javascript\n// bad\nvar isDefault = answer === 1 ? true : false;\n\n// good\nvar isDefault = answer === 1;\n\n// bad\nvar foo = foo ? foo : 1;\n\n// good\nvar foo = foo || 1;\n```\n\n#### Versioning this project\n`v<eslint-major>.<eslint-minor>.<config-version>[-cp]`\n\nexample: eslint@2.2.0\n- release eslint-config@2.2.0\n- enable/change another rule\n- release eslint-config@2.2.1\n- eslint@2.3.0 released\n- update config with any new rules\n- release eslint-config@2.3.0\n\n[eslint config]: http://eslint.org/docs/rules\n[eslint plugin]: http://eslint.org/docs/user-guide/integrations\n[sublime, vim, etc]: http://editorconfig.org/#download\n","maintainers":[{"name":"cody-greene","email":"cody@variable.run"}],"time":{"modified":"2022-06-12T16:20:43.282Z","created":"2016-06-21T21:13:08.851Z","2.2.2":"2016-06-21T21:13:08.851Z","2.13.0":"2016-06-28T16:06:39.336Z","3.3.0":"2016-08-18T16:37:10.199Z","3.3.1":"2016-09-12T19:01:22.199Z","3.3.2":"2021-02-25T22:33:50.405Z","3.3.3":"2021-02-25T23:26:22.077Z"},"readmeFilename":"readme.md"}