1
1
mirror of https://github.com/primer/css.git synced 2024-12-21 05:01:45 +03:00

Merge pull request #1 from primer/github_eslint

Adding eslint to lint js files
This commit is contained in:
Jon Rohan 2016-07-05 15:50:03 -04:00 committed by GitHub
commit b48eaf9c9a
3 changed files with 24 additions and 8 deletions

13
.eslintrc.json Normal file
View File

@ -0,0 +1,13 @@
{
"plugins": [
"eslint-plugin-github"
],
"env": {
"es6": true,
"node": true
},
"extends": [
"plugin:github/recommended",
"plugin:github/es6"
]
}

View File

@ -1,8 +1,8 @@
import config from "../" const config = require("../")
import stylelint from "stylelint" const stylelint = require("stylelint")
import test from "ava" const test = require("ava")
const validCss = ( const validCss =
`@import "x.css"; `@import "x.css";
@import "y.css"; @import "y.css";
@ -70,13 +70,13 @@ const validCss = (
background-image: url("x.svg"); background-image: url("x.svg");
} }
} }
`) `
const invalidCss = ( const invalidCss =
`a { `a {
top: .2em; top: .2em;
} }
`) `
test("no warnings with valid css", t => { test("no warnings with valid css", t => {
return stylelint.lint({ return stylelint.lint({

View File

@ -5,7 +5,8 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"ava": "ava --verbose \"__tests__/**/*.js\"", "ava": "ava --verbose \"__tests__/**/*.js\"",
"test": "npm run ava" "lint": "eslint **/*.js",
"test": "npm run lint && npm run ava"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -30,6 +31,8 @@
}, },
"devDependencies": { "devDependencies": {
"ava": "^0.15.2", "ava": "^0.15.2",
"eslint": "^3.0.1",
"eslint-plugin-github": "^0.4.0",
"stylelint": "^6.6.0" "stylelint": "^6.6.0"
} }
} }