Migrate ESLint config from .eslintrc.json to flat config#5346
Migrate ESLint config from .eslintrc.json to flat config#5346oscar-escire wants to merge 4 commits into
Conversation
|
Hi @oscar-escire, |
# Conflicts: # .eslintrc.json # package-lock.json # package.json
|
Hi @oscar-escire, |
1 similar comment
|
Hi @oscar-escire, |
# Conflicts: # package-lock.json # package.json
|
Hi @oscar-escire, |
| 'no-console': [ | ||
| 'error', | ||
| { | ||
| 'allow': [ | ||
| 'log', |
There was a problem hiding this comment.
In the previous .eslintrc.json, the 'log' statement was not allowed, and it looks like this was also introduced by your team in a previous PR 🙂 #5089
Could we keep the same behavior here and remove log from the allow list?
| "plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
| "plugin:@angular-eslint/recommended", | ||
| "plugin:@angular-eslint/template/process-inline-templates", | ||
| "plugin:@smarttools/rxjs/recommended-legacy" |
There was a problem hiding this comment.
This one (@smarttools/rxjs/recommended-legacy) was also not migrated, could you ensure it's included in the new config so we keep the same linting behavior as before?
|
Apart from my previous few comments, I completed the steps listed under the 'Instructions for Reviewers', confirming that:
Everything else looks good, and the Windows path normalization fixes are a great addition, they should help ensure the linting behaves consistently across platforms |
References
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 code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.