Skip to content

Commit 859c7ab

Browse files
authoredSep 28, 2024··
Merge pull request #15 from NeuralEmpowerment/fix/typescript-linter-240927
2 parents d701e2c + 7a1cb80 commit 859c7ab

File tree

5 files changed

+161
-7
lines changed

5 files changed

+161
-7
lines changed
 

‎CODING-ASSISTANT-PROMPT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ Follow these guidelines:
4747

4848
10. Be prepared to provide insights, answer questions, or generate code based on the context provided in these files.
4949

50-
11. If you encounter a siutation where the .context.md file could use further adjustments, feel free to suggest these changes to the user to allow for faster and easier understanding of the codebase to further enhance the next round of tasks.
50+
11. If you encounter a situation where the .context.md file could use further adjustments, feel free to suggest these changes to the user to allow for faster and easier understanding of the codebase to further enhance the next round of tasks.
5151

5252
Remember, the Codebase Context Specification is designed to enhance AI-assisted development. Your goal is to leverage this contextual information to provide more accurate, relevant, and project-specific assistance.

‎linters/typescript/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# History
2+
.history
3+
14
# Dependency directories
25
node_modules/
36

‎linters/typescript/package-lock.json

+152-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎linters/typescript/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"codebase-context-lint": "./dist/cli.js"
88
},
99
"scripts": {
10+
"dev": "ts-node src/cli.ts",
1011
"build": "tsc",
1112
"start": "node dist/cli.js",
1213
"lint": "node dist/cli.js",
@@ -42,6 +43,7 @@
4243
"jest": "^29.7.0",
4344
"semantic-release": "^22.0.12",
4445
"ts-jest": "^29.1.2",
46+
"ts-node": "^10.9.2",
4547
"typescript": "^5.6.2"
4648
},
4749
"dependencies": {

‎linters/typescript/src/contextignore_linter.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ export class ContextignoreLinter {
161161
*/
162162
public isIgnored(filePath: string, relativeTo: string): boolean {
163163
try {
164-
const directoryPath = path.dirname(filePath);
165-
let currentDir = directoryPath;
164+
let currentDir = path.dirname(filePath);
166165

167166
// Traverse up the directory tree to find the nearest .contextignore file
168-
while (currentDir.length >= relativeTo.length) {
167+
do {
169168
const ig = this.ignoreCache.get(currentDir);
170169
if (ig) {
171170
const relativeFilePath = path.relative(currentDir, filePath);
@@ -174,7 +173,7 @@ export class ContextignoreLinter {
174173
return ignored;
175174
}
176175
currentDir = path.dirname(currentDir);
177-
}
176+
} while (currentDir.length >= relativeTo.length && currentDir !== path.dirname(currentDir));
178177

179178
this.log(LogLevel.DEBUG, `File ${filePath} is not ignored (no .contextignore found)`);
180179
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.