@vizzly-testing/vitest
Version:
Drop-in replacement for Vitest visual testing - powered by Vizzly
93 lines (91 loc) • 2.38 kB
JavaScript
import js from '@eslint/js';
import prettier from 'eslint-plugin-prettier';
import configPrettier from 'eslint-config-prettier';
export default [
// Global ignores
{
ignores: ['node_modules/', 'dist/', 'build/']
},
// Source files
{
files: ['src/**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
process: 'readonly',
__dirname: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
clearTimeout: 'readonly',
Buffer: 'readonly',
fetch: 'readonly',
FormData: 'readonly',
AbortController: 'readonly',
URL: 'readonly',
// Vite define placeholders
__VIZZLY_SERVER_URL__: 'readonly',
__VIZZLY_BUILD_ID__: 'readonly'
}
},
plugins: {
prettier
},
rules: {
...js.configs.recommended.rules,
...configPrettier.rules,
'no-console': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'prettier/prettier': 'error'
}
},
// Test files
{
files: ['tests/**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
process: 'readonly',
__dirname: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
clearTimeout: 'readonly',
Buffer: 'readonly',
fetch: 'readonly',
FormData: 'readonly',
AbortController: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
// Browser globals for Vitest browser mode
document: 'readonly',
window: 'readonly',
navigator: 'readonly',
// Vitest globals
describe: 'readonly',
it: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
vi: 'readonly',
test: 'readonly'
}
},
plugins: {
prettier
},
rules: {
...js.configs.recommended.rules,
...configPrettier.rules,
'no-console': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'prettier/prettier': 'error'
}
}
];