chore: fix eslint config whitespace issue in globals
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 41s
Build & Deploy / 🧪 QA (push) Failing after 1m27s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s

This commit is contained in:
2026-05-12 11:32:19 +02:00
parent 1971fc54ae
commit 99b1e7ba43

View File

@@ -1,6 +1,30 @@
import baseConfig from "@mintel/eslint-config";
import { nextConfig } from "@mintel/eslint-config/next";
/**
* Cleanup function to fix potential whitespace issues in global keys
* (e.g. "AudioWorkletGlobalScope " bug in some versions of globals/eslint)
*/
function cleanupConfig(configs) {
return configs.map(config => {
if (config.languageOptions && config.languageOptions.globals) {
const cleanGlobals = {};
for (const [key, value] of Object.entries(config.languageOptions.globals)) {
cleanGlobals[key.trim()] = value;
}
// Return a new object to avoid mutating the original if it's reused
return {
...config,
languageOptions: {
...config.languageOptions,
globals: cleanGlobals
}
};
}
return config;
});
}
export default [
{
ignores: [
@@ -29,8 +53,8 @@ export default [
],
},
...baseConfig,
...nextConfig.map((config) => ({
...cleanupConfig(baseConfig),
...cleanupConfig(nextConfig).map((config) => ({
...config,
files: ["**/*.{ts,tsx}"],
rules: {