Skip to content

Commit e392f04

Browse files
committed
release: 0.3.0 - standard 11, remove dependency of eslint-plugin-html
1 parent 99df4fe commit e392f04

File tree

8 files changed

+40
-32
lines changed

8 files changed

+40
-32
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11

2-
node_modules
2+
### JetBrains
3+
.idea
34
*.iml
5+
6+
### NodeJS
7+
node_modules

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ To use this config, add this to your `package.json`
1212
```json
1313
{
1414
"devDependencies" : {
15-
"eslint" : "4.16.0",
16-
"eslint-config-coremail" : "0.2.0"
15+
"eslint" : "4.19.1",
16+
"eslint-config-coremail" : "0.3.0"
1717
}
1818
}
1919
```

config/standard.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11

22

33
extends: [standard]
4-
plugins: [html]
4+
5+
6+
parserOptions:
7+
ecmaVersion: 2018
58

69

710
rules:
11+
no-var : [error]
812
no-tabs : [error]
913
indent :
1014
- error

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name" : "eslint-config-coremail",
33
"description" : "Javascript Standard Style - ESLint Shareable Config for coremail.cn",
4-
"version" : "0.2.0",
4+
"version" : "0.3.0",
55
"author" : {
66
"name" : "William Leung",
77
"email" : "[email protected]"
@@ -32,16 +32,15 @@
3232
},
3333

3434
"devDependencies" : {
35-
"eslint" : "~4.16.0"
35+
"eslint" : "~4.19.1"
3636
},
3737

3838
"dependencies" : {
39-
"eslint-plugin-html" : "~4.0.2",
40-
"eslint-plugin-promise" : "~3.6.0",
41-
"eslint-plugin-import" : "~2.8.0",
42-
"eslint-plugin-node" : "~5.2.1",
43-
"eslint-plugin-standard" : "~3.0.1",
44-
"eslint-config-standard" : "~10.2.1"
39+
"eslint-plugin-promise" : "~3.7.0",
40+
"eslint-plugin-import" : "~2.11.0",
41+
"eslint-plugin-node" : "~6.0.1",
42+
"eslint-plugin-standard" : "~3.1.0",
43+
"eslint-config-standard" : "~11.0.0"
4544
},
4645

4746
"eslintConfig" : {

test/samples/sample1-indent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const A = 'A', B = 'B', C = 'C';
44

55
// noinspection UnnecessaryLocalVariableJS
6-
var varA = A,
6+
let varA = A,
77
varB = B,
88
varC = C;
99

test/samples/sample2-general.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22

3-
var foo = function foo() {};
4-
var object = {};
3+
let foo = function foo() {};
4+
let object = {};
55
foo(
66
'demo',
77

@@ -30,20 +30,20 @@ foo(
3030
Comment
3131
*/
3232
// noinspection JSUnusedGlobalSymbols
33-
var myLink = {
33+
let myLink = {
3434
img : "btn.gif",
3535
text : "Button",
3636
width : 128,
3737
},
3838
local = true,
3939
initial = -1;
4040
// noinspection JSUnusedGlobalSymbols
41-
var selector = "#id";
41+
let selector = "#id";
4242

4343
// noinspection JSUnusedGlobalSymbols
44-
var color = "red";
44+
let color = "red";
4545
// noinspection JSUnusedGlobalSymbols
46-
var offset = 10;
46+
let offset = 10;
4747

4848
// noinspection JSUnresolvedVariable
4949
varName = val;

test/samples/sample3-spaces.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import {Component} from 'react'
77
function foo(_x, y, z) {
88
// noinspection JSUnresolvedFunction, JSUnresolvedVariable
99
bar(1, b);
10-
var i = 0;
10+
let i = 0;
1111
// noinspection JSUnusedLocalSymbols, JSDuplicatedDeclaration
12-
var x = {0 : "zero", 1 : "one"};
13-
var a = [0, 1, 2];
12+
let x = {0 : "zero", 1 : "one"};
13+
let a = [0, 1, 2];
1414
// noinspection JSUnusedLocalSymbols, UnterminatedStatementJS
15-
var foo = function () {}
15+
let foo = function () {}
1616
if (!i > 10) {
1717
// noinspection JSDuplicatedDeclaration
1818
for (let j = 0; j < 10; j++) {
@@ -27,7 +27,7 @@ function foo(_x, y, z) {
2727
break;
2828
}
2929
// noinspection JSUnusedLocalSymbols
30-
var c = j > 5 ? "GT 5" : "LE 5";
30+
let c = j > 5 ? "GT 5" : "LE 5";
3131
}
3232
} else {
3333
let j = 0;

test/samples/sample4-wrapping.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
function buzz() { return 0; }
1313

1414
// noinspection JSUnusedGlobalSymbols, JSCommentMatchesSignature
15-
var foo = {
15+
let foo = {
1616

1717
numbers : ['one', 'two', 'three', 'four', 'five', 'six'],
1818
data : {
@@ -27,7 +27,7 @@ var foo = {
2727
fOne : function (a, b, c, d,
2828
e, f, g, h) {
2929
// noinspection JSUnusedLocalSymbols
30-
var x = a
30+
let x = a
3131
+ b
3232
+ c
3333
+ d
@@ -38,16 +38,17 @@ var foo = {
3838
// noinspection JSUnresolvedFunction
3939
fTwo(a, b, c, fThree(d, e, f, g, h));
4040
// noinspection JSUnusedAssignment
41-
var z = a
41+
let z = a
4242
=== 'Some string' ? 'yes' : 'no';
4343
// noinspection JSUnusedAssignment
4444
z = a === 10 ? 'yes' : 'no';
45-
var colors = ['red', 'green', 'blue', 'black', 'white', 'gray'];
45+
let colors = ['red', 'green', 'blue', 'black', 'white', 'gray'];
4646
// noinspection JSUndeclaredVariable
4747
for (j = 0; j < 2; j++) i = a;
48-
// noinspection JSUnusedLocalSymbols
49-
for (var i = 0; i
48+
// noinspection JSUnusedLocalSymbols, ES6ConvertVarToLetConst
49+
for (let i = 0; i
5050
< colors.length; i++)
51+
// eslint-disable-next-line no-var
5152
var colorString = this.numbers[i];
5253
},
5354

@@ -95,7 +96,7 @@ var foo = {
9596
else if (a === 'two') {
9697
return 2;
9798
}
98-
var number = -10;
99+
let number = -10;
99100
// noinspection JSUnresolvedVariable
100101
while (x < 0) {
101102
number = number + 1;
@@ -108,7 +109,7 @@ var foo = {
108109

109110
fThree : function (strA, strB, strC, strD, strE) {
110111
// noinspection JSCheckFunctionSignatures
111-
var number = prompt("Enter a number:", 0);
112+
let number = prompt("Enter a number:", 0);
112113
switch (number) {
113114
case 0 :
114115
alert("Zero");

0 commit comments

Comments
 (0)