mirror of
https://github.com/primer/css.git
synced 2024-12-20 12:42:07 +03:00
Adding eslint to lint js files
This commit is contained in:
parent
07d043551f
commit
7087a447d5
13
.eslintrc.json
Normal file
13
.eslintrc.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"plugins": [
|
||||
"eslint-plugin-github"
|
||||
],
|
||||
"env": {
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:github/recommended",
|
||||
"plugin:github/es6"
|
||||
]
|
||||
}
|
@ -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({
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user