Skip to content

Commit 990d762

Browse files
committed
Add ESLint
Uses Airbnbs styleguide as a sensible default
1 parent f4db42e commit 990d762

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.eslintrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "airbnb/legacy",
3+
"rules": {
4+
"vars-on-top": 0,
5+
"comma-dangle": [2, "never"],
6+
"func-names": 0,
7+
"one-var": [2, { uninitialized: "always", initialized: "never" }],
8+
"no-param-reassign": [0],
9+
"no-use-before-define": [2, "nofunc"]
10+
}
11+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@
3434
},
3535
"devDependencies": {
3636
"chai": "^3.4.1",
37+
"eslint": "^1.10.2",
38+
"eslint-config-airbnb": "^1.0.2",
3739
"mocha": "^2.3.4",
3840
"postcss-property-lookup": "^1.1.4",
3941
"rewire": "^2.5.0",
4042
"sinon": "^1.17.2"
4143
},
4244
"scripts": {
43-
"test": "mocha --reporter spec --slow 400",
45+
"test": "npm run lint && mocha --reporter spec --slow 400",
46+
"lint": "eslint lib/index.js test/test.js bin/suitcss",
4447
"watch": "mocha --watch --reporter spec --slow 400"
4548
},
4649
"keywords": [

test/.eslintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../.eslintrc",
3+
"globals": {
4+
"it": true,
5+
"describe": true,
6+
"afterEach": true,
7+
"beforeEach": true
8+
},
9+
"rules": {
10+
"no-unused-expressions": 0
11+
}
12+
}

0 commit comments

Comments
 (0)