Skip to content

Commit

Permalink
upgrade tests/lint_cli_* to types-first
Browse files Browse the repository at this point in the history
Summary:
Makes tests compatible with Flow types-first, by
* removing unnecessary exports that used to cause signature-verification errors
* adding annotations when needed
* converting `var` to `const`

Reviewed By: gkz

Differential Revision: D25609131

fbshipit-source-id: 701f7cc6b8235cfdb9d7cb6f2473d32d1d449179
  • Loading branch information
panagosg7 authored and facebook-github-bot committed Dec 17, 2020
1 parent b746999 commit 0ff0dbf
Show file tree
Hide file tree
Showing 33 changed files with 74 additions and 83 deletions.
1 change: 0 additions & 1 deletion tests/lint_cli_add_all/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[libs]

[options]
types_first=false

[lints]
all=off
4 changes: 2 additions & 2 deletions tests/lint_cli_add_all/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
6 changes: 3 additions & 3 deletions tests/lint_cli_add_all/cycle_C.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var vars = require("./cycle_B.js")
const vars = require("./cycle_B.js")

function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
12 changes: 6 additions & 6 deletions tests/lint_cli_add_all/lint_cli_add_all.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Sketchy null check on number [1] which is potentially 0. Perhaps you meant to ch
^

References:
cycle_B.js:3:19
3| var b = {a: a, b: 0};
^ [1]
cycle_C.js:7:17
7| var resNull = f(null);
^^^^ [2]
cycle_B.js:3:21
3| const b = {a: a, b: 0};
^ [1]
cycle_C.js:7:25
7| const resNull: void = f(null);
^^^^ [2]


Error -------------------------------------------------------------------------------------------- fully_across_B.js:4:6
Expand Down
1 change: 0 additions & 1 deletion tests/lint_cli_add_single/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[libs]

[options]
types_first=false

[lints]
all=off
4 changes: 2 additions & 2 deletions tests/lint_cli_add_single/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
4 changes: 2 additions & 2 deletions tests/lint_cli_add_single/cycle_C.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
12 changes: 6 additions & 6 deletions tests/lint_cli_add_single/lint_cli_add_single.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Sketchy null check on number [1] which is potentially 0. Perhaps you meant to ch
^

References:
cycle_B.js:3:19
3| var b = {a: a, b: 0};
^ [1]
cycle_C.js:7:17
7| var resNull = f(null);
^^^^ [2]
cycle_B.js:3:21
3| const b = {a: a, b: 0};
^ [1]
cycle_C.js:7:25
7| const resNull: void = f(null);
^^^^ [2]


Error -------------------------------------------------------------------------------------------- fully_across_B.js:4:6
Expand Down
1 change: 0 additions & 1 deletion tests/lint_cli_no_override_all/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[libs]

[options]
types_first=false

[lints]
all=error
4 changes: 2 additions & 2 deletions tests/lint_cli_no_override_all/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
4 changes: 2 additions & 2 deletions tests/lint_cli_no_override_all/cycle_C.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
12 changes: 6 additions & 6 deletions tests/lint_cli_no_override_all/lint_cli_no_override_all.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Sketchy null check on number [1] which is potentially 0. Perhaps you meant to ch
^

References:
cycle_B.js:3:19
3| var b = {a: a, b: 0};
^ [1]
cycle_C.js:7:17
7| var resNull = f(null);
^^^^ [2]
cycle_B.js:3:21
3| const b = {a: a, b: 0};
^ [1]
cycle_C.js:7:25
7| const resNull: void = f(null);
^^^^ [2]


Error -------------------------------------------------------------------------------------------- fully_across_B.js:4:6
Expand Down
1 change: 0 additions & 1 deletion tests/lint_cli_no_override_none/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[libs]

[options]
types_first=false

[lints]
all=off
4 changes: 2 additions & 2 deletions tests/lint_cli_no_override_none/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
4 changes: 2 additions & 2 deletions tests/lint_cli_no_override_none/cycle_C.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
1 change: 0 additions & 1 deletion tests/lint_cli_remove_all/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[libs]

[options]
types_first=false

[lints]
all=error
4 changes: 2 additions & 2 deletions tests/lint_cli_remove_all/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
4 changes: 2 additions & 2 deletions tests/lint_cli_remove_all/cycle_C.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
1 change: 0 additions & 1 deletion tests/lint_cli_remove_single/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[libs]

[options]
types_first=false

[lints]
all=error
Expand Down
4 changes: 2 additions & 2 deletions tests/lint_cli_remove_single/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
4 changes: 2 additions & 2 deletions tests/lint_cli_remove_single/cycle_C.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
1 change: 0 additions & 1 deletion tests/lint_suppressions_all/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[options]
types_first=false
all=true

[lints]
Expand Down
4 changes: 2 additions & 2 deletions tests/lint_suppressions_all/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
4 changes: 2 additions & 2 deletions tests/lint_suppressions_all/cycle_C.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
12 changes: 6 additions & 6 deletions tests/lint_suppressions_all/lint_suppressions_all.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Sketchy null check on number [1] which is potentially 0. Perhaps you meant to ch
^

References:
cycle_B.js:3:19
3| var b = {a: a, b: 0};
^ [1]
cycle_C.js:7:17
7| var resNull = f(null);
^^^^ [2]
cycle_B.js:3:21
3| const b = {a: a, b: 0};
^ [1]
cycle_C.js:7:25
7| const resNull: void = f(null);
^^^^ [2]


Error -------------------------------------------------------------------------------------------- fully_across_B.js:4:6
Expand Down
1 change: 0 additions & 1 deletion tests/lint_suppressions_single/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[options]
types_first=false
all=true

[lints]
Expand Down
4 changes: 2 additions & 2 deletions tests/lint_suppressions_single/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
4 changes: 2 additions & 2 deletions tests/lint_suppressions_single/cycle_C.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
12 changes: 6 additions & 6 deletions tests/lint_suppressions_single/lint_suppressions_single.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Sketchy null check on number [1] which is potentially 0. Perhaps you meant to ch
^

References:
cycle_B.js:3:19
3| var b = {a: a, b: 0};
^ [1]
cycle_C.js:7:17
7| var resNull = f(null);
^^^^ [2]
cycle_B.js:3:21
3| const b = {a: a, b: 0};
^ [1]
cycle_C.js:7:25
7| const resNull: void = f(null);
^^^^ [2]


Error -------------------------------------------------------------------------------------------- fully_across_B.js:4:6
Expand Down
1 change: 0 additions & 1 deletion tests/sketchy_null_check/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[options]
types_first=false
all=true

[lints]
Expand Down
4 changes: 2 additions & 2 deletions tests/sketchy_null_check/cycle_B.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var a = require("./cycle_A.js");
const a = require("./cycle_A.js");

var b = {a: a, b: 0};
const b = {a: a, b: 0};

module.exports = b;
6 changes: 3 additions & 3 deletions tests/sketchy_null_check/cycle_C.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var vars = require("./cycle_B.js")
const vars = require("./cycle_B.js")

function f(x) {
if (x); /* sketchy because of uses */
}

var resNull = f(null);
var resB = f(vars.b);
const resNull: void = f(null);
const resB: void = f(vars.b);

module.exports = {resA: resNull, resB: resB};
12 changes: 6 additions & 6 deletions tests/sketchy_null_check/sketchy_null_check.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Sketchy null check on number [1] which is potentially 0. Perhaps you meant to ch
^

References:
cycle_B.js:3:19
3| var b = {a: a, b: 0};
^ [1]
cycle_C.js:7:17
7| var resNull = f(null);
^^^^ [2]
cycle_B.js:3:21
3| const b = {a: a, b: 0};
^ [1]
cycle_C.js:7:25
7| const resNull: void = f(null);
^^^^ [2]


Error -------------------------------------------------------------------------------------------- fully_across_B.js:4:6
Expand Down

0 comments on commit 0ff0dbf

Please sign in to comment.