Skip to content

Commit 245808c

Browse files
authored
[all hosts] (Developer Experience) Adjust lint configuration for eslint v9 (#5006)
* Adjust lint configuration for eslint v9 * Correct terminology around plugins object
1 parent dade65a commit 245808c

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

docs/overview/set-up-your-dev-environment.md

+20-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Set up your development environment
33
description: Set up your developer environment to build Office Add-ins.
4-
ms.date: 12/12/2024
4+
ms.date: 01/27/2025
55
ms.topic: install-set-up-deploy
66
ms.localizationpriority: medium
77
---
@@ -70,17 +70,25 @@ If you created your project manually, install and configure the linter with the
7070
npm install eslint-plugin-office-addins --save-dev
7171
```
7272

73-
1. In the root of the project, create a text file named **.eslintrc.json**, if there isn't one already there. Be sure it has properties named `plugins` and `extends`, both of type array. The `plugins` array should include `"office-addins"` and the `extends` array should include `"plugin:office-addins/recommended"`. The following is a simple example. Your **.eslintrc.json** file may have additional properties and additional members of the two arrays.
74-
75-
```json
76-
{
77-
"plugins": [
78-
"office-addins"
79-
],
80-
"extends": [
81-
"plugin:office-addins/recommended"
82-
]
83-
}
73+
1. In the root of the project, create a text file named **eslint.config.js** (or **.mjs**), if there isn't one already there. Be sure to inherit the recommended configuration for `eslint-plugin-office-addins`. The `plugins` object should include a mapping to the `eslint-plugin-office-addins` plugin object. The following is a simple example that includes settings for TypeScript. Your **eslint.config.js** file may have additional properties and configurations.
74+
75+
```js
76+
const officeAddins = require("eslint-plugin-office-addins");
77+
const tsParser = require("@typescript-eslint/parser");
78+
const tsEsLint = require("typescript-eslint");
79+
80+
export default [
81+
...tsEsLint.configs.recommended,
82+
...officeAddins.configs.recommended,
83+
{
84+
plugins: {
85+
"office-addins": officeAddins,
86+
},
87+
languageOptions: {
88+
parser: tsParser,
89+
},
90+
},
91+
];
8492
```
8593

8694
1. In the root of the project, open the **package.json** file and be sure that the `scripts` array has the following member.

0 commit comments

Comments
 (0)