Skip to content

Commit

Permalink
eslint and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Bukhin committed Feb 10, 2016
1 parent 889afb0 commit cb2fc94
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 94 deletions.
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"mocha": true,
"es6": true
},
"rules": {
"indent": [ 2, 4, { "SwitchCase": 1 } ],
"linebreak-style": [ 2, "unix" ],
"no-unused-vars": [2, { "args": "none" }],
"semi": [ 2, "always" ],
"comma-dangle": [ 0 ],
"no-constant-condition" : [ 0 ],
},
}
7 changes: 7 additions & 0 deletions .istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
check:
global:
statements: 90
branches: 50
functions: 90
lines: 90
excludes: []
47 changes: 0 additions & 47 deletions .jscsrc

This file was deleted.

28 changes: 0 additions & 28 deletions .jshintrc

This file was deleted.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ services:
- mysql

before_script:
- npm install -g jshint
- npm install -g jscs
- mysql -e "create database IF NOT EXISTS test;" -uroot

script:
- npm run -s lint
- npm test
- npm run test-coverage
- npm run check-coverage
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,3 @@ npm test
```

Both are run automatically by Travis.

When developing you may run into failures during linting where jscs complains
about your coding style and an easy way to fix those files is to simply run
`jscs --fix test` or `jscs --fix lib` from the root directory of the project.
After jscs fixes things you should proceed to check that those changes are
reasonable as auto-fixing may not produce the nicest of looking code.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function MysqlAdapter(config, Juttle) {
});

_.extend(baseSql.write.prototype, {
procName: 'write-mysql'
});
procName: 'write-mysql'
});

return baseSql;
}
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"license": "Apache-2.0",
"repository": "juttle/juttle-mysql-adapter",
"scripts": {
"test": "mocha test/*.spec.js",
"jshint": "jshint *.js test/*.js",
"style": "jscs *.js test/*.js",
"lint": "npm run jshint && npm run style"
"test": "npm run unit && npm run lint",
"test-coverage": "istanbul cover node_modules/.bin/_mocha -- test/*.spec.js",
"unit": "mocha test/*.spec.js",
"hist": "mocha test/*.spec.js -g live -i",
"lint": "eslint **/*.js *.js",
"check-coverage": "istanbul check-coverage"
},
"dependencies": {
"juttle-sql-adapter-common": "^0.3.3",
Expand All @@ -24,11 +26,10 @@
"underscore": "^1.8.3"
},
"devDependencies": {
"sqlite3": "^3.1.1",
"chai": "^1.10.0",
"jshint": "^2.9.1-rc1",
"mocha": "^2.3.4",
"jscs": "^2.6.0"
"eslint": "^1.10.3",
"istanbul": "^0.4.2",
"mocha": "^2.3.4"
},
"engines": {
"node": ">=4.2.0",
Expand Down

0 comments on commit cb2fc94

Please sign in to comment.