mirror of
https://github.com/prymitive/karma
synced 2026-08-23 11:56:20 +00:00
Add eslint config and run eslint if installed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
assets/static/lru.js
|
||||
@@ -0,0 +1,27 @@
|
||||
env:
|
||||
browser: true
|
||||
jquery: true
|
||||
extends:
|
||||
- eslint:recommended
|
||||
rules:
|
||||
indent:
|
||||
- error
|
||||
- 4
|
||||
linebreak-style:
|
||||
- error
|
||||
- unix
|
||||
quotes:
|
||||
- error
|
||||
- double
|
||||
array-bracket-spacing:
|
||||
- warn
|
||||
- always
|
||||
block-spacing:
|
||||
- warn
|
||||
- always
|
||||
brace-style:
|
||||
- warn
|
||||
- 1tbs
|
||||
camelcase: warn
|
||||
no-console: off
|
||||
no-use-before-define: error
|
||||
+3
-7
@@ -6,15 +6,11 @@ go:
|
||||
|
||||
go_import_path: github.com/cloudflare/unsee
|
||||
|
||||
# nodejs is needed so that we can install jshint
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- nodejs
|
||||
|
||||
# install jshint, it's used for linting js files (needs nodejs)
|
||||
# install jshint & eslint, it's used for linting js files (needs nodejs)
|
||||
before_script:
|
||||
- nvm install 6
|
||||
- npm install jshint
|
||||
- npm install eslint
|
||||
|
||||
script:
|
||||
- make test
|
||||
|
||||
@@ -19,8 +19,9 @@ ifdef DEBUG
|
||||
DOCKER_ARGS = -v $(CURDIR)/assets:$(CURDIR)/assets:ro
|
||||
endif
|
||||
|
||||
# detect if jshint is installed
|
||||
# detect if jshint and/or eslint is installed
|
||||
JSHINT := $(shell which jshint)
|
||||
ESLINT := $(shell which eslint)
|
||||
|
||||
.DEFAULT_GOAL := $(NAME)
|
||||
|
||||
@@ -81,6 +82,9 @@ lint: .build/deps.ok
|
||||
ifneq ($(JSHINT),)
|
||||
@$(JSHINT) assets/static/*.js
|
||||
endif
|
||||
ifneq ($(ESLINT),)
|
||||
@$(ESLINT) assets/static/*.js
|
||||
endif
|
||||
|
||||
.PHONY: test
|
||||
test: lint bindata_assetfs.go
|
||||
|
||||
Reference in New Issue
Block a user