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

docs: Publish v9.15.0 release highlights #661

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions src/content/blog/2024-11-15-eslint-v9.15.0-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ layout: post
title: ESLint v9.15.0 released
teaser: "We just pushed ESLint v9.15.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release."
image: release-notes-minor.png
draft: true
authors:
- eslintbot
- mdjermanovic
categories:
- Release Notes
tags:
Expand All @@ -14,7 +13,56 @@ tags:



This release updates the `@eslint/plugin-kit` dependency to the latest version 0.2.3 which includes the fix for security advisory [GHSA-7q7g-4xm8-89cq](https://github.com/eslint/rewrite/security/advisories/GHSA-7q7g-4xm8-89cq).

## Highlights

### `meta.defaultOptions`

Rules can now specify [default options](/docs/latest/extend/custom-rules#option-defaults). ESLint will recursively merge any user-provided options elements on top of the default elements.

This feature makes it easier to work with options in rules.

```js
// my-rule.js
export default {
meta: {
defaultOptions: [{
alias: "basic",
ignoreClassFields: false
}],
schema: [{
type: "object",
properties: {
alias: {
type: "string"
},
ignoreClassFields: {
type: "boolean"
}
},
additionalProperties: false
}]
},
create(context) {

// `context.options` is guaranteed to be an array with a single object
// that has a string property `alias` and a boolean property `ignoreClassFields`.
// If the rule is enabled with no options specified in the configuration file,
// `alias` will be `"basic"`, and `ignoreClassFields` will be `false`.
const [{ alias, ignoreClassFields }] = context.options;

return { /* ... */ };
}
};
```

This feature also allows document generators, other tools and integrations, and end users to easily find the default options for rules.

### Other notable changes

* Custom [languages](/docs/latest/extend/languages) can now provide the `normalizeLanguageOptions(languageOptions)` method. The return value will be used as `languageOptions` when calling `parse()`, `createSourceCode()`, and `applyLanguageOptions()` methods and as the value of `context.languageOptions` property in rules.
* The [`no-useless-computed-key`](/docs/latest/rules/no-useless-computed-key) rule now fully supports object destructuring patterns.



Expand Down