ci / build-and-test (push) Canceled after 0s
Pin eslint@9 (jsx-a11y peer) and add eslint-plugin-astro + eslint-plugin-jsx-a11y + typescript-eslint as devDeps. eslint.config.js wires: - @eslint/js recommended and typescript-eslint recommended for general .ts/.mjs. - astro flat/jsx-a11y-recommended for .astro files, registering the jsx-a11y plugin explicitly. - project-specific tweaks: drop jsx-a11y/anchor-is-valid (noisy on Astro links), warn on click-events-have-key-events and no-static-element-interactions, allow any in scripts/tests, ignore env.d.ts triple-slash ref (Astro convention). Scripts: lint and lint:fix. prebuild now also runs lint, so the same chain guards a11y regressions as type and build errors. CI workflow gains a lint step between check and build. 0 errors, 16/16 e2e still pass.
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
import js from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import astro from 'eslint-plugin-astro';
|
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
|
|
export default [
|
|
{
|
|
ignores: ['dist/**', '.astro/**', 'node_modules/**', 'playwright-report/**', 'test-results/**', 'public/**'],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...astro.configs['flat/jsx-a11y-recommended'],
|
|
{
|
|
files: ['**/*.{ts,tsx,js,jsx,mjs}'],
|
|
languageOptions: {
|
|
ecmaVersion: 2024,
|
|
sourceType: 'module',
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.astro'],
|
|
plugins: {
|
|
astro,
|
|
'jsx-a11y': jsxA11y,
|
|
},
|
|
rules: {
|
|
...astro.configs.recommended.rules,
|
|
'jsx-a11y/anchor-is-valid': 'off',
|
|
'jsx-a11y/click-events-have-key-events': 'warn',
|
|
'jsx-a11y/no-static-element-interactions': 'warn',
|
|
},
|
|
},
|
|
{
|
|
files: ['scripts/**/*.{mjs,js}', 'tests/**/*.{ts,mts}'],
|
|
languageOptions: {
|
|
globals: {
|
|
console: 'readonly',
|
|
process: 'readonly',
|
|
Buffer: 'readonly',
|
|
URL: 'readonly',
|
|
},
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['src/env.d.ts'],
|
|
rules: {
|
|
'@typescript-eslint/triple-slash-reference': 'off',
|
|
},
|
|
},
|
|
];
|