Skip to content

Commit 049d608

Browse files
committed
add eslint linting to CI
1 parent 0bee254 commit 049d608

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

.eslintrc.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
3+
"extends": "eslint:recommended",
4+
5+
"parserOptions": {
6+
"ecmaVersion": 6,
7+
"sourceType": "module"
8+
},
9+
10+
"env": {
11+
"browser": true,
12+
"node": true,
13+
"mocha": true
14+
},
15+
16+
"globals": {
17+
"cordova": true,
18+
"Promise": true,
19+
"Uint8Array": true,
20+
"ArrayBuffer": true,
21+
"FileReaderSync": true,
22+
"sqlitePlugin": true,
23+
"emit": true,
24+
"PouchDB": true,
25+
"should": true,
26+
"testUtils": true,
27+
"importScripts": true
28+
},
29+
30+
"rules": {
31+
"no-empty": 0,
32+
"no-console": 0,
33+
"semi": ["error", "always"]
34+
}
35+
}

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ before_install:
1111
- nvm use stable
1212
- npm install
1313
- SAUCE_CONNECT_DOWNLOAD_ON_INSTALL=true node node_modules/sauce-connect-launcher/scripts/install.js
14+
before_script:
15+
- npm run lint
1416
env:
1517
matrix:
1618
- COMMAND=test-phantom

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ This will build the JS files and write them to `dist/`.
146146
Testing
147147
----
148148

149+
To run the eslint tests:
150+
151+
npm run lint
152+
149153
To run the tests on any available Android device:
150154

151155
npm run test-android

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"build": "rimraf dist && mkdirp dist && browserify -t rollupify -s sqlitePlugin src/javascript/index.js > dist/sqlite-plugin.js",
77
"build-test": "bash ./bin/build-test.sh",
8+
"lint": "eslint src test/*js",
89
"test": "npm run test-device",
910
"test-local": "zuul --ui mocha-bdd --local 9000 --no-coverage test/test.js",
1011
"test-phantom": "npm run build && zuul --ui mocha-bdd --phantom --no-coverage test/test.js",
@@ -48,6 +49,7 @@
4849
"colors": "1.1.2",
4950
"cordova": "6.1.0",
5051
"denodeify": "1.2.1",
52+
"eslint": "2.7.0",
5153
"lodash.find": "4.2.0",
5254
"lodash.map": "4.2.1",
5355
"lodash.zipobject": "4.1.2",

0 commit comments

Comments
 (0)