Skip to content

Commit

Permalink
fix: Change comment node type to "Block" to match spaced-comment esli…
Browse files Browse the repository at this point in the history
…nt rule prerequisites
  • Loading branch information
ClementMindflow committed Jun 25, 2021
1 parent c088f6f commit 30ae16d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-plugin/lib/rules/utils/node-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ module.exports = {
* @returns {node is CommentNode} `true` if a node is `CommentNode`, otherwise `false`.
*/
isCommentNode(node) {
return !!(node && node.type === "comment");
return !!(node && node.type === "Block");
},
};
2 changes: 1 addition & 1 deletion packages/eslint-plugin/lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface AttrNode extends BaseNode {
}

export interface CommentNode extends BaseNode {
type: "comment";
type: "Block";
value: string;
startTag?: TagNode;
endTag?: TagNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/lib/postprocessor/postprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = class PostProcessor {

["#comment"](node) {
this.skipCommonProcess = true;
node.type = "comment";
node.type = "Block";
node.startTag = createCommentStartTag(node);
node.endTag = createCommentEndTag(node);
node.value = node.data;
Expand Down

0 comments on commit 30ae16d

Please sign in to comment.