Skip to content

Commit

Permalink
fix(config): no-magic-number now ignores -1,0,1
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Mar 25, 2016
1 parent 52c598d commit d16994e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
49 changes: 41 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"env":{
"env": {
"es6": true
},
"rules": {
Expand Down Expand Up @@ -83,7 +83,14 @@
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-magic-numbers": [2, {"ignoreArrayIndexes": true, "enforceConst": true }],
"no-magic-numbers": [
2,
{
"ignore": [0,1,-1],
"ignoreArrayIndexes": true,
"enforceConst": true
}
],
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
Expand Down Expand Up @@ -128,7 +135,13 @@
"no-undef-init": 2,
"no-undefined": 2,
"no-unused-vars": 2,
"no-use-before-define": [2, {"functions": false, "classes": true}],
"no-use-before-define": [
2,
{
"functions": false,
"classes": true
}
],
// node.js and commonjs
"callback-return": 2,
"global-require": 2,
Expand Down Expand Up @@ -177,15 +190,23 @@
],
"lines-around-comment": 2,
"max-depth": 2,
"max-len": [2, 120],
"max-len": [
2,
120
],
"max-nested-callbacks": 2,
"max-params": 2,
"max-statements": 2,
"new-cap": 2,
"new-parens": 2,
"newline-after-var": 2,
"newline-before-return": 0,
"newline-per-chained-call": [2, {"ignoreChainWithDepth": 3}],
"newline-per-chained-call": [
2,
{
"ignoreChainWithDepth": 3
}
],
"no-array-constructor": 2,
"no-bitwise": 2,
"no-continue": 2,
Expand Down Expand Up @@ -223,22 +244,34 @@
"keywords": true
}
],
"quotes": [2, "single"],
"quotes": [
2,
"single"
],
"require-jsdoc": 0,
"semi": 2,
"semi-spacing": 2,
"sort-imports": 2,
"sort-vars": 2,
"space-before-blocks": 2,
"space-before-function-paren": [2, { "anonymous": "always", "named": "never" }],
"space-before-function-paren": [
2,
{
"anonymous": "always",
"named": "never"
}
],
"space-in-parens": 2,
"space-infix-ops": 2,
"space-unary-ops": 2,
"spaced-comment": 0,
"wrap-regex": 0,
// ECMAScript 6
"arrow-body-style": 2,
"arrow-parens": [2, "as-needed"],
"arrow-parens": [
2,
"as-needed"
],
"arrow-spacing": 2,
"constructor-super": 2,
"generator-star-spacing": 2,
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
- `one-var` - `never` use one `var|let|const` per block
- `padded-blocks` - `never` add useless padding
- `quote-props` - quote properties only `as-needed` and `keywords`
- `no-magic-numbers` - enabled `ignoreArrayIndexes` and `enforceConst`
- `no-magic-numbers` - `ignore` `-1,0,1` as most often used numbers and `ignoreArrayIndexes`, `enforceConst` are enabled
## Contribution
- what I really appreciate is configs for IDEs
Expand Down

0 comments on commit d16994e

Please sign in to comment.