Migrate ESLint config from .eslintrc.json to flat config (eslint.conf…#5161
Open
JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
Open
Migrate ESLint config from .eslintrc.json to flat config (eslint.conf…#5161JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
Conversation
…ig.mjs) and fix Windows path resolution in custom lint plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Fixes #5056
Description
This PR migrates the ESLint configuration from the legacy
.eslintrc.jsonformat to the new flat config format (eslint.config.mjs).ESLint 9 introduced flat config files as the new default, and ESLint 10 will remove
.eslintrc.jsonsupport entirely (see ESLint 10 announcement). This PR proactively converts our configuration to ensure future compatibility.Additionally, this PR fixes Windows path resolution issues in the custom DSpace ESLint plugins (
theme-support.tsandtypescript.ts) whereglobSyncresults and file paths were not being normalized to Unix-style paths, causing 8 test failures on Windows.Instructions for Reviewers
npm installto install new dependencies (@eslint/js,typescript-eslint,angular-eslint)npm run build:lintto compile custom ESLint pluginsnpm run test:lint:nobuildto verify all 169 custom rule tests passnpm run lint:nobuildto verify linting works with the new flat configng lint --fix=trueto verify autofix still worksList of changes in this PR
.eslintrc.json(legacy format)eslint.config.mjs(flat config format) with all existing rules preserved@eslint/js,typescript-eslint, andangular-eslintdevDependencies for flat config helperslint/src/util/theme-support.ts(globSyncresults andgetFileTheme())lint/src/util/typescript.ts(fromSrc())Checklist
mainbranch of codenpm run lintpackage.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.