- Remove extensionsToTreatAsEsm from jest.config.js (not needed with type:module) - Add Jest globals to ESLint config (describe, it, expect, etc.) - Fix unnecessary escape characters in debug-token-403.js - Change no-useless-escape from error to warning
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
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',
|
|
// Jest globals
|
|
describe: 'readonly',
|
|
it: 'readonly',
|
|
test: 'readonly',
|
|
expect: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly',
|
|
jest: 'readonly',
|
|
},
|
|
},
|
|
rules: {
|
|
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
'no-console': 'off',
|
|
'no-undef': 'error',
|
|
'no-useless-escape': 'warn',
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'coverage/**',
|
|
'*.config.js',
|
|
],
|
|
},
|
|
];
|