**Motivations:** - Résoudre erreur "No UTXO large enough" en combinant plusieurs petits UTXOs - Refactorer api-relay avec interface StorageServiceInterface pour meilleure abstraction - Ajouter script restart-bitcoind.sh **Root causes:** - api-anchorage: logique cherchait uniquement un UTXO assez grand, ne combinait pas plusieurs petits UTXOs - api-relay: code dupliqué entre StorageService et DatabaseStorageService **Correctifs:** - api-anchorage: combinaison automatique de plusieurs petits UTXOs si aucun assez grand, ajustement frais pour inputs multiples, limite 20 UTXOs, gestion cohérente verrouillage/déverrouillage **Evolutions:** - api-relay: StorageServiceInterface (abstraction commune), refactoring routes (keys, messages, signatures, metrics, bloom) pour utiliser interface, eslint config, package updates - fixKnowledge: api-anchorage-combine-utxos.md (documentation correction) - restart-bitcoind.sh: script redémarrage bitcoind **Pages affectées:** - api-anchorage: bitcoin-rpc.js - api-relay: eslint.config.mjs, package.json, index.ts, middleware/auth.ts, routes (bloom, keys, messages, metrics, signatures), services (apiKeyService, database, relay, storageAdapter, storageInterface) - fixKnowledge: api-anchorage-combine-utxos.md - restart-bitcoind.sh
54 lines
1.7 KiB
JavaScript
54 lines
1.7 KiB
JavaScript
import js from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ['dist', 'node_modules'],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ['**/*.ts'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
},
|
|
},
|
|
plugins: {
|
|
'unused-imports': unusedImports,
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'unused-imports/no-unused-imports': 'error',
|
|
'unused-imports/no-unused-vars': [
|
|
'error',
|
|
{
|
|
vars: 'all',
|
|
varsIgnorePattern: '^_',
|
|
args: 'after-used',
|
|
argsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'max-lines': ['error', { max: 250, skipBlankLines: true, skipComments: true }],
|
|
'max-lines-per-function': ['error', { max: 40, skipBlankLines: true, skipComments: true }],
|
|
'max-params': ['error', 4],
|
|
'max-depth': ['error', 4],
|
|
complexity: ['error', 10],
|
|
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
'@typescript-eslint/no-misused-promises': 'error',
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
'eqeqeq': ['error', 'always'],
|
|
'curly': ['error', 'all'],
|
|
'no-else-return': 'error',
|
|
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
},
|
|
},
|
|
);
|