Skip to content

Commit

Permalink
Fix eslint not looking at certain scripts, fix lints (#50660)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Sep 6, 2022
1 parent fd05c0c commit 9ac1fce
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .eslintignore
Expand Up @@ -3,7 +3,20 @@
/tests/**
/lib/**
/src/lib/*.generated.d.ts
# Ignore all compiled script outputs
/scripts/*.js
# But, not the ones that are hand-written.
# TODO: remove once scripts are pure JS
!/scripts/browserIntegrationTest.js
!/scripts/createPlaygroundBuild.js
!/scripts/failed-tests.js
!/scripts/find-unused-diagnostic-messages.js
!/scripts/lint-hooks.js
!/scripts/perf-result-post.js
!/scripts/post-vsts-artifact-comment.js
!/scripts/regenerate-unicode-identifier-parts.js
!/scripts/run-sequence.js
!/scripts/update-experimental-branches.js
/scripts/eslint/built/**
/internal/**
/coverage/**
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -22,7 +22,7 @@
//
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
// that will work regardless of the below.
{ "files": ["*.ts"] }
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
Expand Down
4 changes: 2 additions & 2 deletions scripts/failed-tests.js
Expand Up @@ -45,7 +45,7 @@ class FailedTestsReporter extends Mocha.reporters.Base {
}
}

const newOptions = Object.assign({}, options, { reporterOptions: reporterOptions.reporterOptions || {} });
const newOptions = { ...options, reporterOptions: reporterOptions.reporterOptions || {} };
if (reporterOptions.reporter === "xunit") {
newOptions.reporterOptions.output = "TEST-results.xml";
}
Expand Down Expand Up @@ -142,4 +142,4 @@ class FailedTestsReporter extends Mocha.reporters.Base {
}
}

module.exports = FailedTestsReporter;
module.exports = FailedTestsReporter;
3 changes: 2 additions & 1 deletion scripts/find-unused-diganostic-messages.mjs
Expand Up @@ -17,7 +17,8 @@ startOfDiags.split(EOL).forEach(line => {
try {
execSync(`grep -rnw 'src' -e 'Diagnostics.${diagName}'`).toString();
process.stdout.write(".");
} catch (error) {
}
catch (error) {
missingNames.push(diagName);
process.stdout.write("x");
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/post-vsts-artifact-comment.js
Expand Up @@ -48,7 +48,7 @@ and then running \`npm install\`.

// Temporarily disable until we get access controls set up right
// Send a ping to https://github.com/microsoft/typescript-make-monaco-builds#pull-request-builds
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" }});
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" } });
}

main().catch(async e => {
Expand Down
3 changes: 1 addition & 2 deletions scripts/run-sequence.js
@@ -1,7 +1,6 @@
// @ts-check
const cp = require("child_process");
/**
*
* @param {[string, string[]][]} tasks
* @param {cp.SpawnSyncOptions} opts
*/
Expand All @@ -17,4 +16,4 @@ function runSequence(tasks, opts = { timeout: 100000, shell: true }) {
return lastResult && lastResult.stdout && lastResult.stdout.toString();
}

exports.runSequence = runSequence;
exports.runSequence = runSequence;
2 changes: 1 addition & 1 deletion scripts/update-experimental-branches.js
Expand Up @@ -10,7 +10,7 @@ const triggeredPR = process.env.SOURCE_ISSUE || process.env.SYSTEM_PULLREQUEST_P
* This program should be invoked as `node ./scripts/update-experimental-branches <GithubAccessToken>`
* TODO: the following is racey - if two experiment-enlisted PRs trigger simultaneously and witness one another in an unupdated state, they'll both produce
* 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
* of this task to 1 (so only one job is allowed to update experiments at a time).
* of this task to 1 (so only one job is allowed to update experiments at a time).
*/
async function main() {
const gh = new Octokit({
Expand Down

0 comments on commit 9ac1fce

Please sign in to comment.