Permalink
Browse files

Adding eslint to lint js files

  • Loading branch information...
1 parent 07d0435 commit 7087a447d586ab0732131f3b924c08a56b0c04ac @jonrohan jonrohan committed Jul 5, 2016
Showing with 24 additions and 8 deletions.
  1. +13 −0 .eslintrc.json
  2. +7 −7 __tests__/index.js
  3. +4 −1 package.json
View
@@ -0,0 +1,13 @@
+{
+ "plugins": [
+ "eslint-plugin-github"
+ ],
+ "env": {
+ "es6": true,
+ "node": true
+ },
+ "extends": [
+ "plugin:github/recommended",
+ "plugin:github/es6"
+ ]
+}
View
@@ -1,8 +1,8 @@
-import config from "../"
-import stylelint from "stylelint"
-import test from "ava"
+const config = require("../")
+const stylelint = require("stylelint")
+const test = require("ava")
-const validCss = (
+const validCss =
`@import "x.css";
@import "y.css";
@@ -70,13 +70,13 @@ const validCss = (
background-image: url("x.svg");
}
}
-`)
+`
-const invalidCss = (
+const invalidCss =
`a {
top: .2em;
}
-`)
+`
test("no warnings with valid css", t => {
return stylelint.lint({
View
@@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"ava": "ava --verbose \"__tests__/**/*.js\"",
- "test": "npm run ava"
+ "lint": "eslint **/*.js",
+ "test": "npm run lint && npm run ava"
},
"repository": {
"type": "git",
@@ -30,6 +31,8 @@
},
"devDependencies": {
"ava": "^0.15.2",
+ "eslint": "^3.0.1",
+ "eslint-plugin-github": "^0.4.0",
"stylelint": "^6.6.0"
}
}

0 comments on commit 7087a44

Please sign in to comment.