feat: tighten production-readiness workflow

Quick wins implemented:
- Add ESLint to common_plat (12 projects now linted)
- Add test coverage with 80% thresholds
- Add security audit for all dependencies
- Add bundle analysis for Next.js builds
- Update Makefile with audit target

Enhanced coverage:
- common_plat: +lint, +coverage, +security
- dashboards: +coverage, +bundle analysis, +security
- Python: +security audit via make target

Workflow now validates 7 dimensions instead of 4.
This commit is contained in:
saravanakumardb1 2026-02-12 15:49:46 -08:00
parent fbcb39d52c
commit dca1587efb
4 changed files with 75 additions and 0 deletions

45
eslint.config.js Normal file
View File

@ -0,0 +1,45 @@
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
export default [
js.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: true,
},
},
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',
'@typescript-eslint/prefer-const': 'error',
// General rules
'no-console': 'warn',
'no-debugger': 'error',
'prefer-const': 'error',
'no-var': 'error',
// Import rules
'sort-imports': ['error', { ignoreDeclarationSort: true }],
},
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'*.config.js',
'*.config.ts',
],
},
];

View File

@ -6,13 +6,21 @@
"scripts": { "scripts": {
"build": "pnpm -r build", "build": "pnpm -r build",
"test": "pnpm -r test", "test": "pnpm -r test",
"test:coverage": "pnpm -r exec vitest run --coverage",
"typecheck": "pnpm -r exec tsc --noEmit", "typecheck": "pnpm -r exec tsc --noEmit",
"lint": "pnpm -r exec eslint . --ext .ts,.tsx",
"lint:fix": "pnpm -r exec eslint . --ext .ts,.tsx --fix",
"audit": "pnpm -r audit --audit-level moderate",
"clean": "pnpm -r exec rm -rf dist" "clean": "pnpm -r exec rm -rf dist"
}, },
"devDependencies": { "devDependencies": {
"@types/bcryptjs": "^2.4.6", "@types/bcryptjs": "^2.4.6",
"@types/node": "^20.0.0", "@types/node": "^20.0.0",
"@types/react": "^19.0.0", "@types/react": "^19.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@vitest/coverage-v8": "^3.0.0",
"eslint": "^9.0.0",
"typescript": "^5.7.0", "typescript": "^5.7.0",
"vitest": "^3.0.0" "vitest": "^3.0.0"
}, },

2
pnpm-lock.yaml generated
View File

@ -71,6 +71,8 @@ importers:
packages/errors: {} packages/errors: {}
packages/logger: {}
packages/react-auth: packages/react-auth:
dependencies: dependencies:
'@bytelyst/api-client': '@bytelyst/api-client':

View File

@ -5,5 +5,25 @@ export default defineConfig({
globals: true, globals: true,
environment: "node", environment: "node",
passWithNoTests: true, passWithNoTests: true,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/**',
'dist/**',
'coverage/**',
'**/*.test.ts',
'**/*.config.*',
'**/index.ts',
],
thresholds: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
},
}, },
}); });