Skip to content

Adopt ESLint 10 / flat config - #1486

Merged
riysaxen-amzn merged 2 commits into
opensearch-project:mainfrom
SuZhou-Joe:eslint-10-flat-config
Jul 15, 2026
Merged

Adopt ESLint 10 / flat config#1486
riysaxen-amzn merged 2 commits into
opensearch-project:mainfrom
SuZhou-Joe:eslint-10-flat-config

Conversation

@SuZhou-Joe

Copy link
Copy Markdown
Member

Description

Migrates the plugin to ESLint 10 flat config. Adds eslint.config.js that spreads @elastic/eslint-config-kibana plus the EUI config (preserving require-license-header off), and removes the legacy .eslintrc. Fixes the lint script in package.json, which used the -c/--ignore-path flags that ESLint 10 removed. Removes the Prettier 2 pin, since Prettier is inherited from OpenSearch Dashboards core.

This is a config-only change; no source files were reformatted.

Issues Resolved

Closes #1485

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Migrate to flat eslint.config.js spreading @elastic/eslint-config-kibana + EUI (preserving require-license-header off). Fix the lint script that used the removed -c/--ignore-path flags. Remove the Prettier 2 pin (inherited from OSD core). Closes opensearch-project#1485

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
@riysaxen-amzn

Copy link
Copy Markdown
Collaborator

Thanks for this @SuZhou-Joe — clean migration overall.

One question: with the old lint script using --ignore-path .gitignore, is there an equivalent ignores array needed in the flat config? Or does ../../scripts/eslint (or the shared OSD config) handle ignoring node_modules, build/, etc. automatically?

Also, 3 of the 17 checks appear to be failing — are those pre-existing/unrelated?

Otherwise LGTM. Config-only change, idiomatic flat config pattern, and the Prettier pin removal makes sense since it's inherited from core.

The previous lint command used `--ignore-path .gitignore`, which ESLint 10
flat config no longer supports. Use @eslint/compat's includeIgnoreFile() to
import the .gitignore patterns as ignores, preserving the prior behavior and
keeping the ignore list in sync with .gitignore.

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
@SuZhou-Joe

Copy link
Copy Markdown
Member Author

with the old lint script using --ignore-path .gitignore, is there an equivalent ignores array needed in the flat config

Thanks for the sharp eyes, I updated the config a little bit to reflect previous ignore behavior.

@SuZhou-Joe

Copy link
Copy Markdown
Member Author

E2E Cypress tests / Run document_level_monitor Cypress tests (pull_request)

It is an existing failure and can be found in other PRs.

Install Dashboards with Plugin via Binary / Run binary installation (ubuntu-latest) (pull_request)

Failed due to not pinned to a commit SHA

Unit tests workflow / Run unit tests (pull_request)

Failed due to yarn not installed, the error can be found in other PRs.

@riysaxen-amzn
riysaxen-amzn merged commit 1cbf315 into opensearch-project:main Jul 15, 2026
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt ESLint 10 / Prettier 3

3 participants