Add fetch and timer functions (setTimeout, setInterval, etc.) as global variables in ESLint configuration to fix no-undef errors in scripts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
897 B
JavaScript
42 lines
897 B
JavaScript
import js from '@eslint/js';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
globals: {
|
|
// Node.js globals
|
|
console: 'readonly',
|
|
process: 'readonly',
|
|
Buffer: 'readonly',
|
|
__dirname: 'readonly',
|
|
__filename: 'readonly',
|
|
global: 'readonly',
|
|
module: 'readonly',
|
|
require: 'readonly',
|
|
exports: 'writable',
|
|
fetch: 'readonly',
|
|
setTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
clearInterval: 'readonly',
|
|
},
|
|
},
|
|
rules: {
|
|
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
'no-console': 'off',
|
|
'no-undef': 'error',
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'coverage/**',
|
|
'*.config.js',
|
|
],
|
|
},
|
|
];
|