- Set up Vitest for unit testing with jsdom - Add test setup with Web Audio API and requestAnimationFrame mocks - Create initial test suites for DOM and animations modules - Add test scripts to package.json (test, test:ui, test:run, coverage) - Update CI workflow to include test execution - Create CONTRIBUTING.md with conventional commits guidelines - Create SECURITY.md with security policy - Update ESLint config to support test files - All tests passing (8/8) Co-authored-by: ZaneThePython <102631678+ZaneThePython@users.noreply.github.com>
62 lines
1.3 KiB
JavaScript
62 lines
1.3 KiB
JavaScript
import js from '@eslint/js';
|
|
import html from 'eslint-plugin-html';
|
|
import prettier from 'eslint-config-prettier';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
prettier,
|
|
{
|
|
files: ['**/*.js', '**/*.html'],
|
|
plugins: {
|
|
html,
|
|
},
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
globals: {
|
|
console: 'readonly',
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
navigator: 'readonly',
|
|
requestAnimationFrame: 'readonly',
|
|
setTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearInterval: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
IntersectionObserver: 'readonly',
|
|
__dirname: 'readonly',
|
|
},
|
|
},
|
|
rules: {
|
|
'no-unused-vars': 'warn',
|
|
'no-console': 'off',
|
|
'prefer-const': 'warn',
|
|
'no-var': 'warn',
|
|
},
|
|
},
|
|
{
|
|
files: ['tests/**/*.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
global: 'writable',
|
|
beforeEach: 'readonly',
|
|
describe: 'readonly',
|
|
it: 'readonly',
|
|
expect: 'readonly',
|
|
vi: 'readonly',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'build/**',
|
|
'*.min.js',
|
|
'*.min.css',
|
|
'script.js',
|
|
'styles.css',
|
|
],
|
|
},
|
|
];
|