From 00abf3a381c72d35ea11361bbce94476d36e0bcb Mon Sep 17 00:00:00 2001 From: hazre Date: Tue, 14 Apr 2026 20:34:34 +0200 Subject: [PATCH] chore: enforce typescript-only app sources --- eslint.config.js | 20 ++++++++++++++++++++ knip.json | 8 +------- tsconfig.web.json | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index f7cf561c8..bb6e37e4e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -221,6 +221,26 @@ const projectOverrides = defineConfig([ '@typescript-eslint/consistent-type-definitions': 'off', }, }, + { + name: 'project/secret-storage-helpers', + files: ['src/client/secretStorageKeys.ts'], + rules: { + 'no-void': 'off', + }, + }, + { + name: 'project/no-js-in-src', + files: ['src/**/*.{js,jsx}'], + rules: { + 'no-restricted-syntax': [ + 'error', + { + selector: 'Program', + message: 'JavaScript files are not allowed under src. Use TypeScript instead.', + }, + ], + }, + }, ]); export default defineConfig([ diff --git a/knip.json b/knip.json index 6cff9d53b..f1c2ed12d 100644 --- a/knip.json +++ b/knip.json @@ -1,13 +1,7 @@ { "$schema": "https://unpkg.com/knip@5/schema.json", "entry": ["src/sw.ts"], - "ignore": [ - "src/ext.d.ts", - "src/types/matrix-sdk-events.d.ts", - "src/client/secretStorageKeys.d.ts", - "src/app/utils/bgColorImg.d.ts", - "scripts/*" - ], + "ignore": ["src/ext.d.ts", "src/types/matrix-sdk-events.d.ts", "scripts/*"], "ignoreExportsUsedInFile": { "interface": true, "type": true diff --git a/tsconfig.web.json b/tsconfig.web.json index 80d6c8ece..df4b9b311 100644 --- a/tsconfig.web.json +++ b/tsconfig.web.json @@ -46,6 +46,6 @@ "$client/*": ["src/client/*"] } }, - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.js", "src/**/*.jsx"], + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts"], "exclude": ["node_modules", "dist", "coverage"] }