eslint-config-defaults
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -13,11 +13,11 @@ 'use strict'; | ||
// specify the maximum cyclomatic complexity allowed in a program | ||
bestPracticesRules['complexity'] = [1, 250]; | ||
bestPracticesRules['complexity'] = [2, 11]; | ||
// require return statements to either always or never specify values | ||
bestPracticesRules['consistent-return'] = 0; | ||
bestPracticesRules['consistent-return'] = 2; | ||
// specify curly brace conventions for all control statements | ||
bestPracticesRules['curly'] = 2; | ||
bestPracticesRules['curly'] = [2, "all"]; | ||
// require default case in switch statements | ||
bestPracticesRules['default-case'] = 2; | ||
// encourages use of dot notation whenever possible | ||
bestPracticesRules['dot-notation'] = 1; | ||
bestPracticesRules['dot-notation'] = [2, { allowKeywords: true }]; | ||
// enforces consistent newlines before or after dots | ||
@@ -38,3 +38,3 @@ bestPracticesRules['dot-location'] = [2, "property"]; | ||
// disallow use of labels for anything other then loops and switches | ||
bestPracticesRules['no-empty-label'] = 1; | ||
bestPracticesRules['no-empty-label'] = 2; | ||
// disallow comparisons to null without a type-checking operator | ||
@@ -61,5 +61,5 @@ bestPracticesRules['no-eq-null'] = 2; | ||
// disallow creation of functions within loops | ||
bestPracticesRules['no-loop-func'] = 0; | ||
bestPracticesRules['no-loop-func'] = 2; | ||
// disallow use of multiple spaces | ||
bestPracticesRules['no-multi-spaces'] = 0; | ||
bestPracticesRules['no-multi-spaces'] = 2; | ||
// disallow use of multiline strings | ||
@@ -86,5 +86,5 @@ bestPracticesRules['no-multi-str'] = 2; | ||
// disallow declaring the same variable more then once | ||
bestPracticesRules['no-redeclare'] = 1; | ||
bestPracticesRules['no-redeclare'] = 2; | ||
// disallow use of assignment in return statement | ||
bestPracticesRules['no-return-assign'] = 0; | ||
bestPracticesRules['no-return-assign'] = 2; | ||
// disallow use of `javascript:` urls. | ||
@@ -100,6 +100,2 @@ bestPracticesRules['no-script-url'] = 2; | ||
bestPracticesRules['no-unused-expressions'] = 2; | ||
// disallow use of void operator | ||
bestPracticesRules['no-void'] = 0; | ||
// disallow usage of configurable warning terms in comments: e.g. todo | ||
bestPracticesRules['no-warning-comments'] = 0; | ||
// disallow use of the with statement | ||
@@ -106,0 +102,0 @@ bestPracticesRules['no-with'] = 2; |
@@ -9,3 +9,3 @@ 'use strict'; | ||
// disallow trailing commas in object literals | ||
errorRules['comma-dangle'] = [2, "never"]; | ||
errorRules['comma-dangle'] = 2; | ||
// disallow assignment in conditional expressions | ||
@@ -36,3 +36,3 @@ errorRules['no-cond-assign'] = 2; | ||
// disallow unnecessary parentheses | ||
errorRules['no-extra-parens'] = 0; | ||
errorRules['no-extra-parens'] = 2; | ||
// disallow unnecessary semicolons | ||
@@ -63,3 +63,3 @@ errorRules['no-extra-semi'] = 2; | ||
// ensure JSDoc comments are valid | ||
errorRules['valid-jsdoc'] = [1, { "prefer": { "return": "return" }, "requireReturn": false }]; | ||
errorRules['valid-jsdoc'] = 2; | ||
// ensure that the results of typeof are compared against a valid string | ||
@@ -66,0 +66,0 @@ errorRules['valid-typeof'] = 2; |
@@ -9,14 +9,12 @@ 'use strict'; | ||
// specify the maximum depth that blocks can be nested | ||
legacyRules['max-depth'] = 0; | ||
legacyRules['max-depth'] = [2, 4]; | ||
// specify the maximum length of a line in your program | ||
legacyRules['max-len'] = [2, 100, 4]; | ||
legacyRules['max-len'] = [2, 100, 2]; | ||
// limits the number of parameters that can be used in the function declaration. | ||
legacyRules['max-params'] = [1, 5]; | ||
legacyRules['max-params'] = [2, 4]; | ||
// specify the maximum number of statement allowed in a function | ||
legacyRules['max-statements'] = 0; | ||
legacyRules['max-statements'] = [2, 15]; | ||
// disallow use of bitwise operators | ||
legacyRules['no-bitwise'] = 0; | ||
// disallow use of unary operators, ++ and -- | ||
legacyRules['no-plusplus'] = 0; | ||
legacyRules['no-bitwise'] = 2; | ||
module.exports = legacy; |
@@ -18,3 +18,3 @@ 'use strict'; | ||
// disallow mixing regular variable and require declarations | ||
nodeRules['no-mixed-requires'] = [1, true]; | ||
nodeRules['no-mixed-requires'] = 2; | ||
// disallow use of new operator with the require function | ||
@@ -25,8 +25,4 @@ nodeRules['no-new-require'] = 2; | ||
// disallow process['exit() | ||
nodeRules['no-process-exit'] = 0; | ||
// restrict usage of specified node modules | ||
nodeRules['no-restricted-modules'] = 0; | ||
// disallow use of synchronous methods (off by default) | ||
nodeRules['no-sync'] = 0 | ||
nodeRules['no-process-exit'] = 2; | ||
module.exports = node; |
@@ -17,3 +17,3 @@ { | ||
"version" : "0.1.0", | ||
"version" : "0.2.0", | ||
"author" : "Eric Baer <me@ericbaer.com>", | ||
@@ -36,3 +36,3 @@ | ||
"main": "./index.js", | ||
"main": "./defaults.js", | ||
@@ -39,0 +39,0 @@ "engines":{ |
@@ -27,2 +27,3 @@ # eslint-config-strict | ||
- `defaults/node` | ||
- `defaults/off` | ||
- `defaults/test` | ||
@@ -58,4 +59,2 @@ | ||
### How to use | ||
To extend a config in ESLint just add the extends attribute to your `.eslintrc` | ||
@@ -77,6 +76,2 @@ | ||
For more details about how shareable configs work, see the [ESLint documentation][shareable configs]. | ||
[shareable configs]: http://eslint.org/docs/developer-guide/shareable-configs | ||
*** | ||
@@ -83,0 +78,0 @@ |
@@ -20,10 +20,6 @@ 'use strict'; | ||
styleRules['eol-last'] = 2; | ||
// require function expressions to have a name | ||
styleRules['func-names'] = 0; | ||
// enforces use of function declarations or expressions | ||
styleRules['func-style'] = 0; | ||
// enforces spacing between keys and values in object literal properties | ||
styleRules['key-spacing'] = 2; | ||
// specify the maximum depth callbacks can be nested | ||
styleRules['max-nested-callbacks'] = 0; | ||
styleRules['max-nested-callbacks'] = [2, 3]; | ||
// use two spaces for indentation | ||
@@ -38,3 +34,3 @@ styleRules['indent'] = [2, 2]; | ||
// disallow if as the only statement in an else block | ||
styleRules['no-lonely-if'] = 0; | ||
styleRules['no-lonely-if'] = 2; | ||
// disallow mixed spaces and tabs for indentation | ||
@@ -45,7 +41,5 @@ styleRules['no-mixed-spaces-and-tabs'] = 2; | ||
// disallow use of the Object constructor | ||
styleRules['no-new-object'] = 1; | ||
styleRules['no-new-object'] = 2; | ||
// disallow space between function identifier and application | ||
styleRules['no-spaced-func'] = 2; | ||
// disallow the use of ternary operators | ||
styleRules['no-ternary'] = 0; | ||
// disallow trailing whitespace at the end of lines | ||
@@ -55,30 +49,22 @@ styleRules['no-trailing-spaces'] = 2; | ||
styleRules['no-multiple-empty-lines'] = 2; | ||
// disallow dangling underscores in identifiers | ||
styleRules['no-underscore-dangle'] = 0; | ||
// disallow wrapping of non-IIFE statements in parens | ||
styleRules['no-wrap-func'] = 2; | ||
// allow just one var statement per function | ||
styleRules['one-var'] = 0; | ||
// enforce padding within blocks | ||
styleRules['padded-blocks'] = 0; | ||
styleRules['one-var'] = [2, "never"]; | ||
// allow just one var statement per function | ||
styleRules['operator-assignment'] = [2, "always"]; | ||
// specify whether double or single quotes should be used | ||
styleRules['quotes'] = [1, "single", "avoid-escape"]; | ||
// require quotes around object literal property names | ||
styleRules['quote-props'] = 0; | ||
// require or disallow use of semicolons instead of ASI | ||
styleRules['semi'] = [2, "always"]; | ||
styleRules['semi'] = 2; | ||
// enforce spacing before and after semicolons | ||
styleRules['semi-spacing'] = 2; | ||
// sort variables within the same declaration block | ||
styleRules['sort-vars'] = 0; | ||
// require a space after certain keywords | ||
styleRules['space-after-keywords'] = [2, "always"]; | ||
styleRules['space-after-keywords'] = 2; | ||
// require or disallow space before blocks | ||
styleRules['space-before-blocks'] = 2; | ||
// require or disallow space before function opening parenthesis | ||
styleRules['space-before-function-paren'] = [2, "never"]; | ||
// require or disallow spaces inside brackets | ||
styleRules['space-in-brackets'] = 0; | ||
styleRules['space-before-function-paren'] = [2, {anonymous: "always", named: "never" }]; | ||
// require or disallow spaces inside parentheses | ||
styleRules['space-in-parens'] = 0; | ||
styleRules['space-in-parens'] = 2; | ||
// require spaces around operators | ||
@@ -92,5 +78,3 @@ styleRules['space-infix-ops'] = 2; | ||
styleRules['spaced-line-comment'] = 2; | ||
// require regex literals to be wrapped in parentheses | ||
styleRules['wrap-regex'] = 0; | ||
module.exports = style; |
@@ -17,3 +17,3 @@ 'use strict'; | ||
// disallow declaration of variables already declared in the outer scope | ||
variablesRules['no-shadow'] = 1; | ||
variablesRules['no-shadow'] = 2; | ||
// disallow use of undefined when initializing variables | ||
@@ -26,3 +26,3 @@ variablesRules['no-undef-init'] = 2; | ||
// disallow declaration of variables that are not used in the code | ||
variablesRules['no-unused-vars'] = 1; | ||
variablesRules['no-unused-vars'] = 2; | ||
// disallow use of variables before they are defined | ||
@@ -29,0 +29,0 @@ variablesRules['no-use-before-define'] = 2 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
32073
735
79