Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump ESLint, NodeJS, and TS minimum version requirements #8377

Merged
merged 11 commits into from Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/wait-for-netlify/action.yml
Expand Up @@ -11,5 +11,5 @@ inputs:
description: How long to wait between retries of the Netlify api

runs:
using: node16
using: node20
main: index.js
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -156,10 +156,10 @@ jobs:
matrix:
exclude:
- os: windows-latest
node-version: 16
node-version: 18
os: [ubuntu-latest, windows-latest]
# just run on the oldest and latest supported versions and assume the intermediate versions are good
node-version: [16, 20]
node-version: [18, 20]
package:
[
'ast-spec',
Expand Down
Expand Up @@ -116,6 +116,7 @@ A single PR can remove support for old TypeScript versions as a breaking change:
1. Update the `SUPPORTED_TYPESCRIPT_VERSIONS` constant in `warnAboutTSVersion.ts`
1. Update the `versions` constant in `version-check.ts`
1. Update [Users > Dependency Versions > TypeScript](../../users/Dependency_Versions.mdx#typescript)
1. Update `MIN_TS_VERSION_SEMVER` in `packages/website/src/components/OptionsSelector.tsx`
1. Search for source code comments (excluding `CHANGELOG.md` files) that mention a now-unsupported version of TypeScript.
- For example, to remove support for v4.3, searches might include:
- `4.3`
Expand Down
20 changes: 16 additions & 4 deletions docs/users/Dependency_Versions.mdx
Expand Up @@ -7,13 +7,25 @@ import packageJson from '../../package.json';

## ESLint

> The version range of ESLint currently supported is `^7.0.0 || ^8.0.0`.
<blockquote>
<p>
The version range of ESLint currently supported is{' '}
<code>{packageJson.devDependencies.eslint}</code>.
</p>
</blockquote>

We generally support at least the latest two major versions of ESLint.
We generally support at least the latest two major versions of ESLint; though sometimes we may restrict this if the APIs change too much between major releases.

## Node

This project makes an effort to support Active LTS and Maintenance LTS release statuses of Node according to [Node's release document](https://github.com/nodejs/release#release-schedule).
<blockquote>
<p>
The version range of NodeJS currently supported is{' '}
<code>{packageJson.engines.node}</code>.
</p>
</blockquote>

We make an effort to support Active LTS and Maintenance LTS release statuses of Node according to [Node's release document](https://github.com/nodejs/release#release-schedule).
Support for specific Current status releases are considered periodically.

## TypeScript
Expand All @@ -25,7 +37,7 @@ Support for specific Current status releases are considered periodically.
</p>
</blockquote>

Note that we mirror [DefinitelyTyped's version support window](https://github.com/DefinitelyTyped/DefinitelyTyped/#support-window) - meaning we only support versions of TypeScript less than 2 years old.
We mirror [DefinitelyTyped's version support window](https://github.com/DefinitelyTyped/DefinitelyTyped/#support-window) - meaning we only support versions of TypeScript less than 2 years old.

You may find that our tooling works on older TypeScript versions however we provide no guarantees and **_we will not accept issues against unsupported versions_**.

Expand Down
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -50,7 +50,7 @@
"typecheck": "npx nx run-many --target=typecheck --parallel"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"devDependencies": {
"@actions/core": "^1.10.0",
Expand Down Expand Up @@ -84,7 +84,7 @@
"cross-fetch": "^4.0.0",
"cspell": "^7.0.0",
"downlevel-dts": ">=0.11.0",
"eslint": "^8.56.0",
"eslint": "8.56.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^5.2.1",
Expand Down Expand Up @@ -117,7 +117,7 @@
"ts-node": "10.7.0",
"tslint": "^6.1.3",
"tsx": "^4.6.2",
"typescript": ">=4.3.5 <5.4.0",
"typescript": ">=4.7.4 <5.4.0",
"typescript-eslint": "workspace:^",
"yargs": "17.7.2"
},
Expand All @@ -139,6 +139,7 @@
"@types/estree": "link:./tools/dummypkg",
"@types/node": "^20.0.0",
"@types/react": "^18.2.14",
"eslint": "8.56.0",
"eslint-visitor-keys": "^3.4.1",
"jest-config": "^29",
"jest-resolve": "^29",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/block-spacing.ts
Expand Up @@ -66,7 +66,7 @@ export default createRule<Options, MessageIds>({
function isValid(left: TSESTree.Token, right: TSESTree.Token): boolean {
return (
!isTokenOnSameLine(left, right) ||
sourceCode.isSpaceBetween!(left, right) === always
sourceCode.isSpaceBetween(left, right) === always
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/object-curly-spacing.ts
Expand Up @@ -173,7 +173,7 @@ export default createRule<Options, MessageIds>({
last: TSESTree.Token,
): void {
if (isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetween!(first, second);
const firstSpaced = sourceCode.isSpaceBetween(first, second);
const secondType = sourceCode.getNodeByRangeIndex(
second.range[0],
)!.type;
Expand Down Expand Up @@ -221,7 +221,7 @@ export default createRule<Options, MessageIds>({
? !options.spaced
: options.spaced;

const lastSpaced = sourceCode.isSpaceBetween!(penultimate, last);
const lastSpaced = sourceCode.isSpaceBetween(penultimate, last);

if (closingCurlyBraceMustBeSpaced && !lastSpaced) {
reportRequiredEndingSpace(node, last);
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/promise-function-async.ts
Expand Up @@ -183,7 +183,7 @@ export default createRule<Options, MessageIds>({
}

// check if there is a space between key and previous token
const insertSpace = !sourceCode.isSpaceBetween!(
const insertSpace = !sourceCode.isSpaceBetween(
sourceCode.getTokenBefore(keyToken)!,
keyToken,
);
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-plugin/src/rules/space-infix-ops.ts
Expand Up @@ -94,8 +94,8 @@ export default createRule<Options, MessageIds>({
const next = sourceCode.getTokenAfter(operator)!;

if (
!sourceCode.isSpaceBetween!(prev, operator) ||
!sourceCode.isSpaceBetween!(operator, next)
!sourceCode.isSpaceBetween(prev, operator) ||
!sourceCode.isSpaceBetween(operator, next)
) {
report(operator);
}
Expand Down Expand Up @@ -148,8 +148,8 @@ export default createRule<Options, MessageIds>({
const next = sourceCode.getTokenAfter(operator);

if (
!sourceCode.isSpaceBetween!(prev!, operator) ||
!sourceCode.isSpaceBetween!(operator, next!)
!sourceCode.isSpaceBetween(prev!, operator) ||
!sourceCode.isSpaceBetween(operator, next!)
) {
report(operator);
}
Expand Down
21 changes: 0 additions & 21 deletions packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts
Expand Up @@ -256,9 +256,6 @@ export { type T, T };
type T = 1;
export type { T, T };
`,
dependencyConstraints: {
typescript: '4.5',
},
errors: [
{
messageId: 'typeOverValue',
Expand All @@ -276,9 +273,6 @@ export { type/* */T, type /* */T, T };
type T = 1;
export type { /* */T, /* */T, T };
`,
dependencyConstraints: {
typescript: '4.5',
},
errors: [
{
messageId: 'typeOverValue',
Expand All @@ -299,9 +293,6 @@ const x = 1;
export type { T, T };
export { x };
`,
dependencyConstraints: {
typescript: '4.5',
},
errors: [
{
messageId: 'singleExportIsType',
Expand All @@ -321,9 +312,6 @@ type T = 1;
const x = 1;
export { type T, x };
`,
dependencyConstraints: {
typescript: '4.5',
},
options: [{ fixMixedExportsWithInlineTypeSpecifier: true }],
errors: [
{
Expand All @@ -342,9 +330,6 @@ export { type T, T };
type T = 1;
export type { T, T };
`,
dependencyConstraints: {
typescript: '4.5',
},
options: [{ fixMixedExportsWithInlineTypeSpecifier: true }],
errors: [
{
Expand All @@ -367,9 +352,6 @@ export {
export type { Type1, Type2 as Foo, value1 as BScope } from './consistent-type-exports';
export { value2 as CScope } from './consistent-type-exports';
`,
dependencyConstraints: {
typescript: '4.5',
},
options: [{ fixMixedExportsWithInlineTypeSpecifier: false }],
errors: [
{
Expand All @@ -396,9 +378,6 @@ export {
value2 as CScope,
} from './consistent-type-exports';
`,
dependencyConstraints: {
typescript: '4.5',
},
options: [{ fixMixedExportsWithInlineTypeSpecifier: true }],
errors: [
{
Expand Down
12 changes: 0 additions & 12 deletions packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts
bradzacher marked this conversation as resolved.
Show resolved Hide resolved
Expand Up @@ -131,9 +131,6 @@ ruleTester.run('consistent-type-imports', rule, {
const a: typeof Type = Type;
`,
options: [{ prefer: 'no-type-imports' }],
dependencyConstraints: {
typescript: '4.5',
},
},
`
import { type A } from 'foo';
Expand Down Expand Up @@ -208,9 +205,6 @@ ruleTester.run('consistent-type-imports', rule, {
const b = B;
`,
options: [{ prefer: 'no-type-imports', fixStyle: 'inline-type-imports' }],
dependencyConstraints: {
typescript: '4.5',
},
},
// exports
`
Expand Down Expand Up @@ -1939,9 +1933,6 @@ import { A, B } from 'foo';
type T = A;
const b = B;
`,
dependencyConstraints: {
typescript: '4.5',
},
options: [{ prefer: 'no-type-imports' }],
errors: [
{
Expand All @@ -1962,9 +1953,6 @@ import { B, type C } from 'foo';
type T = A | C;
const b = B;
`,
dependencyConstraints: {
typescript: '4.5',
},
options: [{ prefer: 'type-imports' }],
errors: [
{
Expand Down
27 changes: 0 additions & 27 deletions packages/eslint-plugin/tests/rules/member-ordering.test.ts
Expand Up @@ -30,9 +30,6 @@ interface Foo {
}
`,
{
dependencyConstraints: {
typescript: '4.5',
},
code: `
// no accessibility === public
interface Foo {
Expand Down Expand Up @@ -1313,9 +1310,6 @@ class Foo {
f = 1;
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [{ default: ['static-initialization', 'method', 'field'] }],
},
{
Expand All @@ -1326,9 +1320,6 @@ class Foo {
static {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [{ default: ['method', 'field', 'static-initialization'] }],
},
{
Expand All @@ -1339,9 +1330,6 @@ class Foo {
m() {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [{ default: ['field', 'static-initialization', 'method'] }],
},
`
Expand Down Expand Up @@ -4675,9 +4663,6 @@ class Foo {
f = 1;
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [{ default: ['method', 'field', 'static-initialization'] }],
errors: [
{
Expand Down Expand Up @@ -4708,9 +4693,6 @@ class Foo {
static {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [{ default: ['static-initialization', 'method', 'field'] }],
errors: [
{
Expand All @@ -4732,9 +4714,6 @@ class Foo {
m() {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [{ default: ['static-initialization', 'field', 'method'] }],
errors: [
{
Expand All @@ -4756,9 +4735,6 @@ class Foo {
m() {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [{ default: ['field', 'static-initialization', 'method'] }],
errors: [
{
Expand All @@ -4782,9 +4758,6 @@ class Foo {
md() {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [
{ default: ['decorated-method', 'static-initialization', 'method'] },
],
Expand Down
Expand Up @@ -500,9 +500,6 @@ class Foo {
static {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [
{
default: {
Expand Down
Expand Up @@ -1695,9 +1695,6 @@ class Foo {
static {}
}
`,
dependencyConstraints: {
typescript: '4.4',
},
options: [
{
default: {
Expand Down