Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 4fa721e

Browse files
authored
Merge pull request #75 from magopian/34-add-eslint
Add eslint
2 parents a2f1e79 + a4e1812 commit 4fa721e

File tree

6 files changed

+273
-26
lines changed

6 files changed

+273
-26
lines changed

.circleci/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ jobs:
3939
# run tests!
4040
- run: yarn test
4141

42-
# run build!
43-
- run: yarn run build
44-
4542
- deploy:
4643
command: |
4744
if [ "${CIRCLE_BRANCH}" == "master" ]; then

lint_problems.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ set -eo pipefail
33

44
prelude() {
55
echo "
6-
You have prettier linting errors!
6+
You have prettier-eslint linting errors!
77
----------------------------------
8-
The following files would turn out different if you process them with prettier.
8+
The following files would turn out different if you process them with prettier-eslint.
99
1010
"
1111
}
@@ -16,9 +16,9 @@ while read line
1616
do
1717
$first && prelude
1818
echo "To fix:"
19-
echo " prettier --write ${line}"
19+
echo " prettier-eslint --write ${line}"
2020
echo "To see:"
21-
echo " prettier ${line} | diff ${line} -"
21+
echo " prettier-eslint ${line} | diff ${line} -"
2222
echo ""
2323
# echo "$line"
2424
any=true
@@ -29,7 +29,7 @@ done < "${1:-/dev/stdin}"
2929
$any && echo "
3030
If you're not interested in how they're different, consider running:
3131
32-
yarn run lint:prettierfix
32+
yarn run lint:prettier-eslintfix
3333
"
3434

3535
$any && exit 1 || exit 0

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
"eject": "react-scripts eject",
3333
"lint:flow": "flow",
3434
"lint:less": "stylelint 'src/**/*.less' --config .stylelintrc",
35-
"lint:prettier": "prettier --list-different 'src/**/*.js' | ./lint_problems.sh",
36-
"lint:prettierfix": "prettier 'src/**/*.js' --write",
37-
"lint": "yarn run lint:flow && yarn run lint:prettier && yarn run lint:less"
35+
"lint:prettier-eslint": "prettier-eslint --list-different 'src/**/*.js' | ./lint_problems.sh",
36+
"lint:prettier-eslintfix": "prettier-eslint --write 'src/**/*.js'",
37+
"lint": "yarn run lint:flow && yarn run lint:prettier-eslint && yarn run lint:less"
3838
},
3939
"devDependencies": {
4040
"babel-plugin-import": "^1.6.5",
@@ -43,6 +43,8 @@
4343
"flow-bin": "^0.66.0",
4444
"pre-commit": "^1.2.2",
4545
"prettier": "^1.11.1",
46+
"prettier-eslint": "^8.8.1",
47+
"prettier-eslint-cli": "^4.7.1",
4648
"react-app-rewire-less": "^2.1.0",
4749
"react-app-rewired": "^1.4.1",
4850
"stylelint": "^9.1.1",

src/normandy/state/app/session/actions.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ export function saveSession() {
6060
}
6161

6262
export function addSessionView(category, caption, identicon) {
63-
return async (dispatch, getState) => {
63+
return async (dispatch, getState) =>
6464
// #todo;
65-
return null;
66-
/*
65+
null;
66+
/*
6767
const { router } = getState();
6868
let url = router.pathname;
6969
@@ -83,5 +83,4 @@ export function addSessionView(category, caption, identicon) {
8383
// Automatically save the session when views are added.
8484
return dispatch(saveSession());
8585
*/
86-
};
8786
}

src/normandy/tests/utils/test_handleError.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ describe('handleError util', () => {
5050
it('should handle a "not logged in" 403 error', () => {
5151
const err = new APIClient.APIError(
5252
'Authentication credentials were not provided',
53-
{ status: 403 },
53+
{
54+
status: 403,
55+
},
5456
);
5557

5658
const { context, message, reason } = handleError('Test.', err);

0 commit comments

Comments
 (0)