Skip to content

Commit 5ba6cab

Browse files
committed
fix: Removed old TSTypeAnnotation
1 parent eab20cd commit 5ba6cab

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@loat-dev/lint-plugins",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"license": "./LICENSE",
55
"exports": {
66
"./colon_spacing": "./src/plugins/colon_spacing.ts",

src/plugins/colon_spacing.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,6 @@ const colonSpacing : Deno.lint.Plugin = {
3939
}
4040
}
4141
},
42-
TSTypeAnnotation(node) : void {
43-
if (['FunctionDeclaration', 'FunctionExpression', 'TSPropertySignature', 'PropertyDefinition'].includes(node.parent.type)) {
44-
const text = context.sourceCode.getText(node.parent).substring(
45-
0,
46-
node.range[0] - node.parent.range[0]
47-
);
48-
49-
const index = text.search(/. *$/gm) + 1;
50-
51-
const section : Deno.lint.Range = [
52-
node.parent.range[0] + index,
53-
node.range[0]
54-
]
55-
56-
if (index !== -1 && section[1] - section[0] !== 1) {
57-
context.report({
58-
message: 'Wrong colon spacing. Expected 1 space before colon.',
59-
range: rangePadding(section),
60-
fix(fixer) : Deno.lint.Fix {
61-
return fixer.replaceTextRange(section, ' ');
62-
}
63-
});
64-
}
65-
}
66-
},
6742
Property(node) : void {
6843
if (['ObjectExpression'].includes(node.parent.type)) {
6944

@@ -142,7 +117,3 @@ const colonSpacing : Deno.lint.Plugin = {
142117
};
143118

144119
export default colonSpacing;
145-
146-
function _foo(_e? : string) : void {
147-
148-
}

0 commit comments

Comments
 (0)