Skip to content

Commit

Permalink
Merge branch 'main' into scan-bigger/fewer-jsdoc-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
sandersn committed Mar 7, 2023
2 parents 76813c0 + ff1e08f commit 9427037
Show file tree
Hide file tree
Showing 1,821 changed files with 3,131 additions and 33,545 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/accept-baselines-fix-lints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
git config user.email "[email protected]"
git config user.name "TypeScript Bot"
npm install
git rm -r --quiet tests/baselines/reference :^tests/baselines/reference/docker :^tests/baselines/reference/user
git rm -r --quiet tests/baselines/reference
npx hereby runtests-parallel --ci --fix || true
npx hereby baseline-accept
git add ./src
Expand Down
25 changes: 1 addition & 24 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules/
.node_modules/
built/*
tests/cases/rwc/*
tests/cases/test262/*
tests/cases/perf/*
!tests/cases/webharness/compilerToString.js
test-args.txt
Expand All @@ -14,7 +13,6 @@ tests/baselines/local.old/*
tests/services/baselines/local/*
tests/baselines/prototyping/local/*
tests/baselines/rwc/*
tests/baselines/test262/*
tests/baselines/reference/projectOutput/*
tests/baselines/local/projectOutput/*
tests/baselines/reference/testresults.tap
Expand All @@ -34,7 +32,6 @@ tests/webTestServer.js.map
tests/webhost/*.d.ts
tests/webhost/webtsc.js
tests/cases/**/*.js
!tests/cases/docker/*.js/
tests/cases/**/*.js.map
*.config
scripts/eslint/built/
Expand All @@ -59,29 +56,9 @@ internal/
yarn.lock
yarn-error.log
.parallelperf.*
tests/cases/user/*/package-lock.json
tests/cases/user/*/node_modules/
tests/cases/user/*/**/*.js
tests/cases/user/*/**/*.js.map
tests/cases/user/*/**/*.d.ts
!tests/cases/user/zone.js/
!tests/cases/user/bignumber.js/
!tests/cases/user/discord.js/
tests/baselines/reference/dt
.failed-tests
TEST-results.xml
package-lock.json
tests/cases/user/npm/npm
tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
tests/cases/user/create-react-app/create-react-app
tests/cases/user/fp-ts/fp-ts
tests/cases/user/webpack/webpack
tests/cases/user/puppeteer/puppeteer
tests/cases/user/axios-src/axios-src
tests/cases/user/prettier/prettier
.eslintcache
*v8.log
*v8.log
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ hereby tests # Build the test infrastructure using the built compile
hereby runtests # Run tests using the built compiler and test infrastructure.
# You can override the specific suite runner used or specify a test for this command.
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
# Valid runners include conformance, compiler, fourslash, project, user, and docker
# The user and docker runners are extended test suite runners - the user runner
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
# You'll need to have the docker executable in your system path for the docker runner to work.
# Valid runners include conformance, compiler, fourslash, and project
hereby runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
# core count by default. Use --workers=<number> to adjust this.
hereby baseline-accept # This replaces the baseline test results with the results obtained from hereby runtests.
Expand Down
172 changes: 86 additions & 86 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion scripts/build/tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const localBaseline = "tests/baselines/local/";
export const refBaseline = "tests/baselines/reference/";
export const localRwcBaseline = "internal/baselines/rwc/local";
export const refRwcBaseline = "internal/baselines/rwc/reference";
export const localTest262Baseline = "internal/baselines/test262/local";

/**
* @param {string} runJs
Expand Down
3 changes: 3 additions & 0 deletions scripts/configurePrerelease.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import assert from "assert";
import { execFileSync } from "child_process";
import { readFileSync, writeFileSync } from "fs";
import { normalize, relative } from "path";
import url from "url";
Expand All @@ -11,6 +12,7 @@ const __filename = url.fileURLToPath(new URL(import.meta.url));
name: string;
version: string;
keywords: string[];
gitHead?: string;
}} PackageJson
*/

Expand Down Expand Up @@ -51,6 +53,7 @@ function main() {
// Finally write the changes to disk.
// Modify the package.json structure
packageJsonValue.version = `${majorMinor}.${prereleasePatch}`;
packageJsonValue.gitHead = execFileSync("git", ["rev-parse", "HEAD"], { encoding: "utf8" }).trim();
writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4));
writeFileSync(tsFilePath, modifiedTsFileContents);
}
Expand Down
2 changes: 1 addition & 1 deletion src/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../.eslintrc.json",
"parserOptions": {
"tsconfigRootDir": "src",
"project": "./tsconfig-base.json"
"project": "./tsconfig-eslint.json"
},
"rules": {
"@typescript-eslint/no-unnecessary-type-assertion": "error",
Expand Down
9 changes: 6 additions & 3 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
createIndexInfo,
getAnyType: () => anyType,
getStringType: () => stringType,
getStringLiteralType,
getNumberType: () => numberType,
getNumberLiteralType,
getBigIntType: () => bigintType,
createPromiseType,
createArrayType,
getElementTypeOfArrayType,
Expand Down Expand Up @@ -20708,9 +20711,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const propDeclaration = prop.valueDeclaration as ObjectLiteralElementLike;
Debug.assertNode(propDeclaration, isObjectLiteralElementLike);

errorNode = propDeclaration;

const name = propDeclaration.name!;
errorNode = name;

if (isIdentifier(name)) {
suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
}
Expand Down Expand Up @@ -38247,7 +38250,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

function checkAccessorDeclaration(node: AccessorDeclaration) {
if (isIdentifier(node.name) && idText(node.name) === "constructor") {
if (isIdentifier(node.name) && idText(node.name) === "constructor" && isClassLike(node.parent)) {
error(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor);
}
addLazyDiagnostic(checkAccessorDeclarationDiagnostics);
Expand Down
12 changes: 10 additions & 2 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4281,11 +4281,11 @@
"category": "Error",
"code": 5098
},
"Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '\"ignoreDeprecations\": \"{2}\"' to silence this error.": {
"Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '\"ignoreDeprecations\": \"{2}\"' to silence this error.": {
"category": "Error",
"code": 5101
},
"Flag '{0}' is deprecated. Please remove it from your configuration.": {
"Option '{0}' has been removed. Please remove it from your configuration.": {
"category": "Error",
"code": 5102
},
Expand All @@ -4305,6 +4305,14 @@
"category": "Message",
"code": 5106
},
"Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '\"ignoreDeprecations\": \"{3}\"' to silence this error.": {
"category": "Error",
"code": 5107
},
"Option '{0}={1}' has been removed. Please remove it from your configuration.": {
"category": "Error",
"code": 5108
},

"Generates a sourcemap for each corresponding '.d.ts' file.": {
"category": "Message",
Expand Down
Loading

0 comments on commit 9427037

Please sign in to comment.