diff --git a/README.md b/README.md index 2443ba50a162..d2374728b652 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ The latest version under the `canary` tag **(latest commit to master)** is: ## Supported TypeScript Version -**The version range of TypeScript currently supported by this parser is `>=3.3.1 <4.5.0`.** +**The version range of TypeScript currently supported by this parser is `>=3.3.1 <4.6.0`.** These versions are what we test against. diff --git a/package.json b/package.json index 1fac8603db6e..685bdd3092c3 100644 --- a/package.json +++ b/package.json @@ -131,10 +131,10 @@ "ts-jest": "^27.0.5", "ts-node": "^10.4.0", "tslint": "^6.1.3", - "typescript": ">=3.3.1 <4.5.0" + "typescript": ">=3.3.1 <4.6.0 || 4.5.1-rc" }, "resolutions": { "@types/node": "^16.11.4", - "typescript": "4.4.4" + "typescript": "4.5.1-rc" } } diff --git a/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts index fea8b82501ae..be300242e3d2 100644 --- a/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts @@ -361,7 +361,7 @@ ruleTester.run('restrict-template-expressions', rule, { errors: [ { messageId: 'invalidType', - data: { type: 'any' }, + data: { type: 'T' }, line: 3, column: 27, }, diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 9a9dc04a771e..65847192bd54 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -30,12 +30,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.3.1 <4.5.0'; +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.6.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: string[] = ['4.4.0-beta', '4.4.1-rc']; +const SUPPORTED_PRERELEASE_RANGES: string[] = ['4.5.0-beta', '4.5.1-rc']; const ACTIVE_TYPESCRIPT_VERSION = ts.version; const isRunningSupportedTypeScriptVersion = semver.satisfies( ACTIVE_TYPESCRIPT_VERSION, diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included.js b/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included01.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included.js rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included01.js diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included.jsx b/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included02.jsx similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included.jsx rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/js/included02.jsx diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded.js b/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded01.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded.js rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded01.js diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded.jsx b/packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded02.jsx similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded.jsx rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/js/notIncluded02.jsx diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included.ts b/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included01.ts similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included.ts rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included01.ts diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included.tsx b/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included02.tsx similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included.tsx rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/included02.tsx diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded.ts b/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded01.ts similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded.ts rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded01.ts diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded.tsx b/packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded02.tsx similarity index 100% rename from packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded.tsx rename to packages/typescript-estree/tests/fixtures/invalidFileErrors/ts/notIncluded02.tsx diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json index 9f3d8cab0be7..f4d9ad5a8d7e 100644 --- a/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json @@ -3,10 +3,10 @@ "allowJs": true }, "include": [ - "ts/included.ts", - "ts/included.tsx", - "js/included.js", - "js/included.jsx", + "ts/included01.ts", + "ts/included02.tsx", + "js/included01.js", + "js/included02.jsx", "other/included.vue" ] } diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap index c1c63f861b61..e1610759df96 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap @@ -34,25 +34,25 @@ The file must be included in at least one of the projects provided." exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 1`] = ` "\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: ts/notIncluded.ts. +The file does not match your project config: ts/notIncluded0j1.ts. The file must be included in at least one of the projects provided." `; exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 2`] = ` "\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: ts/notIncluded.tsx. +The file does not match your project config: ts/notIncluded02.tsx. The file must be included in at least one of the projects provided." `; exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 3`] = ` "\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: js/notIncluded.js. +The file does not match your project config: js/notIncluded01.js. The file must be included in at least one of the projects provided." `; exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 4`] = ` "\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: js/notIncluded.jsx. +The file does not match your project config: js/notIncluded02.jsx. The file must be included in at least one of the projects provided." `; diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts index f74bcc81794d..cd573fcd291f 100644 --- a/packages/typescript-estree/tests/lib/parse.test.ts +++ b/packages/typescript-estree/tests/lib/parse.test.ts @@ -518,23 +518,29 @@ describe('parseAndGenerateServices', () => { describe('project includes', () => { it("doesn't error for matched files", () => { - expect(testParse('ts/included.ts')).not.toThrow(); - expect(testParse('ts/included.tsx')).not.toThrow(); - expect(testParse('js/included.js')).not.toThrow(); - expect(testParse('js/included.jsx')).not.toThrow(); + expect(testParse('ts/included01.ts')).not.toThrow(); + expect(testParse('ts/included02.tsx')).not.toThrow(); + expect(testParse('js/included01.js')).not.toThrow(); + expect(testParse('js/included02.jsx')).not.toThrow(); }); it('errors for not included files', () => { - expect(testParse('ts/notIncluded.ts')).toThrowErrorMatchingSnapshot(); - expect(testParse('ts/notIncluded.tsx')).toThrowErrorMatchingSnapshot(); - expect(testParse('js/notIncluded.js')).toThrowErrorMatchingSnapshot(); - expect(testParse('js/notIncluded.jsx')).toThrowErrorMatchingSnapshot(); + expect( + testParse('ts/notIncluded0j1.ts'), + ).toThrowErrorMatchingSnapshot(); + expect( + testParse('ts/notIncluded02.tsx'), + ).toThrowErrorMatchingSnapshot(); + expect(testParse('js/notIncluded01.js')).toThrowErrorMatchingSnapshot(); + expect( + testParse('js/notIncluded02.jsx'), + ).toThrowErrorMatchingSnapshot(); }); }); describe('"parserOptions.extraFileExtensions" is empty', () => { it('should not error', () => { - expect(testParse('ts/included.ts', [])).not.toThrow(); + expect(testParse('ts/included01.ts', [])).not.toThrow(); }); it('the extension does not match', () => { diff --git a/yarn.lock b/yarn.lock index ae247d519540..ea80c3afcdb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14610,10 +14610,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@4.4.4, "typescript@>=3.3.1 <4.5.0", typescript@^4.1.0-dev.20201026, typescript@^4.4.3, typescript@~4.4.2: - version "4.4.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== +typescript@*, typescript@4.5.1-rc, "typescript@>=3.3.1 <4.6.0 || 4.5.1-rc", typescript@^4.1.0-dev.20201026, typescript@^4.4.3, typescript@~4.4.2: + version "4.5.1-rc" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.1-rc.tgz#02155eaa0579d11babb2a55dcbd796948a994bb3" + integrity sha512-tQBWW1DCFqweyhSzsAUSFgssJ3uuRBh0zyOkRV4CaFF2rMBkGU0I+MqPMch0qhGCUGXjOW7FgMrbQLS6PE3Z6Q== ua-parser-js@^0.7.30: version "0.7.31"