Skip to content

Commit 53c623f

Browse files
committed
update eslint more
1 parent c386f7e commit 53c623f

2 files changed

Lines changed: 103 additions & 54 deletions

File tree

.eslintrc

Lines changed: 98 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,105 @@
11
{
2-
"extends": "eslint:recommended",
2+
"extends": "eslint:recommended",
33

4-
"env": {
5-
"browser": true,
6-
"node": true
7-
},
4+
"env": {
5+
"browser": true,
6+
"node": true
7+
},
88

9-
"rules": {
10-
// possible errors
11-
"no-console": 0,
9+
"rules": {
10+
// possible errors
11+
"no-console": 0,
1212

13-
// best practicies
14-
"curly": 2,
15-
"eqeqeq": 2,
16-
"no-eval": 2,
17-
"no-extend-native": [1, {"exceptions": ["String"]}],
18-
"no-floating-decimal": 2,
19-
"no-implied-eval": 2,
20-
"no-invalid-this": 2,
21-
"no-lone-blocks": 1,
22-
"no-multi-spaces": 2,
23-
"no-multi-str": 2,
24-
"no-new-wrappers": 1,
25-
"no-new": 2,
26-
"no-octal": 1,
27-
"no-proto": 2,
28-
"no-script-url": 2,
29-
"no-self-compare": 1,
30-
"no-sequences": 2,
31-
"no-throw-literal": 2,
32-
"no-unused-expressions": 2,
33-
"no-useless-call": 1,
34-
"no-void": 2,
35-
"no-with": 2,
36-
"radix": 1,
37-
"wrap-iife": [2, "inside"],
38-
"yoda": 2,
13+
// best practicies
14+
"curly": 2,
15+
"eqeqeq": 2,
16+
"no-eval": 2,
17+
"no-extend-native": [1, {
18+
"exceptions": ["String"]
19+
}],
20+
"no-floating-decimal": 2,
21+
"no-implied-eval": 2,
22+
"no-invalid-this": 2,
23+
"no-lone-blocks": 1,
24+
"no-multi-spaces": 2,
25+
"no-multi-str": 2,
26+
"no-new-wrappers": 1,
27+
"no-new": 2,
28+
"no-octal": 1,
29+
"no-proto": 2,
30+
"no-script-url": 2,
31+
"no-self-compare": 1,
32+
"no-sequences": 2,
33+
"no-throw-literal": 2,
34+
"no-unused-expressions": 2,
35+
"no-useless-call": 1,
36+
"no-void": 2,
37+
"no-with": 2,
38+
"radix": 1,
39+
"wrap-iife": [2, "inside"],
40+
"yoda": 2,
3941

40-
// variables
41-
"no-shadow-restricted-names": 2,
42-
"no-undef": 2,
43-
"no-undefined": 2,
42+
// variables
43+
"no-shadow-restricted-names": 2,
44+
"no-undef": 2,
45+
"no-undefined": 2,
46+
"no-use-before-define": [2, "nofunc"],
4447

45-
// stylistic issues
46-
"brace-style": [2, "stroustrup", { "allowSingleLine": false }],
47-
"comma-style": [2, "last"],
48-
"indent": 2,
49-
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
50-
"no-spaced-func": 2,
51-
"one-var": [2, "never"],
52-
"quotes": [2, "single"],
53-
"semi-spacing": 2,
54-
"space-after-keywords": [2, "never"],
55-
"space-before-function-paren": [2, "never"],
56-
"space-before-keywords": [2, "always"]
57-
}
48+
// node.js and common.js
49+
"global-require": 2,
50+
"handle-callback-err": [2, "^(err|error)$"],
51+
"no-path-concat": 2,
52+
53+
// stylistic issues
54+
"block-spacing": [2, "always"],
55+
"brace-style": [2, "stroustrup", {
56+
"allowSingleLine": false
57+
}],
58+
"camelcase": 1,
59+
"comma-spacing": [2, {
60+
"before": false,
61+
"after": true
62+
}],
63+
"comma-style": [2, "last"],
64+
"computed-property-spacing": [2, "never"],
65+
"eol-last": 2,
66+
"indent": 2,
67+
// "jsx-quotes": [2, "prefer-double"],
68+
"key-spacing": [2, {
69+
"beforeColon": false,
70+
"afterColon": true
71+
}],
72+
"lines-around-comment": [2, {
73+
"beforeBlockComment": true,
74+
"beforeLineComment": true,
75+
"allowBlockStart": true,
76+
"allowObjectStart": true
77+
}],
78+
"new-cap": 2,
79+
"new-parens": 2,
80+
"newline-after-var": [2, "always"],
81+
"no-array-constructor": 2,
82+
"no-multiple-empty-lines": [2, {
83+
"max": 2
84+
}],
85+
"no-nested-ternary": 1,
86+
"no-new-object": 2,
87+
"no-spaced-func": 2,
88+
"no-trailing-spaces": 2,
89+
"no-unneeded-ternary": 1,
90+
"one-var": [2, "never"],
91+
"quote-props": [2, "as-needed"],
92+
"quotes": [2, "single"],
93+
"semi-spacing": 2,
94+
"semi": [2, "always"],
95+
"space-after-keywords": [2, "never"],
96+
"space-before-blocks": [2,"always"],
97+
"space-before-function-paren": [2, "never"],
98+
"space-before-keywords": [2, "always"],
99+
"space-in-parens": [2, "never"],
100+
"space-return-throw-case": 2,
101+
"space-unary-ops": 2,
102+
"spaced-comment": [2, "always", { "exceptions": ["-", "=", "*"] }],
103+
"wrap-regex": 2
104+
}
58105
}

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ module.exports = postcss.plugin('postcss-rgba-hex', function(options) {
5151
var rgbValues = val.match(reg);
5252

5353
// converting values
54-
if(rgbValues && rgbValues.length > 0){
54+
if(rgbValues && rgbValues.length > 0) {
5555
var newVal = val;
56+
5657
rgbValues.forEach(function(rgb) {
5758
newVal = newVal.replace(rgb, rgbaToHex(rgb));
5859
console.info('RGB(a) replaced: ' + rgb + ' -> ' + rgbaToHex(rgb));
5960
});
6061
decl.value = newVal;
6162
}
62-
})
63+
});
6364
};
6465
});
6566

@@ -70,6 +71,7 @@ module.exports = postcss.plugin('postcss-rgba-hex', function(options) {
7071
*/
7172
function rgbaToHex(rgbaString) {
7273
var hexString = '';
74+
7375
hexString = rgb2hex(rgbaString).hex;
7476

7577
return hexString;
@@ -81,4 +83,4 @@ function rgbaToHex(rgbaString) {
8183
*/
8284
function noop() {
8385
return false;
84-
}
86+
}

0 commit comments

Comments
 (0)