- Add lint, formatting, vet, and publish workflow checks - Run Go database tests with PostgreSQL and add Java tests - Make consumer sync opt-in; update docs and Go dependency
59 lines
2.0 KiB
JavaScript
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',
|
|
},
|
|
},
|
|
]);
|