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
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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user