Adds eslint; fixes linting errors.

This commit is contained in:
Chuck Harmston 2017-01-19 00:16:25 -07:00 коммит произвёл Chuck Harmston
Родитель 721b032b25
Коммит 793bc581a1
6 изменённых файлов: 37 добавлений и 6 удалений

2
.eslintignore Normal file
Просмотреть файл

@ -0,0 +1,2 @@
build
dist

17
.eslintrc Normal file
Просмотреть файл

@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"browser": false
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
"quotes": ["error", "double"]
}
}

Просмотреть файл

@ -48,7 +48,13 @@ While the WebExtension:
## Style
Pulse follows the default formatting recommendations provided by [`prettier`](https://github.com/jlongster/prettier). To automatically clean up the working tree, run:
Pulse follows the default formatting recommendations provided by [`prettier`](https://github.com/jlongster/prettier). To lint the source tree:
```sh
npm run lint
```
To automatically clean up the working tree, run:
```sh
npm run prettier

Просмотреть файл

@ -14,6 +14,7 @@
"babel-preset-latest": "^6.16.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"eslint": "^3.13.1",
"jpm": "^1.2.2",
"node-sass": "^4.1.1",
"prettier": "0.0.9",
@ -26,9 +27,14 @@
"icon": {
"64": "webextension/icons/pulse-64.png"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mozilla/pulse.git"
},
"scripts": {
"build": "./node_modules/webpack/bin/webpack.js",
"watch": "./node_modules/webpack/bin/webpack.js --watch",
"prettier": "./node_modules/prettier/bin/prettier.js --write src/**/*.js webpack.config.js"
"build": "webpack",
"watch": "webpack",
"prettier": "prettier --write src/**/*.js webpack.config.js",
"lint": "eslint ."
}
}

Просмотреть файл

@ -8,6 +8,6 @@ logger.log("SDK startup");
webext.startup().then(({ browser }) => {
logger.log("WebExtension startup");
browser.runtime.onConnect.addListener(port => {
browser.runtime.onConnect.addListener(() => {
});
});

Просмотреть файл

@ -1,4 +1,4 @@
import styles from "./styles.scss";
import styles from "./styles.scss"; // eslint-disable-line no-unused-vars
import Logger from "../../lib/log";
import Open from "./lib/open";