-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filterProblemsForDocument() lower-case file paths => breaks diagnostics (OSX) #44
Comments
@danielweck thanks for your proposition. @egamma what do you think about this idea? |
PS:
(works on OSX, untested elsewhere) |
… TypeScript language service, see angelozerr/tslint-language-service#44
@angelozerr fixing a file system case sensitivity issue by calling @danielweck what are the steps to reproduce this problem? |
Sure, create the files below inside a folder called
const txt = 'test'; // TSLINT ERROR (should be double-quotes)
console.log(txt); // TSLINT ERROR (use of console API forbidden)
{
"extends": "tslint:recommended"
}
{
"languageServiceEnabled": true,
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./dist/",
"plugins": [
{
"name": "tslint-language-service",
"alwaysShowRuleFailuresAsWarnings": false,
"ignoreDefinitionFiles": true,
"configFile": "./tslint.json",
"disableNoUnusedVariableRule": true
}
],
"rootDir": "./",
"rootDirs": [
"./"
],
"baseUrl": "."
},
"exclude": [
"node_modules"
],
"include": [
"./*.ts"
]
}
{
"name": "tslint-lang-service-filepath-lowercase-bug",
"version": "0.0.0-alpha0",
"dependencies": {
},
"devDependencies": {
"tslint": "latest",
"tslint-language-service": "latest",
"typescript": "latest"
},
"main": "./index.js",
"types": "./dist/index.d.js",
"bin": {
"index": "./dist/index.js"
},
"files": [
"dist/**/*"
],
"scripts": {
"clean": "rm -rf ./dist",
"lintfix": "sed -i \"\" \"s/let normalizedPath = path\\.normalize(documentPath);/let normalizedPath = path.normalize(documentPath).toLowerCase();/g\" ./node_modules/tslint-language-service/out/src/index.js",
"prelint": "npm run clean",
"lint": "tslint -c \"./tslint.json\" \"./*.ts\"",
"prelint:full": "npm run clean",
"lint:full": "tslint --project \"./tsconfig.json\" -c \"./tslint.json\" \"./*.ts\"",
"pretsc": "npm run clean && npm run lint:full",
"tsc": "tsc -p \"./tsconfig.json\""
}
} |
This is the current code:
https://github.com/angelozerr/tslint-language-service/blob/72a02a2/src/index.ts#L99-L110
The problem is that
let fileName = each.getFileName();
returns lower-case file paths! For example, typically on OSX:/User/myName/etc.
becomes/user/myname/etc.
. No idea why.I temporarily fixed this by adding
.toLowerCase()
:let normalizedPath = path.normalize(documentPath).toLowerCase();
...and just for consistency (not strictly needed):
let fileName = each.getFileName().toLowerCase();
The text was updated successfully, but these errors were encountered: