Skip to content
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

fix: Change comment node type to "Block" to match spaced-comment eslint rule prerequisites #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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