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 baseConfig from "@mintel/eslint-config";
|
||||||
import { nextConfig } from "@mintel/eslint-config/next";
|
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 [
|
export default [
|
||||||
{
|
{
|
||||||
ignores: [
|
ignores: [
|
||||||
@@ -29,8 +53,8 @@ export default [
|
|||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
...baseConfig,
|
...cleanupConfig(baseConfig),
|
||||||
...nextConfig.map((config) => ({
|
...cleanupConfig(nextConfig).map((config) => ({
|
||||||
...config,
|
...config,
|
||||||
files: ["**/*.{ts,tsx}"],
|
files: ["**/*.{ts,tsx}"],
|
||||||
rules: {
|
rules: {
|
||||||
|
|||||||
Reference in New Issue
Block a user