chore: update dlint to v0.37.0 for GitHub Actions (#17295)

Updated third_party dlint to v0.37.0 for GitHub Actions. This PR
includes following changes:
 
* fix(prefer-primordials): Stop using array pattern assignments
* fix(prefer-primordials): Stop using global intrinsics except for
`SharedArrayBuffer`
* feat(guard-for-in): Apply new guard-for-in rule
This commit is contained in:
Kenta Moriuchi 2023-01-17 01:17:18 +09:00 committed by GitHub
parent 40134ffc99
commit 6da958d7ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 128 additions and 103 deletions

View file

@ -360,7 +360,7 @@
ObjectKeys(value).length > 0 ||
ObjectGetOwnPropertySymbols(value).length > 0
) {
const [propString, refIndex] = inspectRawObject(
const { 0: propString, 1: refIndex } = inspectRawObject(
value,
inspectOptions,
);
@ -847,7 +847,7 @@
displayName: "",
delims: ["[", "]"],
entryHandler: (entry, inspectOptions) => {
const [index, val] = entry;
const { 0: index, 1: val } = entry;
let i = index;
lastValidIndex = index;
if (!ObjectPrototypeHasOwnProperty(value, i)) {
@ -940,7 +940,7 @@
displayName: "Map",
delims: ["{", "}"],
entryHandler: (entry, inspectOptions) => {
const [key, val] = entry;
const { 0: key, 1: val } = entry;
inspectOptions.indentLevel++;
const inspectedValue = `${
inspectValueWithQuotes(key, inspectOptions)
@ -1100,7 +1100,7 @@
const cyan = maybeColor(colors.cyan, inspectOptions);
const red = maybeColor(colors.red, inspectOptions);
const [state, result] = core.getPromiseDetails(value);
const { 0: state, 1: result } = core.getPromiseDetails(value);
if (state === PromiseState.Pending) {
return `Promise { ${cyan("<pending>")} }`;
@ -1363,7 +1363,7 @@
);
} else {
// Otherwise, default object formatting
let [insp, refIndex] = inspectRawObject(value, inspectOptions);
let { 0: insp, 1: refIndex } = inspectRawObject(value, inspectOptions);
insp = refIndex + insp;
return insp;
}
@ -1568,17 +1568,17 @@
let g_;
let b_;
if (h < 60) {
[r_, g_, b_] = [c, x, 0];
({ 0: r_, 1: g_, 2: b_ } = [c, x, 0]);
} else if (h < 120) {
[r_, g_, b_] = [x, c, 0];
({ 0: r_, 1: g_, 2: b_ } = [x, c, 0]);
} else if (h < 180) {
[r_, g_, b_] = [0, c, x];
({ 0: r_, 1: g_, 2: b_ } = [0, c, x]);
} else if (h < 240) {
[r_, g_, b_] = [0, x, c];
({ 0: r_, 1: g_, 2: b_ } = [0, x, c]);
} else if (h < 300) {
[r_, g_, b_] = [x, 0, c];
({ 0: r_, 1: g_, 2: b_ } = [x, 0, c]);
} else {
[r_, g_, b_] = [c, 0, x];
({ 0: r_, 1: g_, 2: b_ } = [c, 0, x]);
}
return [
MathRound((r_ + m) * 255),
@ -1645,7 +1645,7 @@
}
for (let i = 0; i < rawEntries.length; ++i) {
const [key, value] = rawEntries[i];
const { 0: key, 1: value } = rawEntries[i];
if (key == "background-color") {
if (value != null) {
css.backgroundColor = value;
@ -1736,12 +1736,12 @@
ansi += `\x1b[47m`;
} else {
if (ArrayIsArray(css.backgroundColor)) {
const [r, g, b] = css.backgroundColor;
const { 0: r, 1: g, 2: b } = css.backgroundColor;
ansi += `\x1b[48;2;${r};${g};${b}m`;
} else {
const parsed = parseCssColor(css.backgroundColor);
if (parsed !== null) {
const [r, g, b] = parsed;
const { 0: r, 1: g, 2: b } = parsed;
ansi += `\x1b[48;2;${r};${g};${b}m`;
} else {
ansi += "\x1b[49m";
@ -1770,12 +1770,12 @@
ansi += `\x1b[37m`;
} else {
if (ArrayIsArray(css.color)) {
const [r, g, b] = css.color;
const { 0: r, 1: g, 2: b } = css.color;
ansi += `\x1b[38;2;${r};${g};${b}m`;
} else {
const parsed = parseCssColor(css.color);
if (parsed !== null) {
const [r, g, b] = parsed;
const { 0: r, 1: g, 2: b } = parsed;
ansi += `\x1b[38;2;${r};${g};${b}m`;
} else {
ansi += "\x1b[39m";
@ -1799,7 +1799,7 @@
}
if (!colorEquals(css.textDecorationColor, prevCss.textDecorationColor)) {
if (css.textDecorationColor != null) {
const [r, g, b] = css.textDecorationColor;
const { 0: r, 1: g, 2: b } = css.textDecorationColor;
ansi += `\x1b[58;2;${r};${g};${b}m`;
} else {
ansi += "\x1b[59m";
@ -2045,7 +2045,7 @@
return;
}
const [first, ...rest] = args;
const [first, ...rest] = new SafeArrayIterator(args);
if (typeof first === "string") {
this.error(