Skip to content

Commit 2a94c82

Browse files
authored
Add eslint (#23)
1 parent 2ded01c commit 2a94c82

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

.eslintrc.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
extends: "eslint:recommended"
2+
parserOptions:
3+
ecmaVersion: 6
4+
env:
5+
node: true
6+
es6: true
7+
rules:
8+
consistent-return: "error"
9+
curly: "error"
10+
default-case: "error"
11+
dot-notation: "error"
12+
eqeqeq: "error"
13+
no-extend-native: "error"
14+
no-implicit-coercion: "error"
15+
no-loop-func: "error"
16+
no-multi-spaces: "error"
17+
no-throw-literal: "error"
18+
global-require: "error"
19+
no-path-concat: "error"
20+
brace-style: ["error", "1tbs", {allowSingleLine: true}]
21+
camelcase: "error"
22+
consistent-this: ["error", "self"]
23+
indent: ["error", "tab", {SwitchCase: 1}]
24+
linebreak-style: ["error", "unix"]
25+
eol-last: "error"
26+
quotes: ["error", "single"]
27+
semi: "error"
28+
space-infix-ops: "error"
29+
space-unary-ops: "error"
30+
func-names: "warn"
31+
space-before-function-paren: "warn"
32+
no-spaced-func: "warn"
33+
keyword-spacing: "error"
34+
space-before-blocks: "error"
35+
no-console: "error"

.npmignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/css-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function getUrls (text) {
1212

1313
text = text.replace(commentRegexp, '');
1414

15-
while (urlMatch = urlsRegexp.exec(text)) {
15+
while ((urlMatch = urlsRegexp.exec(text))) {
1616
// Match 3, 5, 6 group if '[@import] url(path)', match 9, 11, 12 group if '@import path'
1717
url = urlMatch[3] || urlMatch[5] || urlMatch[6] || urlMatch[9] || urlMatch[11] || urlMatch[12];
1818

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"readmeFilename": "README.md",
66
"main": "index.js",
77
"scripts": {
8-
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec"
8+
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && npm run eslint",
9+
"eslint": "eslint lib/** index.js"
910
},
1011
"keywords": [
1112
"parser",
@@ -24,8 +25,13 @@
2425
"license": "MIT",
2526
"devDependencies": {
2627
"coveralls": "^3.0.0",
28+
"eslint": "^4.15.0",
2729
"istanbul": "^0.4.5",
2830
"mocha": "^4.0.0",
2931
"should": "^13.0.0"
30-
}
32+
},
33+
"files": [
34+
"index.js",
35+
"lib"
36+
]
3137
}

0 commit comments

Comments
 (0)