Skip to content

Commit

Permalink
Setup ESLint (#1)
Browse files Browse the repository at this point in the history
* setup eslint
* update travis scripts
* fix typo
  • Loading branch information
zephyrus authored and Anton Petrov committed Jul 22, 2018
1 parent 298165b commit 83c79bf
Show file tree
Hide file tree
Showing 10 changed files with 688 additions and 563 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "open-zigbee"
}
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
language: node_js

node_js:
- "lts/*"
- "lts/*"

script:
- npm test
- npm run lint
35 changes: 15 additions & 20 deletions examples/example.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
var ccznp = require('../index.js');
const ccznp = require('../index.js');

var spCfg = {
path: "/dev/ttyUSB0",
const spCfg = {
path: '/dev/ttyUSB0',
options: {
baudrate: 115200,
rtscts: true
}
rtscts: true,
},
};

ccznp.on('ready', function () {
ccznp.sysRequest('ping', {}, function (err, result) {
if (err)
console.log(err);
else
console.log(result);
ccznp.on('ready', function() {
ccznp.sysRequest('ping', {}, function(err, result) {
if (err) console.log(err);
else console.log(result);
});

ccznp.sysRequest('version', {}, function (err, result) {
if (err)
console.log(err);
else
console.log(result);
ccznp.sysRequest('version', {}, function(err, result) {
if (err) console.log(err);
else console.log(result);
});
});

ccznp.on('AREQ', function(result) {
console.log(result);
});

ccznp.init(spCfg, function (err) {
if (err)
console.log(err);
});
ccznp.init(spCfg, function(err) {
if (err) console.log(err);
});
Loading

0 comments on commit 83c79bf

Please sign in to comment.