Skip to content
Snippets Groups Projects
Commit 1b3247ee authored by Lars Trieloff's avatar Lars Trieloff Committed by GitHub Enterprise
Browse files

Merge pull request #33 from maj/linting

Added a task for linting JavaScript
parents b07cc3ae 13aec881
Branches
Tags
No related merge requests found
{ {
"env": { "env": {
"node": true "node": true,
"es6": true,
"jasmine": true
}, },
"rules": { "rules": {
"array-bracket-spacing": [2, "always"], "array-bracket-spacing": [2, "always"],
...@@ -11,6 +13,7 @@ ...@@ -11,6 +13,7 @@
"curly": 2, "curly": 2,
"eol-last": 2, "eol-last": 2,
"eqeqeq": [2, "smart"], "eqeqeq": [2, "smart"],
"indent": ["error", 2],
"max-depth": [1, 3], "max-depth": [1, 3],
"new-cap": 1, "new-cap": 1,
"no-extend-native": 2, "no-extend-native": 2,
...@@ -18,10 +21,14 @@ ...@@ -18,10 +21,14 @@
"no-trailing-spaces": 2, "no-trailing-spaces": 2,
"no-unused-vars": 1, "no-unused-vars": 1,
"no-use-before-define": [2, "nofunc"], "no-use-before-define": [2, "nofunc"],
"no-undef": 2,
"object-curly-spacing": [2, "always"], "object-curly-spacing": [2, "always"],
"quotes": [2, "single", "avoid-escape"], "quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"], "semi": [2, "always"],
"space-after-keywords": [2, "always"], "keyword-spacing": [2, {
"before": true,
"after": true
}],
"space-unary-ops": 2 "space-unary-ops": 2
} }
} }
...@@ -73,6 +73,14 @@ npm test ...@@ -73,6 +73,14 @@ npm test
* property naming convention * property naming convention
* vocabulary spellchecking * vocabulary spellchecking
## Style Guide / Linting
This project uses [eslint](https://eslint.org) to enforce JavaScript coding style. To run the linter:
```bash
npm run lint
```
## Contributing ## Contributing
Please see [Contributing.md](Contributing.md) for details. Pull requests are welcome. Please see [Contributing.md](Contributing.md) for details. Pull requests are welcome.
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
"jsonschema2md": "./cli.js" "jsonschema2md": "./cli.js"
}, },
"scripts": { "scripts": {
"lint": "eslint .",
"start": "node cli.js", "start": "node cli.js",
"test": "jasmine" "test": "jasmine"
}, },
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
"winston": "^2.2.0" "winston": "^2.2.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^4.10.0",
"jasmine": "~2.8.0" "jasmine": "~2.8.0"
}, },
"engines": { "engines": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment