Skip to content

Commit bf27ad6

Browse files
committed
Merge branch 'main' into cacheModuleResolution
2 parents 6fe5a9b + 1f0f7c8 commit bf27ad6

File tree

162 files changed

+3456
-1537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+3456
-1537
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
**/node_modules/**
12
/built/local/**
23
/tests/**
34
/lib/**
45
/src/lib/*.generated.d.ts
6+
/scripts/*.js
7+
/scripts/eslint/built/**
8+
/internal/**
9+
/coverage/**

.eslintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
"plugins": [
1414
"@typescript-eslint", "jsdoc", "no-null", "import"
1515
],
16+
"overrides": [
17+
// By default, the ESLint CLI only looks at .js files. But, it will also look at
18+
// any files which are referenced in an override config. Most users of typescript-eslint
19+
// get this behavior by default by extending a recommended typescript-eslint config, which
20+
// just so happens to override some core ESLint rules. We don't extend from any config, so
21+
// explicitly reference TS files here so the CLI picks them up.
22+
//
23+
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
24+
// that will work regardless of the below.
25+
{ "files": ["*.ts"] }
26+
],
1627
"rules": {
1728
"@typescript-eslint/adjacent-overload-signatures": "error",
1829
"@typescript-eslint/array-type": "error",

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ scripts/produceLKG.js
5454
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
5555
scripts/generateLocalizedDiagnosticMessages.js
5656
scripts/request-pr-review.js
57+
scripts/errorCheck.js
5758
scripts/*.js.map
5859
scripts/typings/
5960
coverage/

.vscode/settings.template.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
],
77
"eslint.options": {
88
"rulePaths": ["./scripts/eslint/built/rules/"],
9-
"extensions": [".ts"]
109
},
1110
// To use the last-known-good (LKG) compiler version:
1211
// "typescript.tsdk": "lib"

Gulpfile.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,13 @@ task("run-eslint-rules-tests").description = "Runs the eslint rule tests";
350350

351351
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
352352
const eslint = (folder) => async () => {
353-
354353
const formatter = cmdLineOptions.ci ? "stylish" : "autolinkable-stylish";
355354
const args = [
356355
"node_modules/eslint/bin/eslint",
357356
"--cache",
358357
"--cache-location", `${folder}/.eslintcache`,
359358
"--format", formatter,
360359
"--rulesdir", "scripts/eslint/built/rules",
361-
"--ext", ".ts",
362360
];
363361

364362
if (cmdLineOptions.fix) {
@@ -371,22 +369,12 @@ const eslint = (folder) => async () => {
371369
return exec(process.execPath, args);
372370
};
373371

374-
const lintScripts = eslint("scripts");
375-
lintScripts.displayName = "lint-scripts";
376-
task("lint-scripts", series([buildEslintRules, lintScripts]));
377-
task("lint-scripts").description = "Runs eslint on the scripts sources.";
378-
379-
const lintCompiler = eslint("src");
380-
lintCompiler.displayName = "lint-compiler";
381-
task("lint-compiler", series([buildEslintRules, lintCompiler]));
382-
task("lint-compiler").description = "Runs eslint on the compiler sources.";
383-
task("lint-compiler").flags = {
384-
" --ci": "Runs eslint additional rules",
385-
};
372+
const lintRoot = eslint(".");
373+
lintRoot.displayName = "lint";
386374

387-
const lint = series([buildEslintRules, lintScripts, lintCompiler]);
375+
const lint = series([buildEslintRules, lintRoot]);
388376
lint.displayName = "lint";
389-
task("lint", series([buildEslintRules, lint]));
377+
task("lint", lint);
390378
task("lint").description = "Runs eslint on the compiler and scripts sources.";
391379
task("lint").flags = {
392380
" --ci": "Runs eslint additional rules",

package-lock.json

Lines changed: 190 additions & 176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
},
3131
"devDependencies": {
3232
"@octokit/rest": "latest",
33+
"@types/async": "latest",
3334
"@types/chai": "latest",
3435
"@types/convert-source-map": "latest",
3536
"@types/fs-extra": "^9.0.13",
@@ -88,6 +89,7 @@
8889
"typescript": "^4.5.5",
8990
"vinyl": "latest",
9091
"vinyl-sourcemaps-apply": "latest",
92+
"which": "^2.0.2",
9193
"xml2js": "^0.4.23"
9294
},
9395
"overrides": {
@@ -106,8 +108,6 @@
106108
"gulp": "gulp",
107109
"lint": "gulp lint",
108110
"lint:ci": "gulp lint --ci",
109-
"lint:compiler": "gulp lint-compiler",
110-
"lint:scripts": "gulp lint-scripts",
111111
"setup-hooks": "node scripts/link-hooks.js"
112112
},
113113
"browser": {

scripts/authors.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs = require("fs");
2-
import path = require("path");
3-
import childProcess = require("child_process");
1+
import * as fs from "fs";
2+
import * as path from "path";
3+
import * as childProcess from "child_process";
44

55
interface Author {
66
displayNames: string[];
@@ -120,10 +120,10 @@ namespace Commands {
120120
const authors: { name: string, email: string, knownAuthor?: Author }[] = [];
121121
const {output: [error, stdout, stderr]} = childProcess.spawnSync(`git`, ["shortlog", "-se", ...specs], { cwd: path.resolve(__dirname, "../") });
122122
if (error) {
123-
console.log(stderr.toString());
123+
console.log(stderr!.toString());
124124
}
125125
else {
126-
const output = stdout.toString();
126+
const output = stdout!.toString();
127127
const lines = output.split("\n");
128128
lines.forEach(line => {
129129
if (line) {

scripts/build/options.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = minimist(process.argv.slice(2), {
77
boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
88
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
99
alias: {
10+
/* eslint-disable quote-props */
1011
"b": "browser",
1112
"i": ["inspect", "inspect-brk", "break", "debug", "debug-brk"],
1213
"t": ["tests", "test"],
@@ -16,6 +17,7 @@ module.exports = minimist(process.argv.slice(2), {
1617
"skippercent": "skipPercent",
1718
"w": "workers",
1819
"f": "fix"
20+
/* eslint-enable quote-props */
1921
},
2022
default: {
2123
soft: false,

scripts/build/prepend.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @ts-check
22
const stream = require("stream");
3-
const Vinyl = require("vinyl");
43
const ts = require("../../lib/typescript");
54
const fs = require("fs");
65
const { base64VLQFormatEncode } = require("./sourcemaps");
@@ -43,13 +42,14 @@ function prepend(data) {
4342
sourcesContent: input.sourcesContent
4443
};
4544
}
45+
// eslint-disable-next-line boolean-trivia, no-null/no-null
4646
return cb(null, output);
4747
}
4848
catch (e) {
4949
return cb(e);
5050
}
5151
}
52-
})
52+
});
5353
}
5454
exports.prepend = prepend;
5555

@@ -59,6 +59,6 @@ exports.prepend = prepend;
5959
function prependFile(file) {
6060
const data = typeof file === "string" ? fs.readFileSync(file, "utf8") :
6161
vinyl => fs.readFileSync(file(vinyl), "utf8");
62-
return prepend(data)
62+
return prepend(data);
6363
}
64-
exports.prependFile = prependFile;
64+
exports.prependFile = prependFile;

0 commit comments

Comments
 (0)