Skip to content

Commit 141eab3

Browse files
authored
docs: Publish v9.18.0 release highlights (#684)
* docs: Publish v9.18.0 release highlights * use `/head/` link for TS config files docs * minor adjustments * fix
1 parent d431bc6 commit 141eab3

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

src/content/blog/2025-01-10-eslint-v9.18.0-released.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ layout: post
33
title: ESLint v9.18.0 released
44
teaser: "We just pushed ESLint v9.18.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release."
55
image: release-notes-minor.png
6-
draft: true
76
authors:
8-
- eslintbot
7+
- fasttime
98
categories:
109
- Release Notes
1110
tags:
@@ -17,6 +16,59 @@ tags:
1716

1817

1918

19+
## Highlights
20+
21+
### Stable TypeScript configuration file support
22+
23+
In August of the previous year, ESLint launched support for TypeScript configuration files as an experimental feature.
24+
In order to use a TypeScript configuration file like `eslint.config.ts`, users had to specify the `unstable_ts_config` flag in the command line, e.g.
25+
26+
```shell
27+
npx eslint --flag unstable_ts_config
28+
```
29+
30+
Following an experimental period of several months, during which there were no specific complaints and only minor adjustments, we have made the decision to officially implement support for TypeScript configuration files as a stable feature.
31+
Starting with ESLint v9.18.0, TypeScript configuration files with extensions `.ts`, `.mts` and `.cts` can be used like regular JavaScript configuration files.
32+
If you are upgrading from a previous version of ESLint, be sure to remove the `unstable_ts_config` flag from the command.
33+
34+
Note that in order to use a TypeScript configuration file in Node.js, you still need to have [jiti](https://www.npmjs.com/package/jiti) installed in version 2.0 or higher.
35+
For Deno and Bun, no additional dependency is necessary.
36+
See the documentation about [TypeScript Configuration Files](https://eslint.org/docs/head/use/configure/configuration-files#typescript-configuration-files) for more information about this feature.
37+
38+
### `no-shadow-restricted-names` checks imports and class names
39+
40+
The [`no-shadow-restricted-names`](https://eslint.org/docs/latest/rules/no-shadow-restricted-names) rule will now check for restricted names also in import declarations and in class names, for example:
41+
42+
```js
43+
import undefined from "foo";
44+
45+
class NaN {}
46+
```
47+
48+
[**Playground Link**](https://eslint.org/play/#eyJ0ZXh0IjoiLyplc2xpbnQgbm8tc2hhZG93LXJlc3RyaWN0ZWQtbmFtZXM6IFwiZXJyb3JcIiovXG5cbmltcG9ydCB1bmRlZmluZWQgZnJvbSBcImZvb1wiO1xuXG5jbGFzcyBOYU4ge30iLCJvcHRpb25zIjp7InJ1bGVzIjp7fSwibGFuZ3VhZ2VPcHRpb25zIjp7InBhcnNlck9wdGlvbnMiOnsiZWNtYUZlYXR1cmVzIjp7fX19fX0=)
49+
50+
This rule was added in ESLint v0.1.4 to report on variables and functions with names that could be confusing to developers like `NaN` or `undefined`.
51+
As JavaScript evolved, new syntactic constructs were introduced that could accept the same problematic names.
52+
These newer cases are now detected and reported by the rule.
53+
54+
### Allowed method names in `no-config` problems
55+
56+
The [`no-console-rule`](https://eslint.org/docs/latest/rules/no-console) has been updated to indicate the name of methods that are explicitly configured as allowed when reporting a problem.
57+
This can help developers to find an acceptable alternative to problem reported by this rule.
58+
59+
Consider the following case where `no-console` is configured to allow only the `warn` and `error` methods.
60+
61+
```js
62+
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
63+
64+
console.log("Some text.");
65+
```
66+
67+
Previously, the rule would report a problem with the generic message "Unexpected console statement."
68+
In ESLint v9.18.0, the message reads "Unexpected console statement. Only these console methods are allowed: warn, error."
69+
70+
[**Playground Link**](https://eslint.org/play/#eyJ0ZXh0IjoiLyogZXNsaW50IG5vLWNvbnNvbGU6IFtcImVycm9yXCIsIHsgYWxsb3c6IFtcIndhcm5cIiwgXCJlcnJvclwiXSB9XSAqL1xuXG5jb25zb2xlLmxvZyhcIlNvbWUgdGV4dC5cIik7Iiwib3B0aW9ucyI6eyJydWxlcyI6e30sImxhbmd1YWdlT3B0aW9ucyI6eyJzb3VyY2VUeXBlIjoibW9kdWxlIiwicGFyc2VyT3B0aW9ucyI6eyJlY21hRmVhdHVyZXMiOnt9fX19fQ==)
71+
2072

2173

2274
## Features

0 commit comments

Comments
 (0)