Skip to content

Commit b0fb304

Browse files
renovate-bottanem
authored andcommitted
Update dependency prettier to v2.3.0
1 parent c98edb7 commit b0fb304

20 files changed

+66
-165
lines changed

.eslintrc

+3-19
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
"parserOptions": {
33
"ecmaVersion": 2018
44
},
5-
"extends": [
6-
"eslint:recommended",
7-
"prettier"
8-
],
9-
"plugins": [
10-
"jest",
11-
"prettier"
12-
],
5+
"extends": ["eslint:recommended"],
6+
"plugins": ["jest"],
137
"env": {
148
"node": true,
159
"jest": true,
@@ -18,15 +12,5 @@
1812
"globals": {
1913
"any": false,
2014
"Promise": true
21-
},
22-
"rules": {
23-
"prettier/prettier": ["error", {
24-
"bracketSpacing": false,
25-
"jsxBracketSameLine": true,
26-
"parser": "flow",
27-
"printWidth": 80,
28-
"singleQuote": true,
29-
"trailingComma": "all"
30-
}]
3115
}
32-
}
16+
}

.github/workflows/ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ jobs:
1515
with:
1616
node-version: '14'
1717
- run: npm run docker:test
18-

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_coverage

.prettierrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"bracketSpacing": false,
3+
"singleQuote": true,
4+
"trailingComma": "all"
5+
}

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM node:16.1.0
1+
FROM node:14.16.1
22

3-
RUN npm install --global npm
3+
RUN npm install -g npm@latest
44

55
RUN mkdir -p /usr/src/app
66
WORKDIR /usr/src/app

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
88
## Table of Contents
99

10-
* [Background](#background)
11-
* [Getting Started](#getting-started)
12-
* [Running Tests](#running-tests)
13-
* [Documentation](#documentation)
14-
* [License](#license)
10+
- [Background](#background)
11+
- [Getting Started](#getting-started)
12+
- [Running Tests](#running-tests)
13+
- [Documentation](#documentation)
14+
- [License](#license)
1515

1616
## Background
1717

@@ -57,4 +57,4 @@ $ java -jar target/realworld-server-tester-0.1.0-SNAPSHOT-standalone.jar http://
5757

5858
## License
5959

60-
MIT
60+
MIT

bin/test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44

55
if [ "$CI" = true ]; then
6+
npm run check:format
67
npm run lint
78
npx jest -i --coverage
89
bash <(curl -s https://codecov.io/bash)

codecov.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
comment: off
2+
coverage:
3+
status:
4+
patch: off

docker-compose.development.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ services:
1414
- POSTGRES_DB=realworld_development
1515

1616
volumes:
17-
development_data:
17+
development_data:

docker-compose.test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ services:
2121
- POSTGRES_DB=realworld_test
2222

2323
volumes:
24-
test_data:
24+
test_data:

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ services:
2020
image: postgres:13.2
2121
environment:
2222
- POSTGRES_PASSWORD=password
23-
- POSTGRES_USER=realworld
23+
- POSTGRES_USER=realworld

docs/structure/initializers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Initializers
22

33
The initialization procedure is based on [the approach taken by the Locomotive framework](http://www.locomotivejs.org/guide/initialization/). App initialization steps have been split into separate functions in
4-
the `initializers/` folder, and are run in a certain order. Any required app-wide references are set on the [`app.locals`](https://expressjs.com/en/4x/api.html#app.locals) object.
4+
the `initializers/` folder, and are run in a certain order. Any required app-wide references are set on the [`app.locals`](https://expressjs.com/en/4x/api.html#app.locals) object.

docs/testing/outside-in.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Outside-In
22

3-
The preference is to create high-level tests first in order to test the API end-to-end from a user’s perspective. From there we can drop down into lower-level tests like unit tests (this hasn't yet been done in this repo). See [Testing from the Outside-In](https://robots.thoughtbot.com/testing-from-the-outsidein) for more information.
3+
The preference is to create high-level tests first in order to test the API end-to-end from a user’s perspective. From there we can drop down into lower-level tests like unit tests (this hasn't yet been done in this repo). See [Testing from the Outside-In](https://robots.thoughtbot.com/testing-from-the-outsidein) for more information.

docs/testing/prefer-snapshot-tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Prefer Snapshot Tests
22

3-
Where possible Jest's [snapshot testing](https://facebook.github.io/jest/docs/en/snapshot-testing.html) feature is used in order to validate key parts of the API response. Where this is not straightforward, for example when the response returns creation dates which vary over time, we've fallen back to more specific assertions.
3+
Where possible Jest's [snapshot testing](https://facebook.github.io/jest/docs/en/snapshot-testing.html) feature is used in order to validate key parts of the API response. Where this is not straightforward, for example when the response returns creation dates which vary over time, we've fallen back to more specific assertions.

docs/testing/run-in-band.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Run in Band
22

3-
Since we're hitting a real DB via our functional tests, we want to run them serially in the current process using Jest's [`runInBand`](https://facebook.github.io/jest/docs/en/cli.html#runinband) option so they remain isolated. If the test suite gets expanded to include unit tests that don't hit the DB for example, then we may want to be specific about when we use that flag in order to keep the tests running as fast as possible.
3+
Since we're hitting a real DB via our functional tests, we want to run them serially in the current process using Jest's [`runInBand`](https://facebook.github.io/jest/docs/en/cli.html#runinband) option so they remain isolated. If the test suite gets expanded to include unit tests that don't hit the DB for example, then we may want to be specific about when we use that flag in order to keep the tests running as fast as possible.

lib/articles/__tests__/functional-test.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ const moment = require('moment');
55
const request = require('supertest');
66
const app = require('../../app');
77

8-
const {
9-
articles,
10-
articlesTags,
11-
favorites,
12-
followers,
13-
tags,
14-
users,
15-
} = app.locals.services;
8+
const {articles, articlesTags, favorites, followers, tags, users} =
9+
app.locals.services;
1610

1711
describe('articles', () => {
1812
let author;

lib/middleware/jwt-auth.js

+25-27
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,37 @@ const Boom = require('@hapi/boom');
44
const errorCatcher = require('async-error-catcher').default;
55
const passport = require('passport');
66

7-
const callback = (req, res, next) => async (
8-
error,
9-
{userId} = {},
10-
info = {},
11-
) => {
12-
const {
13-
app: {
14-
locals: {
15-
services: {users},
7+
const callback =
8+
(req, res, next) =>
9+
async (error, {userId} = {}, info = {}) => {
10+
const {
11+
app: {
12+
locals: {
13+
services: {users},
14+
},
1615
},
17-
},
18-
locals: {trx},
19-
} = res;
16+
locals: {trx},
17+
} = res;
2018

21-
if (error) {
22-
return next(error);
23-
}
19+
if (error) {
20+
return next(error);
21+
}
2422

25-
if (info instanceof Error || info.name === 'JsonWebTokenError') {
26-
return next(Boom.unauthorized());
27-
}
23+
if (info instanceof Error || info.name === 'JsonWebTokenError') {
24+
return next(Boom.unauthorized());
25+
}
2826

29-
let user;
30-
try {
31-
user = await users.fetch({id: userId}, {transacting: trx});
32-
} catch (error) {
33-
return next(Boom.unauthorized());
34-
}
27+
let user;
28+
try {
29+
user = await users.fetch({id: userId}, {transacting: trx});
30+
} catch (error) {
31+
return next(Boom.unauthorized());
32+
}
3533

36-
req.user = user;
34+
req.user = user;
3735

38-
next();
39-
};
36+
next();
37+
};
4038

4139
exports.required = errorCatcher(async (req, res, next) => {
4240
// prettier-ignore

package-lock.json

+7-91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)