UNPKG

@goldenpath-cloud/frontend-standards

Version:

Golden Path frontend development standards for Svelte 5 with TypeScript, testing, and validation

60 lines (58 loc) 2.28 kB
// Golden Path Standards - Testing Core Standard module.exports = { overrides: [ // E2E Testing Standards (Playwright) { files: ['**/*.spec.{js,ts}', '**/e2e/**/*.{js,ts}', '**/tests/e2e/**/*.{js,ts}'], plugins: ['playwright'], extends: ['plugin:playwright/recommended'], rules: { // Playwright Best Practices (80/20 focus) 'playwright/expect-expect': 'error', 'playwright/max-nested-describe': ['error', { max: 3 }], 'playwright/no-conditional-in-test': 'error', 'playwright/no-focused-test': 'error', 'playwright/no-skipped-test': 'warn', 'playwright/prefer-web-first-assertions': 'error', 'playwright/prefer-to-have-length': 'error', 'playwright/no-page-pause': 'warn', 'playwright/no-element-handle': 'error', 'playwright/prefer-lowercase-title': 'error' } }, // Component Testing Standards (Testing Library) { files: ['**/*.test.{js,ts}', '**/src/**/*.test.{js,ts}', '**/tests/unit/**/*.{js,ts}', '**/tests/integration/**/*.{js,ts}'], plugins: ['testing-library'], rules: { // Testing Library Best Practices (80/20 focus) 'testing-library/await-async-queries': 'error', 'testing-library/no-await-sync-queries': 'error', 'testing-library/no-debugging-utils': 'warn', 'testing-library/prefer-screen-queries': 'error', 'testing-library/prefer-user-event': 'error', 'testing-library/no-container': 'error', 'testing-library/no-node-access': 'error', 'testing-library/prefer-find-by': 'error', 'testing-library/prefer-presence-queries': 'error' } }, // All Test Files General Standards { files: ['**/*.{test,spec}.{js,ts}', '**/tests/**/*.{js,ts}'], env: { jest: true, node: true }, rules: { // General Testing Standards 'no-console': 'off', // Allow console in tests for debugging '@typescript-eslint/no-explicit-any': 'off', // More flexible in tests '@typescript-eslint/no-non-null-assertion': 'off', // Allow ! in tests // Encourage good test practices 'prefer-const': 'error', 'no-var': 'error' } } ] }