Skip to content

Commit 365a83e

Browse files
style: lint
1 parent 1072950 commit 365a83e

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/DefinitionProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import {
1515
findImportPath,
1616
genImportRegExp,
1717
getCurrentDirFromUri,
18+
getEOL,
1819
getPosition,
1920
getTransformer,
2021
getWords,
2122
isImportLineMatch,
2223
stringifyClassname,
23-
getEOL,
2424
} from './utils';
2525

2626
export class CSSModulesDefinitionProvider {

src/utils.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,17 @@ export function stringifyClassname(
456456

457457
// https://github.com/wkillerud/some-sass/blob/main/vscode-extension/src/utils/string.ts
458458
export function getEOL(text: string): string {
459-
for (let i = 0; i < text.length; i++) {
460-
const ch = text.charAt(i);
461-
if (ch === "\r") {
462-
if (i + 1 < text.length && text.charAt(i + 1) === "\n") {
463-
return "\r\n";
464-
}
465-
return "\r";
466-
} else if (ch === "\n") {
467-
return "\n";
468-
}
469-
}
470-
return "\n";
459+
for (let i = 0; i < text.length; i++) {
460+
const ch = text.charAt(i);
461+
if (ch === '\r') {
462+
if (i + 1 < text.length && text.charAt(i + 1) === '\n') {
463+
return '\r\n';
464+
}
465+
return '\r';
466+
}
467+
if (ch === '\n') {
468+
return '\n';
469+
}
470+
}
471+
return '\n';
471472
}

0 commit comments

Comments
 (0)