Skip to content

Commit

Permalink
Merge pull request #9 from Aniket-Engg/eslint
Browse files Browse the repository at this point in the history
linter added
  • Loading branch information
Aniket-Engg committed May 4, 2019
2 parents 2aff0fc + c0bcf64 commit 97267e1
Show file tree
Hide file tree
Showing 8 changed files with 956 additions and 146 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/node_modules
38 changes: 38 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parserOptions": {
"ecmaVersion": 9
},
"env": {
"browser": true,
"node": true,
"mocha" : true,
"es6": true
},

"rules": {
"strict": ["error", "global"],
"camelcase": ["error", {"properties": "always"}],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", {"before": false, "after": true}],
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}],
"eol-last": ["error", "always"],
"generator-star-spacing": ["error", "before"],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120, 2],
"no-debugger": "off",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-redeclare": ["error", {"builtinGlobals": true}],
"no-trailing-spaces": ["error", { "skipBlankLines": false }],
"no-undef": "error",
"no-use-before-define": "off",
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "always"]
}
}
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ cache:

jobs:
include:
- stage: tests
name: "Linter"
script: npm run lint

- stage: tests
name: "Unit tests"
script:
Expand Down
14 changes: 8 additions & 6 deletions lib/straighten.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const {getPragma, processFile} = require('./../utils/file');
'use strict';

const { getPragma, processFile } = require('./../utils/file');

module.exports.straighten = async (filePath) => {
const pragma = await getPragma(filePath);
let contractSource = await processFile(filePath, true);
contractSource = pragma + '\n\n' + contractSource;
return contractSource;
}
const pragma = await getPragma(filePath);
let contractSource = await processFile(filePath, true);
contractSource = pragma + '\n\n' + contractSource;
return contractSource;
};

0 comments on commit 97267e1

Please sign in to comment.