Skip to content

Commit 6ea5648

Browse files
authored
Merge pull request #6 from goobits/claude/lint-build-strict-uvwTr
Enforce strict TypeScript and improve code quality
2 parents 97c8556 + f47cbdb commit 6ea5648

55 files changed

Lines changed: 774 additions & 604 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ docs/
4545
New to docs-engine? Start here:
4646

4747
- **[Getting Started](./getting-started.md)** - 5-minute setup guide
48-
- **[Installation](../README.md#installation)** - Package installation
48+
- **[Quick Start](../README.md#quick-start)** - Package installation
4949

5050
## Architecture Overview
5151

eslint.config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,19 @@ export default [
4747
'no-implied-eval': 'error',
4848
'no-new-func': 'error',
4949

50-
// Code quality
51-
'@typescript-eslint/explicit-function-return-type': 'warn',
50+
// Code quality - STRICT mode
51+
'@typescript-eslint/explicit-function-return-type': 'error',
5252
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
53-
'@typescript-eslint/no-explicit-any': 'warn',
53+
'@typescript-eslint/no-explicit-any': 'error',
54+
'@typescript-eslint/no-non-null-assertion': 'warn',
55+
56+
// Security rules - adjust for intentional patterns
57+
// Object injection is safe when using typed objects with validated keys
58+
'security/detect-object-injection': 'off',
59+
// Non-literal regexp is intentional for search functionality
60+
'security/detect-non-literal-regexp': 'off',
61+
// Unsafe regex - we'll fix specific cases manually
62+
'security/detect-unsafe-regex': 'warn',
5463
},
5564
},
5665
{

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
}
9494
},
9595
"optionalDependencies": {
96+
"@rollup/rollup-linux-arm64-gnu": "4.57.0",
9697
"chokidar": "^5.0.0",
97-
"playwright": "^1.58.0",
98-
"@rollup/rollup-linux-arm64-gnu": "4.53.2"
98+
"playwright": "^1.58.0"
9999
},
100100
"keywords": [
101101
"sveltekit",
@@ -132,9 +132,8 @@
132132
"devDependencies": {
133133
"@eslint/js": "^9.39.2",
134134
"@testing-library/svelte": "^5.3.1",
135-
"@types/dompurify": "^3.2.0",
136135
"@types/mdast": "^4.0.4",
137-
"@types/node": "^25.0.10",
136+
"@types/node": "^25.1.0",
138137
"@types/unist": "^3.0.3",
139138
"@typescript-eslint/eslint-plugin": "^8.54.0",
140139
"@typescript-eslint/parser": "^8.54.0",
@@ -144,14 +143,14 @@
144143
"eslint-config-prettier": "^10.1.8",
145144
"eslint-plugin-security": "^3.0.1",
146145
"eslint-plugin-svelte": "^3.14.0",
147-
"happy-dom": "^20.3.9",
146+
"happy-dom": "^20.4.0",
148147
"husky": "^9.1.7",
149148
"jscpd": "^4.0.7",
150149
"lint-staged": "^16.2.7",
151150
"madge": "^8.0.0",
152151
"prettier": "^3.8.1",
153152
"prettier-plugin-svelte": "^3.4.1",
154-
"svelte": "^5.48.2",
153+
"svelte": "^5.48.5",
155154
"svelte-eslint-parser": "^1.4.1",
156155
"ts-morph": "^27.0.2",
157156
"tsup": "^8.5.1",

packages/docs-engine-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"p-limit": "^7.2.0"
3232
},
3333
"devDependencies": {
34-
"@types/node": "^25.0.10",
34+
"@types/node": "^25.1.0",
3535
"@types/prompts": "^2.4.9",
3636
"tsup": "^8.5.1",
3737
"typescript": "^5.9.3"

packages/docs-engine-cli/src/link-checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ async function checkExternalLink(
282282
cache: Map<string, LinkCheckResult>
283283
): Promise<LinkCheckResult> {
284284
// Check cache first
285-
if (cache.has(link.url)) {
286-
const cached = cache.get(link.url)!;
285+
const cached = cache.get(link.url);
286+
if (cached) {
287287
return { ...cached, link };
288288
}
289289

packages/docs-engine-cli/src/link-extractor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ export function extractLinksFromFile(filePath: string): ExtractedLink[] {
114114
});
115115

116116
// Extract HTML links (basic regex for <a href="">)
117-
const htmlLinkRegex = /<a\s+(?:[^>]*?\s+)?href=["']([^"']+)["']/gi;
117+
// Use [^>]*? without nested \s+ to avoid catastrophic backtracking
118+
const htmlLinkRegex = /<a\s[^>]*?href=["']([^"']+)["']/gi;
118119
const lines = content.split('\n');
119120

120121
lines.forEach((lineContent, index) => {

0 commit comments

Comments
 (0)