**Motivations:** - Add new features and fixes for userwallet application - Update documentation for pairing, login state machine, and sync - Add new utilities for bloom filters, nonce store, and contract versioning - Fix mempool websocket offline issues **Root causes:** - N/A (feature additions and improvements) **Correctifs:** - Fix mempool websocket offline handling - Update ESLint configuration **Evolutions:** - Add login state machine service and hook - Add sync loop service - Add bloom filter utilities for anti-replay and state visibility - Add nonce store and contract version utilities - Update pairing confirmation and graph resolver services - Add new documentation for features and fixes - Update userwallet components (LoginScreen, SyncScreen) - Update types for contract, identity, and messages **Pages affectées:** - userwallet/src/components/LoginScreen.tsx - userwallet/src/components/SyncScreen.tsx - userwallet/src/hooks/useChannel.ts - userwallet/src/hooks/useLoginStateMachine.ts (new) - userwallet/src/services/graphResolver.ts - userwallet/src/services/pairingConfirm.ts - userwallet/src/services/syncService.ts - userwallet/src/services/syncLoop.ts (new) - userwallet/src/services/loginStateMachine.ts (new) - userwallet/src/types/contract.ts - userwallet/src/types/identity.ts - userwallet/src/types/message.ts - userwallet/src/utils/canonical.ts - userwallet/src/utils/identity.ts - userwallet/src/utils/indexedDbStorage.ts - userwallet/src/utils/relay.ts - userwallet/src/utils/verification.ts - userwallet/src/utils/bloom.ts (new) - userwallet/src/utils/contractVersion.ts (new) - userwallet/src/utils/nonceStore.ts (new) - userwallet/eslint.config.mjs - userwallet/package.json - userwallet/package-lock.json - userwallet/docs/synthese.md - userwallet/docs/specs-champs-obligatoires-cnil.md (new) - api-relay/README.md - features/userwallet-pairing-words-only-finalise.md - features/userwallet-anti-rejeu-etats-visibles-bloom.md (new) - features/userwallet-bloom-usage-sync.md (new) - features/userwallet-contrat-login-reste-a-faire.md (new) - features/userwallet-ecrans-login-a-valider.md (new) - features/userwallet-eslint-fix.md (new) - features/userwallet-login-state-machine.md (new) - features/userwallet-validation-conformite.md (new) - fixKnowledge/mempool-websocket-offline-fix.md (new) - mempool (submodule) - hash_list.txt - hash_list_cache.txt
78 lines
2.4 KiB
JavaScript
78 lines
2.4 KiB
JavaScript
import js from '@eslint/js';
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
import tseslint from 'typescript-eslint';
|
|
import react from 'eslint-plugin-react';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ['dist', 'node_modules'],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
plugins: {
|
|
react,
|
|
'react-hooks': reactHooks,
|
|
'unused-imports': unusedImports,
|
|
},
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'module',
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
rules: {
|
|
...react.configs.recommended.rules,
|
|
...reactHooks.configs.recommended.rules,
|
|
'react/react-in-jsx-scope': 'off',
|
|
'react/prop-types': 'off',
|
|
'@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],
|
|
'max-nested-callbacks': ['error', 3],
|
|
'@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'] }],
|
|
},
|
|
},
|
|
);
|