Skip to content

Commit b48eaf9

Browse files
authored
Merge pull request #1 from primer/github_eslint
Adding eslint to lint js files
2 parents 07d0435 + 7087a44 commit b48eaf9

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

.eslintrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"plugins": [
3+
"eslint-plugin-github"
4+
],
5+
"env": {
6+
"es6": true,
7+
"node": true
8+
},
9+
"extends": [
10+
"plugin:github/recommended",
11+
"plugin:github/es6"
12+
]
13+
}

__tests__/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import config from "../"
2-
import stylelint from "stylelint"
3-
import test from "ava"
1+
const config = require("../")
2+
const stylelint = require("stylelint")
3+
const test = require("ava")
44

5-
const validCss = (
5+
const validCss =
66
`@import "x.css";
77
@import "y.css";
88
@@ -70,13 +70,13 @@ const validCss = (
7070
background-image: url("x.svg");
7171
}
7272
}
73-
`)
73+
`
7474

75-
const invalidCss = (
75+
const invalidCss =
7676
`a {
7777
top: .2em;
7878
}
79-
`)
79+
`
8080

8181
test("no warnings with valid css", t => {
8282
return stylelint.lint({

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"ava": "ava --verbose \"__tests__/**/*.js\"",
8-
"test": "npm run ava"
8+
"lint": "eslint **/*.js",
9+
"test": "npm run lint && npm run ava"
910
},
1011
"repository": {
1112
"type": "git",
@@ -30,6 +31,8 @@
3031
},
3132
"devDependencies": {
3233
"ava": "^0.15.2",
34+
"eslint": "^3.0.1",
35+
"eslint-plugin-github": "^0.4.0",
3336
"stylelint": "^6.6.0"
3437
}
3538
}

0 commit comments

Comments
 (0)