Files
e-tib.com/eslint.config.mjs
Marc Mintel 99b1e7ba43
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
chore: fix eslint config whitespace issue in globals
2026-05-12 11:32:19 +02:00

78 lines
2.2 KiB
JavaScript

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: [
"**/node_modules/**",
"node_modules/**",
"**/.next/**",
".next/**",
"**/dist/**",
"dist/**",
"**/out/**",
"out/**",
"**/.pnpm-store/**",
"**/at-mintel/**",
"at-mintel/**",
"**/.git/**",
"*.js",
"*.mjs",
"*.cjs",
"scripts/**",
"tests/**",
"next-env.d.ts",
"reference/**",
"data/**",
"remotion/**",
"components/record-mode/**"
],
},
...cleanupConfig(baseConfig),
...cleanupConfig(nextConfig).map((config) => ({
...config,
files: ["**/*.{ts,tsx}"],
rules: {
...config.rules,
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-require-imports": "off",
"prefer-const": "warn",
"react/no-unescaped-entities": "off",
"@next/next/no-img-element": "warn",
"react-hooks/set-state-in-effect": "warn"
}
})),
];