Files
shared/eslint.config.js
T
Gabriel20xx 22887fef03 ci: expand CI checks and make consumer sync opt-in
- Add Go, npm, Python, and Java validation to CI
- Run Go tests against PostgreSQL
- Record performance fixes in the report
2026-10-19 21:14:31 +00:00

59 lines
2.0 KiB
JavaScript

import js from '@eslint/js';
import { defineConfig, globalIgnores } from 'eslint/config';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import tseslint from 'typescript-eslint';
// An unused binding is fine when its name starts with an underscore (a prop or argument kept for
// its position or its documentation).
const unusedUnderscore = [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
];
// Lints the JavaScript, TypeScript and Svelte first-party code. The Go, Python and Java packages
// have their own linters (gofmt and go vet, ruff), and generated output is never linted.
export default defineConfig([
globalIgnores([
'**/dist/**',
'**/.svelte-kit/**',
'**/node_modules/**',
'backend/**',
'contract/**',
'packages/java-backend/**',
'packages/python-backend/**',
'shared-styles.css',
]),
js.configs.recommended,
{ rules: { 'no-unused-vars': unusedUnderscore } },
{
files: ['**/*.ts', '**/*.svelte'],
extends: [tseslint.configs.recommended],
rules: { 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': unusedUnderscore },
},
svelte.configs.recommended,
{
files: ['packages/node-backend/**/*.js', 'scripts/**/*.{js,mjs}', 'eslint.config.js'],
languageOptions: { globals: globals.node },
},
{
files: ['packages/web-ui/**/*.{ts,svelte}'],
languageOptions: { globals: globals.browser },
},
{
files: ['**/*.svelte', '**/*.svelte.ts'],
languageOptions: { parserOptions: { parser: tseslint.parser } },
},
{
// These three Svelte rules ask for changes to how shipped components render or hold state
// (keyed each blocks, derived state, reactive Map and Set). That changes consumer-visible
// behaviour, so it is a decision for a component change, not for the lint set-up.
files: ['packages/web-ui/**/*.{ts,svelte}'],
rules: {
'svelte/require-each-key': 'off',
'svelte/prefer-writable-derived': 'off',
'svelte/prefer-svelte-reactivity': 'off',
},
},
]);