Skip to content

Commit b67261c

Browse files
authored
Merge pull request #104 from malthe/lint-check-ci
Add 'prettier' style check
2 parents 9436b77 + b51de37 commit b67261c

31 files changed

+1246
-1185
lines changed

.eslintrc.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
"browser": true,
44
"es2021": true
55
},
6-
"extends": [
7-
"plugin:@typescript-eslint/recommended"
8-
],
6+
"extends": ["plugin:@typescript-eslint/recommended"],
97
"parser": "@typescript-eslint/parser",
108
"parserOptions": {
119
"ecmaVersion": 13,
1210
"sourceType": "module"
1311
},
14-
"plugins": [
15-
"@typescript-eslint"
16-
],
12+
"plugins": ["@typescript-eslint"],
1713
"rules": {
1814
"@typescript-eslint/no-explicit-any": 0
1915
}

.github/workflows/main.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: CI
22
on:
33
push:
4-
branches: [ master ]
4+
branches: [master]
55
pull_request:
6-
branches: [ master ]
6+
branches: [master]
77

88
# Allows you to run this workflow manually from the Actions tab
99
workflow_dispatch:
@@ -17,6 +17,20 @@ permissions:
1717
id-token: write
1818

1919
jobs:
20+
style:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-node@v4
25+
- name: Prettier
26+
run: |
27+
npm i -D
28+
set +e
29+
npx prettier --experimental-ternaries --check
30+
code=$?
31+
npx prettier --experimental-ternaries --log-level warn --write
32+
git diff
33+
exit "$code"
2034
build:
2135
runs-on: ubuntu-latest
2236
timeout-minutes: 1
@@ -75,8 +89,8 @@ jobs:
7589
strategy:
7690
matrix:
7791
version:
78-
- 18.x
79-
- 20.x
92+
- 18.x
93+
- 20.x
8094
runs-on: ubuntu-latest
8195
needs: [build]
8296
timeout-minutes: 3
@@ -116,7 +130,7 @@ jobs:
116130
PGUSER: postgres
117131
PGPASSWORD: postgres
118132
- uses: actions/download-artifact@v4
119-
- name: "Example: Connect"
133+
- name: 'Example: Connect'
120134
run: |
121135
pkg_path=`ls $PWD/pkg/ts-postgres-*.tgz`
122136
cd examples/connect
@@ -132,7 +146,7 @@ jobs:
132146
PGPORT: ${{ job.services.postgres.ports[5432] }}
133147
PGUSER: postgres
134148
PGPASSWORD: postgres
135-
- name: "Example: Generic Pool"
149+
- name: 'Example: Generic Pool'
136150
run: |
137151
pkg_path=`ls $PWD/pkg/ts-postgres-*.tgz`
138152
cd examples/generic-pool
@@ -152,7 +166,7 @@ jobs:
152166
environment:
153167
name: github-pages
154168
url: ${{ steps.deployment.outputs.page_url }}
155-
needs: [build, test]
169+
needs: [style, build, test]
156170
steps:
157171
- name: Deploy to GitHub Pages
158172
id: deployment

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.DS_Store
2-
.rpt2_cache
3-
node_modules
1+
.*
2+
!.eslintrc.json
43
coverage
54
dist
5+
docs
6+
node_modules
7+
npm
68
yarn.lock

CHANGES.md

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ In next release ...
44
connected when the promise returns. The `Client` symbol is now a
55
type instead of a value.
66

7-
1.9.0 (2024-01-23)
8-
------------------
7+
## v1.9.0 (2024-01-23)
98

109
- Add support for ESM modules.
1110

@@ -15,8 +14,7 @@ In next release ...
1514

1615
- Fix issue handling connection error during secure startup.
1716

18-
1.8.0 (2023-12-14)
19-
------------------
17+
## v1.8.0 (2023-12-14)
2018

2119
- Reduce buffer allocation and intelligently scale initial allocation when creating
2220
a new buffer.
@@ -34,8 +32,7 @@ In next release ...
3432

3533
- Fixed a regression where some symbols were not correctly exposed for importing.
3634

37-
1.7.0 (2023-12-13)
38-
------------------
35+
## v1.7.0 (2023-12-13)
3936

4037
- The `execute` method has been removed.
4138

@@ -50,8 +47,7 @@ In next release ...
5047

5148
The same change has been made to `prepare`.
5249

53-
1.6.0 (2023-12-13)
54-
------------------
50+
## v1.6.0 (2023-12-13)
5551

5652
- The iterator methods now return reified representations of the query result
5753
(i.e. objects), carrying the generic type parameter specified for the query
@@ -61,8 +57,7 @@ In next release ...
6157
This separates the query results interface into an iterator interface (providing
6258
objects) and a result interface (providing rows and column names).
6359

64-
1.5.0 (2023-12-06)
65-
------------------
60+
## v1.5.0 (2023-12-06)
6661

6762
- The `Value` type has been replaced with `any`, motivated by the new
6863
generic result type as well as the possibility to implement custom
@@ -93,8 +88,7 @@ In next release ...
9388

9489
- Use `bigint` everywhere as a type instead of `BigInt`.
9590

96-
1.4.0 (2023-11-10)
97-
------------------
91+
## v1.4.0 (2023-11-10)
9892

9993
- A statement error during the processing of a prepared statement is
10094
now handled correctly (#73).
@@ -104,21 +98,15 @@ In next release ...
10498
- The [ts-typed-events](https://www.npmjs.com/package/ts-typed-events)
10599
dependency was updated to version 3.0.0.
106100

107-
108-
1.3.1 (2023-06-19)
109-
------------------
101+
## v1.3.1 (2023-06-19)
110102

111103
- Added details of database error to thrown error message (#64).
112104

113-
114-
1.3.0 (2022-08-22)
115-
------------------
105+
## v1.3.0 (2022-08-22)
116106

117107
- Fix prepare statement with no return data (#56).
118108

119-
120-
1.2.1 (2021-12-23)
121-
------------------
109+
## v1.2.1 (2021-12-23)
122110

123111
- Fix range error that could occur when parsing an incomplete data row
124112
after one or more previous messages had already been processed.
@@ -136,8 +124,7 @@ In next release ...
136124
- Fix issue where a query with multiple columns would yield incomplete
137125
rows when protocol data spans multiple receive buffers.
138126

139-
1.2.0 (2021-11-19)
140-
------------------
127+
## v1.2.0 (2021-11-19)
141128

142129
- The "execute" method is now public and must be used now when passing
143130
a query object rather than individual arguments when querying.
@@ -162,19 +149,15 @@ In next release ...
162149

163150
- Updated dependency on "ts-typed-events".
164151

165-
1.1.3 (2020-02-23)
166-
------------------
152+
## v1.1.3 (2020-02-23)
167153

168154
- Added support for `BigInt`.
169155

170-
1.1.2 (2019-12-28)
171-
------------------
156+
## v1.1.2 (2019-12-28)
172157

173158
- Fixed handling of null values in arrays. [matthieusieben]
174159

175-
176-
1.1.1 (2019-12-06)
177-
------------------
160+
## v1.1.1 (2019-12-06)
178161

179162
- Fixed `ECONNRESET` deprecation.
180163

@@ -184,9 +167,7 @@ In next release ...
184167

185168
- Encoding argument now uses `BufferEncoding` type.
186169

187-
188-
1.1.0 (2019-06-24)
189-
------------------
170+
## v1.1.0 (2019-06-24)
190171

191172
- The rejection value is now a `DatabaseError` object which inherits
192173
from `Error`. Previously, this value was a plain string.
@@ -199,9 +180,7 @@ In next release ...
199180

200181
- Handle `JSONB` and null values.
201182

202-
203-
1.0.2 (2019-02-08)
204-
------------------
183+
## v1.0.2 (2019-02-08)
205184

206185
- Connection state variable 'closed' is now public. This should be
207186
checked before using the connection to make sure that an unexpected
@@ -210,9 +189,7 @@ In next release ...
210189
- Handle protocol errors gracefully, passing error to open data
211190
handlers and marking the connection as 'closed'.
212191

213-
214-
1.0.1 (2019-01-13)
215-
------------------
192+
## v1.0.1 (2019-01-13)
216193

217194
- Parse JSON data only on non-null value.
218195

@@ -221,8 +198,6 @@ In next release ...
221198
- Fixed an issue with `Result.one()` and `Result.first()` methods
222199
where a rejection would be uncaught.
223200

224-
225-
1.0.0 (2019-01-08)
226-
------------------
201+
## v1.0.0 (2019-01-08)
227202

228203
- Initial release.

0 commit comments

Comments
 (0)