-
Notifications
You must be signed in to change notification settings - Fork 101
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
[minor] Update to flat eslint config files per requirements of eslint v9 #917
Conversation
@millerds, we talk about the Office JS linter here: https://learn.microsoft.com/en-us/office/dev/add-ins/overview/set-up-your-dev-environment?tabs=yeomangenerator#install-and-use-the-office-javascript-linter. Does this mean we'll need to change the instructions around editing .eslintrc.json? |
Yes . . . the new version of the lint package will use eslint v9 and will require a eslint.config.js file (or .mjs if they want to use modern syntax) with a different syntax. The new js file will look something like this: const officeAddins = require("eslint-plugin-office-addins");
const officeAddins = require("eslint-plugin-office-addins");
const tsParser = require("@typescript-eslint/parser"); // for typescript
const tseslint = require("typescript-eslint"); // for typescript
export default [
...tseslint.configs.recommended, // for typescript
...officeAddins.configs.recommended,
{
plugins: {
"office-addins": officeAddins,
},
languageOptions: {
parser: tsParser, // for typescript
},
},
]; |
Thanks @millerds! I created a PR to update the docs based on this work: OfficeDev/office-js-docs-pr#5006. Please let me know if I misinterpreted something. |
Change Description:
Recent change to the repo updated to eslint v9 which requires using eslint.config.mjs (aka flat config) instead of .eslintrc.json configuration files. This also triggered some formatting changes to various code files in the different packages.
Note . . . there are many changed files, but functionally there should be no change except for the office-addin-lint package using the new config files in its cli and the eslint-plugin-office-addin exporting the new config style.
Do these changes impact command syntax of any of the packages? (e.g., add/remove command, add/remove a command parameter, or update required parameters)
No.
Do these changes impact documentation? (e.g., a tutorial on https://learn.microsoft.com/office/dev/add-ins/overview/office-add-ins)
Maybe. I'm not sure how much the documentation talks about linting configuration.
If you answered yes to any of these please do the following:
> Include 'Rick-Kirkham' in the review
> Make sure the README file is correct
Validation/testing performed:
Ran automated tests and used locally created packages on test add-in project to confirm usability.