learning_ai_common_plat/eslint.config.js
saravanakumardb1 1bce981f43 feat(client-encrypt): create @bytelyst/client-encrypt — Web Crypto API encryption
- AES-256-GCM via SubtleCrypto (browsers + React Native with polyfill)
- Wire-compatible EncryptedField with @bytelyst/field-encrypt (server) and
  BLFieldEncrypt (Swift/Kotlin native SDKs)
- encryptField, decryptField, generateKey, keyFromHex, keyToHex
- PBKDF2 key derivation (600k iterations per OWASP 2023)
- isEncryptedField type guard, toHex/fromHex helpers
- 22 Vitest tests, all passing
- Add Web Crypto globals to root ESLint config
2026-03-21 11:15:27 -07:00

101 lines
2.8 KiB
JavaScript

import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
export default [
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'*.config.js',
'*.config.ts',
'**/dist/**',
'__LOCAL_LLMs/**',
],
},
js.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
// project: true, // Disabled for now
},
globals: {
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
Headers: 'readonly',
TextEncoder: 'readonly',
TextDecoder: 'readonly',
RequestInit: 'readonly',
HeadersInit: 'readonly',
Response: 'readonly',
Request: 'readonly',
fetch: 'readonly',
console: 'readonly',
performance: 'readonly',
AbortSignal: 'readonly',
AbortController: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
navigator: 'readonly',
document: 'readonly',
window: 'readonly',
expect: 'readonly',
describe: 'readonly',
it: 'readonly',
test: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
crypto: 'readonly',
CryptoKey: 'readonly',
SubtleCrypto: 'readonly',
AesGcmParams: 'readonly',
Crypto: 'readonly',
ArrayBufferView: 'readonly',
Blob: 'readonly',
File: 'readonly',
FormData: 'readonly',
URLSearchParams: 'readonly',
URL: 'readonly',
BodyInit: 'readonly',
ReadableStream: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly',
ReactNode: 'readonly',
React: 'readonly',
JSX: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
// TypeScript specific rules
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
// General rules
'no-console': 'warn',
'no-debugger': 'error',
'prefer-const': 'error',
'no-var': 'error',
'no-unused-vars': 'off', // Use TypeScript version
// Import rules - disabled for now
// 'sort-imports': ['error', { ignoreDeclarationSort: true }],
},
},
];