chore: migrate eslint to flat config

eslint 9 ignores .eslintrc.* by default, so replace .eslintrc.cjs with a
flat eslint.config.mjs (in the style of graycoreio/daffodil)
This commit is contained in:
Damien Retzinger
2026-06-09 17:31:29 -04:00
parent 8a6a886d7e
commit 14a0e38d64
11 changed files with 271 additions and 147 deletions
@@ -4,10 +4,10 @@ import { getIndividualVersionsForProject } from "../versions/get-versions-for-pr
export const getCurrentlySupportedVersions = (project: string, date: Date): string[] => {
const allVersions = getIndividualVersionsForProject(project)
return Object.entries(<Record<string,PackageMatrixVersion>>allVersions)
.filter(([key, value]) => {
.filter(([, value]) => {
const dayOfRelease = new Date(value.release);
dayOfRelease.setSeconds(dayOfRelease.getSeconds() + 1);
return date >= dayOfRelease && new Date(value.eol) >= date;
})
.map(([key, value]) => key);
.map(([key]) => key);
}
+1 -1
View File
@@ -42,5 +42,5 @@ export const getUsableVersions = (project: string): string[] => {
return true;
})
.map(([key, value]) => key);
.map(([key]) => key);
}
+2 -2
View File
@@ -15,7 +15,7 @@ export const getRecentVersions = (project: string, date: Date, durationStr: stri
const allVersions = getIndividualVersionsForProject(project)
return Object.entries(<Record<string,PackageMatrixVersion>>allVersions)
.filter(([key, value]) => {
.filter(([, value]) => {
const dayOfRelease = new Date(value.release);
dayOfRelease.setSeconds(dayOfRelease.getSeconds() + 1);
const dateAfterRelease = new Date(value.release);
@@ -27,5 +27,5 @@ export const getRecentVersions = (project: string, date: Date, durationStr: stri
return date >= dayOfRelease && date <= dateAfterRelease;
})
.map(([key, value]) => key);
.map(([key]) => key);
}
@@ -3,7 +3,7 @@ import { Repository } from "./repository";
/**
* Get the next version of Magento, as determined by the repository.
*/
export const getNextVersion = (repository: Repository, date: Date) => {
export const getNextVersion = (repository: Repository, _date: Date) => {
switch(repository){
case "https://nightly.mage-os.org":
case "https://upstream-nightly.mage-os.org":
+1 -1
View File
@@ -1,4 +1,4 @@
const KNOWN_REPOSITORIES = {
export const KNOWN_REPOSITORIES = {
"https://repo.mage-os.org": true,
"https://nightly.mage-os.org": true,
"https://upstream-mirror.mage-os.org": true,
@@ -1,16 +1,22 @@
import { validateProject } from "../project/validate-projects";
import { PackageMatrixVersion } from "../matrix/matrix-type";
import mageOsIndividual from './mage-os/individual.json';
import mageOsMinimalIndividual from './mage-os-minimal/individual.json';
import magentoOpenSourceIndividual from './magento-open-source/individual.json';
import mageOsComposite from './mage-os/composite.json';
import mageOsMinimalComposite from './mage-os-minimal/composite.json';
import magentoOpenSourceComposite from './magento-open-source/composite.json';
const individual = {
'mage-os': require('./mage-os/individual.json'),
'mage-os-minimal': require('./mage-os-minimal/individual.json'),
'magento-open-source': require('./magento-open-source/individual.json')
const individual = <Record<string, Record<string, PackageMatrixVersion>>><unknown>{
'mage-os': mageOsIndividual,
'mage-os-minimal': mageOsMinimalIndividual,
'magento-open-source': magentoOpenSourceIndividual
}
const composite = {
'mage-os': require('./mage-os/composite.json'),
'mage-os-minimal': require('./mage-os-minimal/composite.json'),
'magento-open-source': require('./magento-open-source/composite.json')
const composite = <Record<string, Record<string, PackageMatrixVersion>>><unknown>{
'mage-os': mageOsComposite,
'mage-os-minimal': mageOsMinimalComposite,
'magento-open-source': magentoOpenSourceComposite
}
export const getIndividualVersionsForProject = (project: string): Record<string, PackageMatrixVersion> => {
@@ -20,7 +26,7 @@ export const getIndividualVersionsForProject = (project: string): Record<string,
`Project "${project}" has no individual version specifications`
)
}
return individual[project]
}
@@ -33,4 +39,4 @@ export const getCompositeVersionsForProject = (project: string): Record<string,
}
return composite[project]
}
}