Skip to content

In the case of HTML Paragraph, erroneous detection occurs. #3

@kemsakurai

Description

@kemsakurai

I applied the no-start-duplicated-conjunction rule to the HTML file.
The following Lint error occurred, but I think that this error is a false detection.

  916:1011  error    Don't repeat "</p>" in 2 phrases    no-start-duplicated-conjunction

In the case of HTML, the data of the node of Paragraph is as follows.

{ type: 'Paragraph',
  tagName: 'p',
  properties: {},
  children: 
   [ { type: 'Strong',
       tagName: 'strong',
       properties: {},
       children: [Array],
       loc: [Object],
       range: [Array],
       raw: '<strong>HTML と、Page クラスに Footer 部とする Container を追加する</strong>' },
     type: 'UNKNOWN' ],
  loc: 
   { start: { line: 1144, column: 36 },
     end: { line: 1144, column: 104 } },
  range: [ 46454, 46522 ],
  raw: '<p><strong>HTML と、Page クラスに Footer 部とする Container を追加する</strong></p>' }

In the case of Markdown, the data of the node is as follows.

{ type: 'Paragraph',
  children: 
   [ { type: 'Code',
       value: 'o',
       loc: [Object],
       range: [Array],
       raw: '`o`' },
     { type: 'Str',
       value: ' をつけたルールを一律 グローバルインストールします。    ',
       loc: [Object],
       range: [Array],
       raw: ' をつけたルールを一律 グローバルインストールします。    ' } ],
  loc: 
   { start: { line: 117, column: 0 },
     end: { line: 117, column: 34 } },
  range: [ 5761, 5795 ],
  raw: '`o` をつけたルールを一律 グローバルインストールします。    ' }

I thought false detection occurred because HTML tags included in the raw property of the Paragraph node generated from HTML.
I attempted to fix it. but I could not decide whether to remove HTML tags on the rule side or whether HTML parser should remove the HTML tag of raw property.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions