Skip to content

Add ESLint v9 compatibility to eslint-config-fluid #24687

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

import eslint from "@eslint/js";

export default [
eslint.configs.recommended,
{
files: ["*.js"],
rules: {
"no-console": "off"
}
}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "eslint-v9-test",
"version": "1.0.0",
"type": "module",
"private": true
}
7 changes: 7 additions & 0 deletions common/build/eslint-config-fluid/.tmp-eslint-v9-test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// Test file
/* global console */
const test = () => {
console.log("Test function");
};
export default test;
49 changes: 49 additions & 0 deletions common/build/eslint-config-fluid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
# @fluidframework/eslint-config-fluid Changelog

## [6.0.0](https://github.com/microsoft/FluidFramework/releases/tag/eslint-config-fluid_v6.0.0)

### ESLint v9 support

Added support for ESLint v9 through dedicated v9-compatible configurations in flat config format. ESLint v8 configurations remain available with their current paths.

Access the v9-compatible configurations with the `/v9` path segment:

#### For ESLint v8-style Configuration

```js
// .eslintrc.js or .eslintrc.cjs (ESLint v8-style configuration)
module.exports = {
extends: [
require.resolve("@fluidframework/eslint-config-fluid/v9"),
"prettier"
],
// ...
};
```

#### For ESLint v9 Flat Configuration

```js
// eslint.config.js (ESLint v9-style configuration)
import fluidConfig from "@fluidframework/eslint-config-fluid/v9";
import prettierConfig from "eslint-config-prettier";

export default [
...fluidConfig,
...prettierConfig,
// ...your other configuration
];
```

For strict configuration:

```js
// eslint.config.js (ESLint v9-style configuration)
import fluidStrictConfig from "@fluidframework/eslint-config-fluid/v9/strict";
import prettierConfig from "eslint-config-prettier";

export default [
...fluidStrictConfig,
...prettierConfig,
// ...your other configuration
];
```

## [5.7.4](https://github.com/microsoft/FluidFramework/releases/tag/eslint-config-fluid_v5.7.4)

Updates the contexts in which `jsdoc/require-jsdoc` is applied to make it less overzealous.
63 changes: 63 additions & 0 deletions common/build/eslint-config-fluid/README.md
Original file line number Diff line number Diff line change
@@ -30,6 +30,69 @@ A version of the "strict" config that disables rules that are supported by Biome
This config is intended to be used in projects that use both eslint and Biome for linting.
This config is considered experimental.

## ESLint v9 Support

This package also provides ESLint v9 compatible configurations. The v9 configurations are accessible through the `/v9` path segment.

### ESLint v9 Recommended

Imported via `@fluidframework/eslint-config-fluid/v9` (or `@fluidframework/eslint-config-fluid/v9/recommended`).

### ESLint v9 Strict

Imported via `@fluidframework/eslint-config-fluid/v9/strict`.

### ESLint v9 Strict-Biome

Imported via `@fluidframework/eslint-config-fluid/v9/strict-biome`.

## Migrating to ESLint v9

To migrate to ESLint v9, update your ESLint configuration to use the v9 configurations.

### For ESLint v8-style Configuration

```js
// .eslintrc.js or .eslintrc.cjs
module.exports = {
extends: [
require.resolve("@fluidframework/eslint-config-fluid/v9"),
"prettier"
],
// ...rest of your configuration
};
```

### For ESLint v9-style Flat Configuration

ESLint v9 introduces a new flat configuration format. To use the v9 configurations with the new format:

```js
// eslint.config.js (ESLint v9-style configuration)
import fluidConfig from "@fluidframework/eslint-config-fluid/v9";
import prettierConfig from "eslint-config-prettier";

export default [
...fluidConfig,
...prettierConfig,
// ...your other configuration
];
```

You can also use the strict configuration:

```js
// eslint.config.js (ESLint v9-style configuration)
import fluidStrictConfig from "@fluidframework/eslint-config-fluid/v9/strict";
import prettierConfig from "eslint-config-prettier";

export default [
...fluidStrictConfig,
...prettierConfig,
// ...your other configuration
];
```

## Changing the lint config

If you want to change the shared lint config (that is, this package), you need to do the following:
Loading
Oops, something went wrong.