From 89047f151a0ecb2fb38e294c3700eb511719456e Mon Sep 17 00:00:00 2001 From: Darrel O'Pry Date: Fri, 7 Oct 2016 16:37:15 -0400 Subject: [PATCH] Add ESLint recommendations --- a1/README.md | 150 ++++++++++++++++++++++++++++++++++++++++++++ a1/assets/.eslintrc | Bin 0 -> 4486 bytes 2 files changed, 150 insertions(+) create mode 100644 a1/assets/.eslintrc diff --git a/a1/README.md b/a1/README.md index edbbef19..24febc6a 100644 --- a/a1/README.md +++ b/a1/README.md @@ -50,6 +50,7 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see 1. [Comments](#comments) 1. [JSHint](#js-hint) 1. [JSCS](#jscs) + 1. [ESLint](#eslint) 1. [Constants](#constants) 1. [File Templates and Snippets](#file-templates-and-snippets) 1. [Yeoman Generator](#yeoman-generator) @@ -2919,6 +2920,155 @@ Unit testing helps maintain clean code, as such I included some of my recommenda **[Back to top](#table-of-contents)** +## ESLint + +### Use an Options File +###### [Style [Y236](#style-y236)] + + - Use ESLint to check your Javscript coding style. Be sure to include the [ESLint options file](assets/.eslintrc) in your source control. See the [ESLint docs](http://eslint.org/) for details on the options. + + *Why?*: Provides a first alert prior to committing any code to source control. + + *Why?*: Provides consistency across your team. + + ```javascript + { + "env": { + "browser": true, + "node": true + }, + "globals": { + "angular": false, + "$": false + }, + "rules": { + "no-bitwise": 2, + "camelcase": [ + 2, + { + "properties": "never" + } + ], + "curly": [ + 2, + "all" + ], + "eqeqeq": 2, + "guard-for-in": 2, + "no-extend-native": 2, + "wrap-iife": 2, + "indent": [ + 2, + 4, + { + "SwitchCase": 1 + } + ], + "no-use-before-define": [ + 2, + { + "functions": false + } + ], + "new-cap": 2, + "no-caller": 2, + "no-empty": 2, + "no-irregular-whitespace": 2, + "no-new": 2, + "no-plusplus": 0, + "quotes": [ + 2, + "single" + ], + "no-undef": 2, + "no-unused-vars": 0, + "strict": 0, + "max-params": [ + 2, + 10 + ], + "max-depth": [ + 2, + 5 + ], + "max-statements": [ + 2, + 40 + ], + "complexity": [ + 2, + 8 + ], + "max-len": [ + 2, + 100 + ], + "semi": 0, + "no-cond-assign": 0, + "no-debugger": 0, + "no-eq-null": 2, + "no-eval": 0, + "no-unused-expressions": 0, + "block-scoped-var": 0, + "no-iterator": 0, + "linebreak-style": 0, + "comma-style": [ + 2, + "first" + ], + "no-loop-func": 2, + "no-multi-str": 2, + "valid-typeof": 0, + "no-proto": 0, + "no-script-url": 0, + "no-shadow": 2, + "dot-notation": 0, + "no-new-func": 0, + "no-new-wrappers": 0, + "no-invalid-this": 0, + "require-yield": 0, + "operator-linebreak": [ + 2, + "after" + ], + "no-mixed-spaces-and-tabs": 2, + "no-trailing-spaces": 2, + "space-unary-ops": [ + 2, + { + "nonwords": false, + "overrides": {} + } + ], + "keyword-spacing": [ + 2, + {} + ], + "space-infix-ops": 2, + "space-before-blocks": [ + 2, + "always" + ], + "eol-last": 2, + "array-bracket-spacing": [ + 2, + "never", + { + "singleValue": true + } + ], + "space-in-parens": [ + 2, + "never" + ], + "valid-jsdoc": 2, + "no-multiple-empty-lines": 2 + } + } + ``` + +**[Back to top](#table-of-contents)** + ## Constants ### Vendor Globals diff --git a/a1/assets/.eslintrc b/a1/assets/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..f5839fa56c2c76c138f94ede9bbfede9a9795751 GIT binary patch literal 4486 zcmbuCTaOY!5QY2M#Q$I>K1#B?Srg-{Kf%No;{zH6cN2EITUawO zlB-r$3!k4q`Pzy4;{w{9JQnVF6UwY&ywI6;ywH2@ehZiVi}6J@spVJK|LJg|YAuBtwpaS(J0|R~R0X2my^zu^ z>uB{XM{J6!Q+@BB_YmDcujcB(wNQFp$L!`(MJelMrVNB;rtDDHMm~l@=DCY`u^eK` zGem3QrbhnVtnbb=lc`&F%D|%EqP|SNQ7%&yy#1Z&HDgMjT;ZLXo4)9_XK_;2l@Bx6 z2z@Cms3exM#Uw<>(;7>tFFQkB zM^fcfuVxR4S#t|0)~7_w4V{E`woxt$Vz+-->Lr^s_5=3O#ih<))0ELU-I} z+_G#VM}1;59!FWSPH40}koCEWjfYe%4pnXDGa5RI4FB}Zo8=ImZ6cy4_S#ac4Wxv19WgEQmrk~R8?*grDfKZq#whFt<51;w%tahI%Lq){2)!snA z2@4yq-<{8&{k^if>It7AeHP3QGVwbj+sdsKVCr3ZQVyfGr`%7)VJ1ICC$@Ebb1T`l T)_w|U=9tI)Q1_=XVE_LEx}y=R literal 0 HcmV?d00001