Skip to content

Commit 17f9342

Browse files
authored
Fix the Prettier CI check (#96)
* Fix the prettier-check in CI * Run prettier during bump-version * Run prettier
1 parent 485ea9c commit 17f9342

File tree

14 files changed

+166
-139
lines changed

14 files changed

+166
-139
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## LSIF Typescript
22

33
### v0.1.16 (2022/04/26 02:07 +00:00)
4+
45
- [#90](https://github.com/sourcegraph/lsif-typescript/pull/90) Update `--infer-tsconfig` to skip the `allowJs` option when there exist TS files (#90) (@olafurpg)
56
- [#89](https://github.com/sourcegraph/lsif-typescript/pull/89) Update dependency @sourcegraph/eslint-config to v0.27.1 (#89) (@renovate[bot])
67
- [#86](https://github.com/sourcegraph/lsif-typescript/pull/86) Correctly emit definitions for type aliases. (#86) (@varungandhi-src)
78
- [#84](https://github.com/sourcegraph/lsif-typescript/pull/84) fix: Emit definition for class declarations. (#84) (@varungandhi-src)
89
- [#83](https://github.com/sourcegraph/lsif-typescript/pull/83) fix: Use allowJS in --infer-tsconfig. (#83) (@varungandhi-src)
910

1011
### v0.1.15 (2022/04/13 19:10 +00:00)
12+
1113
- [#80](https://github.com/sourcegraph/lsif-typescript/pull/80) Update ChangeLog and bump version for releasing 0.1.15. (#80) (@varungandhi-src)
1214
- [#77](https://github.com/sourcegraph/lsif-typescript/pull/77) ci: Fix bot name/email. (#77) (@varungandhi-src)
1315
- [#74](https://github.com/sourcegraph/lsif-typescript/pull/74) Add support for accessors. (#74) (@varungandhi-src)
@@ -21,21 +23,25 @@
2123
- [#66](https://github.com/sourcegraph/lsif-typescript/pull/66) chore: Add generated .lsif-typed files to .gitignore. (#66) (@varungandhi-src)
2224

2325
### v0.1.14 (2022/03/21 14:53 +00:00)
26+
2427
- [#50](https://github.com/sourcegraph/lsif-typescript/pull/50) Merge pull request #50 from sourcegraph/duplicate-definitions (@olafurpg)
2528
- [#49](https://github.com/sourcegraph/lsif-typescript/pull/49) Merge pull request #49 from sourcegraph/commander (@olafurpg)
2629
- [#47](https://github.com/sourcegraph/lsif-typescript/pull/47) Merge pull request #47 from sourcegraph/cross-project (@olafurpg)
2730
- [#28](https://github.com/sourcegraph/lsif-typescript/pull/28) Merge pull request #28 from sourcegraph/renovate/node-17.x (@renovate-bot)
2831

2932
### v0.1.11 (2022/03/16 13:02 +00:00)
33+
3034
- [#40](https://github.com/sourcegraph/lsif-typescript/pull/40) Merge pull request #40 from sourcegraph/allowjs (@olafurpg)
3135
- [#39](https://github.com/sourcegraph/lsif-typescript/pull/39) Merge pull request #39 from sourcegraph/progress-bar (@olafurpg)
3236
- [#36](https://github.com/sourcegraph/lsif-typescript/pull/36) Merge pull request #36 from sourcegraph/sg-upload (@olafurpg)
3337

3438
### v0.1.5 (2022/03/07 10:57 +00:00)
39+
3540
- [#26](https://github.com/sourcegraph/lsif-typescript/pull/26) Merge pull request #26 from sourcegraph/renovate/major-react-monorepo (@renovate-bot)
3641
- [#22](https://github.com/sourcegraph/lsif-typescript/pull/22) Merge pull request #22 from olafurpg/react (@olafurpg)
3742

3843
### v0.1.0 (2022/02/25 15:43 +00:00)
44+
3945
- [#6](https://github.com/sourcegraph/lsif-typescript/pull/6) Merge pull request #6 from olafurpg/release (@olafurpg)
4046
- [#4](https://github.com/sourcegraph/lsif-typescript/pull/4) Merge pull request #4 from sourcegraph/add-pr-auditor-and-test-plan (@sourcegraph)
41-
- [#1](https://github.com/sourcegraph/lsif-typescript/pull/1) Merge pull request #1 from olafurpg/new-start (@olafurpg)
47+
- [#1](https://github.com/sourcegraph/lsif-typescript/pull/1) Merge pull request #1 from olafurpg/new-start (@olafurpg)

dev/bump-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ echo "Updating package.json."
1616
yarn version --no-git-tag-version --new-version $1
1717
echo "Updating CHANGELOG.md."
1818
npx github-changes --only-pulls --branch main --owner sourcegraph --repository lsif-typescript --title "LSIF Typescript" --tag-name "v$1" --token "$GITHUB_TOKEN"
19+
yarn run prettier
1920
git add .
2021
TITLE="Update ChangeLog and bump version for releasing $1."
2122
git commit -m "$TITLE"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"main": "./dist/src/main.js",
88
"scripts": {
99
"prettier": "prettier --write --list-different '**/*.{ts,js?(on),md,yml}'",
10-
"prettier-check": "npm run prettier --write=false",
10+
"prettier-check": "prettier --check '**/*.{ts,js?(on),md,yml}'",
1111
"tslint": "tslint -p tsconfig.json --format stylish",
1212
"eslint": "eslint --cache '**/*.ts?(x)'",
1313
"build": "node ./node_modules/typescript/bin/tsc -b .",

snapshots/input/multi-project/packages/a/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"@example/a/src/*": ["src/*"]
99
}
1010
},
11-
"include": ["src/*"],
11+
"include": ["src/*"]
1212
}

snapshots/input/multi-project/packages/b/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"rootDir": ".",
55
"baseUrl": "./src",
66
"sourceRoot": "src",
7-
"outDir": "dist",
7+
"outDir": "dist"
88
},
99
"include": ["src/*"],
1010
"references": [{ "path": "../a" }]

snapshots/input/pure-js/src/main.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,49 @@
11
function fib(n) {
22
if (n <= 1) {
3-
return 0;
3+
return 0
44
}
5-
return fib(n - 1) + fib(n - 2);
5+
return fib(n - 1) + fib(n - 2)
66
}
77

88
function print_fib(a) {
9-
console.log(fib(a));
9+
console.log(fib(a))
1010
}
1111

12-
var y = "Hello";
12+
var y = 'Hello'
1313
function capture() {
14-
return y;
14+
return y
1515
}
16-
const capture_lambda = () => { return y; };
17-
18-
for (var i = 0; i <= 10; i++) {
16+
const capture_lambda = () => {
17+
return y
1918
}
2019

20+
for (var i = 0; i <= 10; i++) {}
21+
2122
for (const x of [1, 2, 3]) {
2223
}
2324

24-
var a = 0;
25-
var a = 1;
26-
print_fib(a);
25+
var a = 0
26+
var a = 1
27+
print_fib(a)
2728

28-
function forever() { return forever(); }
29+
function forever() {
30+
return forever()
31+
}
2932

3033
function use_before_def() {
31-
print_fib(n);
32-
var n = 10;
34+
print_fib(n)
35+
var n = 10
3336

3437
if (forever()) {
35-
var m = 10;
38+
var m = 10
3639
}
37-
print_fib(m);
40+
print_fib(m)
3841
}
3942

4043
function var_function_scope() {
41-
var k = 0;
44+
var k = 0
4245
if (forever()) {
43-
var k = 1;
46+
var k = 1
4447
}
45-
print_fib(k);
48+
print_fib(k)
4649
}
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class C {
2-
_length: number = 0;
2+
_length: number = 0
33
get length(): number {
4-
return this._length;
4+
return this._length
55
}
66
set length(value: number) {
7-
this._length = value;
7+
this._length = value
88
}
99

1010
_capacity: number = 0
@@ -14,24 +14,24 @@ class C {
1414
}
1515

1616
export class D {
17-
_length: number = 0;
18-
public get length(): number {
19-
return this._length;
20-
}
21-
public set length(value: number) {
22-
this._length = value;
23-
}
17+
_length: number = 0
18+
public get length(): number {
19+
return this._length
20+
}
21+
public set length(value: number) {
22+
this._length = value
23+
}
2424

25-
_capacity: number = 0
26-
public get capacity(): number {
27-
return this._capacity;
28-
}
29-
private set capacity(value: number) {
30-
this._capacity = value;
31-
}
32-
public unsafeSetCapacity(value: number): void {
33-
this.capacity = value
34-
}
25+
_capacity: number = 0
26+
public get capacity(): number {
27+
return this._capacity
28+
}
29+
private set capacity(value: number) {
30+
this._capacity = value
31+
}
32+
public unsafeSetCapacity(value: number): void {
33+
this.capacity = value
34+
}
3535
}
3636

3737
function g(_: number): void {}
@@ -48,4 +48,4 @@ function f() {
4848
g(d.length)
4949
g(d.capacity)
5050
g(D.length)
51-
}
51+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
type S = string
22

3-
const s: S = ""
3+
const s: S = ''
44

55
class C<T> {
6-
t: T
6+
t: T
77
}
88
type Cstring = C<string>
99

1010
const cs: Cstring = new C<string>()
1111

1212
class D<T, U> {
13-
t: T
14-
u: U
13+
t: T
14+
u: U
1515
}
1616
type DT<T> = D<T, string> // partially specialized
1717
type DU<U> = D<string, DU<U>> // recursive!
1818

1919
const dt: DT<string> = new D()
20-
const du: DU<string> = new D()
20+
const du: DU<string> = new D()

snapshots/output/pure-js/src/main.js

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// ^ definition pure-js 1.0.0 src/`main.js`/fib().(n)
44
if (n <= 1) {
55
// ^ reference pure-js 1.0.0 src/`main.js`/fib().(n)
6-
return 0;
6+
return 0
77
}
8-
return fib(n - 1) + fib(n - 2);
8+
return fib(n - 1) + fib(n - 2)
99
// ^^^ reference pure-js 1.0.0 src/`main.js`/fib().
1010
// ^ reference pure-js 1.0.0 src/`main.js`/fib().(n)
1111
// ^^^ reference pure-js 1.0.0 src/`main.js`/fib().
@@ -15,7 +15,7 @@
1515
function print_fib(a) {
1616
// ^^^^^^^^^ definition pure-js 1.0.0 src/`main.js`/print_fib().
1717
// ^ definition pure-js 1.0.0 src/`main.js`/print_fib().(a)
18-
console.log(fib(a));
18+
console.log(fib(a))
1919
// ^^^^^^^ reference typescript 4.6.2 lib/`lib.dom.d.ts`/console.
2020
// ^^^^^^^ reference @types/node 17.0.14 `globals.d.ts`/console.
2121
// ^^^^^^^ reference @types/node 17.0.14 `console.d.ts`/`'node:console'`/global/console/
@@ -26,68 +26,71 @@
2626
// ^ reference pure-js 1.0.0 src/`main.js`/print_fib().(a)
2727
}
2828

29-
var y = "Hello";
29+
var y = 'Hello'
3030
// ^ definition pure-js 1.0.0 src/`main.js`/y.
3131
function capture() {
3232
// ^^^^^^^ definition pure-js 1.0.0 src/`main.js`/capture().
33-
return y;
33+
return y
3434
// ^ reference pure-js 1.0.0 src/`main.js`/y.
3535
}
36-
const capture_lambda = () => { return y; };
36+
const capture_lambda = () => {
3737
// ^^^^^^^^^^^^^^ definition pure-js 1.0.0 src/`main.js`/capture_lambda.
38-
// ^ reference pure-js 1.0.0 src/`main.js`/y.
38+
return y
39+
// ^ reference pure-js 1.0.0 src/`main.js`/y.
40+
}
3941

40-
for (var i = 0; i <= 10; i++) {
42+
for (var i = 0; i <= 10; i++) {}
4143
// ^ definition local 2
4244
// ^ reference local 2
4345
// ^ reference local 2
44-
}
4546

4647
for (const x of [1, 2, 3]) {
4748
// ^ definition local 5
4849
}
4950

50-
var a = 0;
51+
var a = 0
5152
// ^ definition pure-js 1.0.0 src/`main.js`/a.
52-
var a = 1;
53+
var a = 1
5354
// ^ definition pure-js 1.0.0 src/`main.js`/a.
54-
print_fib(a);
55+
print_fib(a)
5556
//^^^^^^^^^ reference pure-js 1.0.0 src/`main.js`/print_fib().
5657
// ^ reference pure-js 1.0.0 src/`main.js`/a.
5758
// ^ reference pure-js 1.0.0 src/`main.js`/a.
5859

59-
function forever() { return forever(); }
60+
function forever() {
6061
// ^^^^^^^ definition pure-js 1.0.0 src/`main.js`/forever().
61-
// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
62+
return forever()
63+
// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
64+
}
6265

6366
function use_before_def() {
6467
// ^^^^^^^^^^^^^^ definition pure-js 1.0.0 src/`main.js`/use_before_def().
65-
print_fib(n);
68+
print_fib(n)
6669
// ^^^^^^^^^ reference pure-js 1.0.0 src/`main.js`/print_fib().
6770
// ^ reference local 8
68-
var n = 10;
71+
var n = 10
6972
// ^ definition local 8
7073

7174
if (forever()) {
7275
// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
73-
var m = 10;
76+
var m = 10
7477
// ^ definition local 11
7578
}
76-
print_fib(m);
79+
print_fib(m)
7780
// ^^^^^^^^^ reference pure-js 1.0.0 src/`main.js`/print_fib().
7881
// ^ reference local 11
7982
}
8083

8184
function var_function_scope() {
8285
// ^^^^^^^^^^^^^^^^^^ definition pure-js 1.0.0 src/`main.js`/var_function_scope().
83-
var k = 0;
86+
var k = 0
8487
// ^ definition local 14
8588
if (forever()) {
8689
// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
87-
var k = 1;
90+
var k = 1
8891
// ^ definition local 14
8992
}
90-
print_fib(k);
93+
print_fib(k)
9194
// ^^^^^^^^^ reference pure-js 1.0.0 src/`main.js`/print_fib().
9295
// ^ reference local 14
9396
// ^ reference local 17

0 commit comments

Comments
 (0)