diff --git a/.eslintrc.js b/.eslintrc.js index 4974d31f8c9..f25eb9271c8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,6 +21,7 @@ module.exports = { sourceType: 'module', project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], tsconfigRootDir: __dirname, + warnOnUnsupportedTypeScriptVersion: false, }, rules: { // diff --git a/README.md b/README.md index c298f806950..13c792bdd97 100644 --- a/README.md +++ b/README.md @@ -234,11 +234,13 @@ The latest version under the `canary` tag **(latest commit to master)** is: ## Supported TypeScript Version -We will always endeavor to support the latest stable version of TypeScript. Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript. In some cases, we may even be able to support additional pre-releases (i.e. betas and release candidates) of TypeScript, but only if doing so does not require us to compromise on support for the latest stable version. +**The version range of TypeScript currently supported by this parser is `>=3.3.1 <3.8.0`.** + +These versions are what we test against. -**The version range of TypeScript currently supported by this parser is `>=3.2.1 <3.8.0`.** +We will always endeavor to support the latest stable version of TypeScript. Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript. In some cases, we may even be able to support additional pre-releases (i.e. betas and release candidates) of TypeScript, but only if doing so does not require us to compromise on support for the latest stable version. -This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. +Note that our packages have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. If you use a non-supported version of TypeScript, the parser will log a warning to the console. If you want to disable this warning, you can configure this in your `parserOptions`. See: [`@typescript-eslint/parser`](./packages/parser/) and [`@typescript-eslint/typescript-estree`](./packages/typescript-estree/). diff --git a/package.json b/package.json index 41ba3591658..5b00b8bb264 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lint:markdown:fix": "lint:markdown --fix", "lint:markdown": "markdownlint '**/*.md' --config=.markdownlint.json --ignore-path=.markdownlintignore", "lint": "eslint . --ext .js,.ts", - "postinstall": "yarn lerna-init && yarn build", + "postinstall": "yarn lerna:init && yarn build", "pre-commit": "yarn lint-staged", "pre-push": "yarn check:format", "test": "lerna run test --concurrency 1", @@ -79,9 +79,9 @@ "ts-jest": "^25.5.1", "ts-node": "^8.10.1", "tslint": "^6.1.2", - "typescript": ">=3.2.1 <4.0.0" + "typescript": ">=3.3.1 <4.0.0" }, "resolutions": { - "typescript": "^3.8.3" + "typescript": "3.9.2" } } diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index df2492c56b3..5ab7fe44a7b 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -249,9 +249,7 @@ Types for the AST produced by the parse functions. ## Supported TypeScript Version -We will always endeavor to support the latest stable version of TypeScript. - -The version of TypeScript currently supported by this parser is `~3.2.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. +See the [Supported TypeScript Version](../../README.md#supported-typescript-version) section in the project root. If you use a non-supported version of TypeScript, the parser will log a warning to the console. diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 57fbc01abab..f4a1d2047c9 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -20,12 +20,12 @@ const log = debug('typescript-eslint:typescript-estree:parser'); * This needs to be kept in sync with the top-level README.md in the * typescript-eslint monorepo */ -const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.2.1 <3.8.0'; +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <3.8.0'; /* * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one * List them all separately here, so we can automatically create the full string */ -const SUPPORTED_PRERELEASE_RANGES = ['>3.7.0-dev.0', '3.7.1-rc']; +const SUPPORTED_PRERELEASE_RANGES: string[] = []; const ACTIVE_TYPESCRIPT_VERSION = ts.version; const isRunningSupportedTypeScriptVersion = semver.satisfies( ACTIVE_TYPESCRIPT_VERSION, diff --git a/yarn.lock b/yarn.lock index 8990a0267b1..397043be8f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8451,7 +8451,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, "typescript@>=3.2.1 <4.0.0", typescript@^3.8.3: +typescript@*, typescript@3.9.2, "typescript@>=3.3.1 <4.0.0": version "3.9.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9" integrity sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==