eslint-config-onelint
Advanced tools
Comparing version 0.0.4 to 1.0.0
@@ -16,3 +16,3 @@ Errors when variables are used outside of the block in which they were defined. | ||
```output | ||
Line 9, column 17: "build" used outside of binding context. | ||
Line 9, column 17: 'build' used outside of binding context. | ||
``` |
@@ -38,3 +38,2 @@ Blocks should be braced like this: | ||
Line 26, column 1: Opening curly brace does not appear on the same line as controlling statement. | ||
Line 30, column 5: Keyword "else" must not be followed by a newline. | ||
Line 31, column 1: Closing curly brace does not appear on the same line as the subsequent block. | ||
@@ -41,0 +40,0 @@ ``` |
@@ -23,3 +23,3 @@ Should require use of dot notation. | ||
```output | ||
Line 20, column 1: ["bar"] is better written in dot notation. | ||
Line 20, column 5: ["bar"] is better written in dot notation. | ||
``` | ||
@@ -26,0 +26,0 @@ |
@@ -25,2 +25,17 @@ You must use 4 spaces for indentation. | ||
switch (foo) { | ||
case 'foo': | ||
num++; | ||
break; | ||
case 'bar': | ||
num--; | ||
break; | ||
default: | ||
num = num * 2; | ||
} | ||
``` | ||
```js | ||
var foo = 'foo'; | ||
var num = 0; | ||
switch (foo) { | ||
case 'foo': | ||
@@ -37,26 +52,11 @@ num++; | ||
```js | ||
var foo = 'foo'; | ||
var num = 0; | ||
switch (foo) { | ||
case 'foo': | ||
num++; | ||
break; | ||
case 'bar': | ||
num--; | ||
break; | ||
default: | ||
num = num * 2; | ||
} | ||
``` | ||
```output | ||
Line 40, column 1: Expected indentation of 4 space characters but found 0. | ||
Line 41, column 5: Expected indentation of 8 space characters but found 4. | ||
Line 42, column 5: Expected indentation of 8 space characters but found 4. | ||
Line 43, column 1: Expected indentation of 4 space characters but found 0. | ||
Line 44, column 5: Expected indentation of 8 space characters but found 4. | ||
Line 45, column 5: Expected indentation of 8 space characters but found 4. | ||
Line 46, column 1: Expected indentation of 4 space characters but found 0. | ||
Line 47, column 5: Expected indentation of 8 space characters but found 4. | ||
Line 40, column 5: Expected indentation of 0 space characters but found 4. | ||
Line 41, column 9: Expected indentation of 4 space characters but found 8. | ||
Line 42, column 9: Expected indentation of 4 space characters but found 8. | ||
Line 43, column 5: Expected indentation of 0 space characters but found 4. | ||
Line 44, column 9: Expected indentation of 4 space characters but found 8. | ||
Line 45, column 9: Expected indentation of 4 space characters but found 8. | ||
Line 46, column 5: Expected indentation of 0 space characters but found 4. | ||
Line 47, column 9: Expected indentation of 4 space characters but found 8. | ||
``` | ||
@@ -63,0 +63,0 @@ |
@@ -12,3 +12,3 @@ In JavaScript, it's possible to redeclare the same variable name using `var`. | ||
```output | ||
Line 7, column 5: "a" is already defined | ||
Line 7, column 5: 'a' is already defined | ||
``` |
@@ -13,4 +13,4 @@ All non-global variables are required to be declared before they are used. | ||
```output | ||
Line 9, column 1: "foo" is not defined. | ||
Line 10, column 1: "bar" is not defined. | ||
Line 9, column 1: 'foo' is not defined. | ||
Line 10, column 1: 'bar' is not defined. | ||
``` |
@@ -7,3 +7,12 @@ Any unused variables will trigger a warning. | ||
```output | ||
Line 4, column 5: "foo" is defined but never used | ||
Line 4, column 5: 'foo' is defined but never used | ||
``` | ||
But it should not complain about unused function parameters: | ||
```js | ||
/* eslint no-undef: 0 */ | ||
express.use(function (req, res, next) { | ||
return res.end(); | ||
}); | ||
``` |
@@ -10,3 +10,3 @@ Disallow use of the `with` statement. | ||
```output | ||
Line 5, column 2: Parsing error: Strict mode code may not include a with statement | ||
Line 5, column 1: Parsing error: 'with' in strict mode | ||
``` | ||
@@ -13,0 +13,0 @@ |
@@ -19,6 +19,6 @@ Disallow use of padding spaces in parentheses. | ||
```output | ||
Line 13, column 14: There should be no spaces inside this paren. | ||
Line 13, column 20: There should be no spaces inside this paren. | ||
Line 14, column 17: There should be no spaces inside this paren. | ||
Line 16, column 12: There should be no spaces inside this paren. | ||
Line 13, column 13: There should be no spaces inside this paren. | ||
Line 13, column 19: There should be no spaces inside this paren. | ||
Line 14, column 16: There should be no spaces inside this paren. | ||
Line 16, column 11: There should be no spaces inside this paren. | ||
``` |
@@ -38,10 +38,10 @@ ```js | ||
```output | ||
Line 28, column 1: Unary word operator "typeof" must be followed by whitespace. | ||
Line 29, column 1: Unary word operator "void" must be followed by whitespace. | ||
Line 30, column 1: Unary word operator "new" must be followed by whitespace. | ||
Line 31, column 1: Unary word operator "delete" must be followed by whitespace. | ||
Line 32, column 1: Unexpected space after unary operator "++". | ||
Line 33, column 1: Unexpected space before unary operator "--". | ||
Line 34, column 1: Unexpected space after unary operator "-". | ||
Line 35, column 1: Unexpected space after unary operator "+". | ||
Line 28, column 1: Unary word operator 'typeof' must be followed by whitespace. | ||
Line 29, column 1: Unary word operator 'void' must be followed by whitespace. | ||
Line 30, column 1: Unary word operator 'new' must be followed by whitespace. | ||
Line 31, column 1: Unary word operator 'delete' must be followed by whitespace. | ||
Line 32, column 1: Unexpected space after unary operator '++'. | ||
Line 33, column 1: Unexpected space before unary operator '--'. | ||
Line 34, column 1: Unexpected space after unary operator '-'. | ||
Line 35, column 1: Unexpected space after unary operator '+'. | ||
``` |
{ | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
@@ -8,5 +9,5 @@ "node": true, | ||
}, | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"blockBindings": true | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
@@ -25,3 +26,4 @@ "rules": { | ||
"eqeqeq": [2], | ||
"indent": [2, 4, {"SwitchCase": 1}], | ||
"indent": [2, 4], | ||
"keyword-spacing": [2], | ||
"new-cap": [2, {"capIsNew": false}], | ||
@@ -39,6 +41,4 @@ "no-caller": [2], | ||
"no-undef": [2], | ||
"no-unused-vars": [2], | ||
"quotes": [2, "single", "avoid-escape"], | ||
"no-unused-vars": [2, { "args": "none" }], | ||
"semi": [2, "always"], | ||
"space-after-keywords": [2], | ||
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"} ], | ||
@@ -45,0 +45,0 @@ "space-before-blocks": [2, { "functions": "always" } ], |
{ | ||
"name": "eslint-config-onelint", | ||
"version": "0.0.4", | ||
"version": "1.0.0", | ||
"description": "eslint configuration for one.com code style", | ||
@@ -25,3 +25,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": "1.10.3", | ||
"eslint": "2.4.0", | ||
"mocha": "2.3.4", | ||
@@ -28,0 +28,0 @@ "unexpected": "10.4.0" |
@@ -57,2 +57,7 @@ # onelint eslint configuration | ||
Setting up eslint integration in your editor is all that is needed. You can find | ||
a guide most editor in the | ||
[integrations](http://eslint.org/docs/user-guide/integrations) section of the | ||
eslint user guide. Recommended settings for common editors can be found below. | ||
### Atom | ||
@@ -76,1 +81,11 @@ | ||
``` | ||
### Sublime Text 3 | ||
- Install the [Package Control](https://packagecontrol.io/installation) package | ||
manager for sublime text, if it's not already installed. | ||
- Install SublimeLinter through Package Control (Ctrl-P: Install Packages) | ||
- Install [SublimeLinter-contrib-eslint](https://github.com/roadhump/SublimeLinter-eslint) | ||
through Package Control | ||
(Probably works for Sublime Text 2 as well...) |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
28526
0
90