Skip to content

Commit

Permalink
Merge pull request #49 from federicobond/eslint
Browse files Browse the repository at this point in the history
Configure eslint and fix all reported issues
  • Loading branch information
tcoulter committed Dec 22, 2016
2 parents 1386ada + 6b4e543 commit d7f8f2b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions .eslintignore
@@ -0,0 +1 @@
build/*
7 changes: 7 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,7 @@
{
"env": {
"node": true,
"jasmine": true
},
"extends": "eslint:recommended"
}
3 changes: 3 additions & 0 deletions cli.js
@@ -1,4 +1,7 @@
#!/usr/bin/env node

/* eslint no-console: 0 */

var argv = require("yargs").argv;
var SolidityParser = require("./index.js");

Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"build": "pegjs -o ./build/parser.js ./solidity.pegjs && pegjs -o ./build/imports_parser.js ./imports.pegjs",
"test": "mocha --timeout 5000 --reporter spec"
"test": "mocha --timeout 5000 --reporter spec",
"lint": "eslint ."
},
"bin": {
"solidity-parser": "./cli.js"
Expand Down
26 changes: 9 additions & 17 deletions test/general.js
@@ -1,29 +1,21 @@
var SolidityParser = require('../index.js');
var SolidityParser = require("../index.js");

describe("Parser", function() {
it("parses documentation examples without throwing an error", function(done) {
var result = SolidityParser.parseFile("./test/doc_examples.sol", true);
//console.log(JSON.stringify(result.body.filter(function(i) {return i.type == "ImportStatement"}), null, 2));
done();
it("parses documentation examples without throwing an error", function() {
SolidityParser.parseFile("./test/doc_examples.sol", true);
});

it("parses documentation examples using imports parser without throwing an error", function(done) {
var result = SolidityParser.parseFile("./test/doc_examples.sol", "imports", true);
//console.log(JSON.stringify(result, null, 2));
done();
it("parses documentation examples using imports parser without throwing an error", function() {
SolidityParser.parseFile("./test/doc_examples.sol", "imports", true);
});
});

describe("Built Parser", function() {
it("parses documentation examples without throwing an error", function(done) {
var result = SolidityParser.parseFile("./test/doc_examples.sol", false);
//console.log(JSON.stringify(result.body.filter(function(i) {return i.type == "ImportStatement"}), null, 2));
done();
it("parses documentation examples without throwing an error", function() {
SolidityParser.parseFile("./test/doc_examples.sol", false);
});

it("parses documentation examples using imports parser without throwing an error", function(done) {
var result = SolidityParser.parseFile("./test/doc_examples.sol", "imports", false);
//console.log(JSON.stringify(result, null, 2));
done();
it("parses documentation examples using imports parser without throwing an error", function() {
SolidityParser.parseFile("./test/doc_examples.sol", "imports", false);
});
});

0 comments on commit d7f8f2b

Please sign in to comment.