Skip to content

Commit 9ac1fce

Browse files
authoredSep 6, 2022
Fix eslint not looking at certain scripts, fix lints (#50660)
1 parent fd05c0c commit 9ac1fce

7 files changed

+21
-8
lines changed
 

‎.eslintignore

+13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
/tests/**
44
/lib/**
55
/src/lib/*.generated.d.ts
6+
# Ignore all compiled script outputs
67
/scripts/*.js
8+
# But, not the ones that are hand-written.
9+
# TODO: remove once scripts are pure JS
10+
!/scripts/browserIntegrationTest.js
11+
!/scripts/createPlaygroundBuild.js
12+
!/scripts/failed-tests.js
13+
!/scripts/find-unused-diagnostic-messages.js
14+
!/scripts/lint-hooks.js
15+
!/scripts/perf-result-post.js
16+
!/scripts/post-vsts-artifact-comment.js
17+
!/scripts/regenerate-unicode-identifier-parts.js
18+
!/scripts/run-sequence.js
19+
!/scripts/update-experimental-branches.js
720
/scripts/eslint/built/**
821
/internal/**
922
/coverage/**

‎.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//
2323
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
2424
// that will work regardless of the below.
25-
{ "files": ["*.ts"] }
25+
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }
2626
],
2727
"rules": {
2828
"@typescript-eslint/adjacent-overload-signatures": "error",

‎scripts/failed-tests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FailedTestsReporter extends Mocha.reporters.Base {
4545
}
4646
}
4747

48-
const newOptions = Object.assign({}, options, { reporterOptions: reporterOptions.reporterOptions || {} });
48+
const newOptions = { ...options, reporterOptions: reporterOptions.reporterOptions || {} };
4949
if (reporterOptions.reporter === "xunit") {
5050
newOptions.reporterOptions.output = "TEST-results.xml";
5151
}
@@ -142,4 +142,4 @@ class FailedTestsReporter extends Mocha.reporters.Base {
142142
}
143143
}
144144

145-
module.exports = FailedTestsReporter;
145+
module.exports = FailedTestsReporter;

‎scripts/find-unused-diganostic-messages.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ startOfDiags.split(EOL).forEach(line => {
1717
try {
1818
execSync(`grep -rnw 'src' -e 'Diagnostics.${diagName}'`).toString();
1919
process.stdout.write(".");
20-
} catch (error) {
20+
}
21+
catch (error) {
2122
missingNames.push(diagName);
2223
process.stdout.write("x");
2324
}

‎scripts/post-vsts-artifact-comment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ and then running \`npm install\`.
4848

4949
// Temporarily disable until we get access controls set up right
5050
// Send a ping to https://github.com/microsoft/typescript-make-monaco-builds#pull-request-builds
51-
await gh.request("POST /repos/microsoft/typescript-make-monaco-builds/dispatches", { event_type: process.env.SOURCE_ISSUE, headers: { Accept: "application/vnd.github.everest-preview+json" }});
51+
await gh.request("POST /repos/microsoft/typescript-make-monaco-builds/dispatches", { event_type: process.env.SOURCE_ISSUE, headers: { Accept: "application/vnd.github.everest-preview+json" } });
5252
}
5353

5454
main().catch(async e => {

‎scripts/run-sequence.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// @ts-check
22
const cp = require("child_process");
33
/**
4-
*
54
* @param {[string, string[]][]} tasks
65
* @param {cp.SpawnSyncOptions} opts
76
*/
@@ -17,4 +16,4 @@ function runSequence(tasks, opts = { timeout: 100000, shell: true }) {
1716
return lastResult && lastResult.stdout && lastResult.stdout.toString();
1817
}
1918

20-
exports.runSequence = runSequence;
19+
exports.runSequence = runSequence;

‎scripts/update-experimental-branches.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const triggeredPR = process.env.SOURCE_ISSUE || process.env.SYSTEM_PULLREQUEST_P
1010
* This program should be invoked as `node ./scripts/update-experimental-branches <GithubAccessToken>`
1111
* TODO: the following is racey - if two experiment-enlisted PRs trigger simultaneously and witness one another in an unupdated state, they'll both produce
1212
* a new experimental branch, but each will be missing a change from the other. There's no _great_ way to fix this beyond setting the maximum concurrency
13-
* of this task to 1 (so only one job is allowed to update experiments at a time).
13+
* of this task to 1 (so only one job is allowed to update experiments at a time).
1414
*/
1515
async function main() {
1616
const gh = new Octokit({

0 commit comments

Comments
 (0)
Please sign in to comment.