@herb-tools/linter 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/loader.js CHANGED
@@ -165,7 +165,7 @@ class Token {
165
165
  }
166
166
 
167
167
  // NOTE: This file is generated by the templates/template.rb script and should not
168
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/errors.ts.erb
168
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/errors.ts.erb
169
169
  class HerbError {
170
170
  type;
171
171
  message;
@@ -695,7 +695,7 @@ function convertToUTF8(string) {
695
695
  }
696
696
 
697
697
  // NOTE: This file is generated by the templates/template.rb script and should not
698
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/nodes.ts.erb
698
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/nodes.ts.erb
699
699
  class Node {
700
700
  type;
701
701
  location;
@@ -2929,7 +2929,7 @@ class ParseResult extends Result {
2929
2929
  }
2930
2930
 
2931
2931
  // NOTE: This file is generated by the templates/template.rb script and should not
2932
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/node-type-guards.ts.erb
2932
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/node-type-guards.ts.erb
2933
2933
  /**
2934
2934
  * Type guard functions for AST nodes.
2935
2935
  * These functions provide type checking by combining both instanceof
@@ -3628,7 +3628,7 @@ function didyoumean(input, list, threshold) {
3628
3628
  }
3629
3629
 
3630
3630
  // NOTE: This file is generated by the templates/template.rb script and should not
3631
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/visitor.ts.erb
3631
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/visitor.ts.erb
3632
3632
  class Visitor {
3633
3633
  visit(node) {
3634
3634
  if (!node)
@@ -6843,6 +6843,8 @@ function findAttributeByName(attributes, attributeName) {
6843
6843
  * Checks if a tag has a specific attribute
6844
6844
  */
6845
6845
  function hasAttribute(node, attributeName) {
6846
+ if (!node)
6847
+ return false;
6846
6848
  return getAttribute(node, attributeName) !== null;
6847
6849
  }
6848
6850
  /**
@@ -8942,8 +8944,13 @@ class HeadOnlyElementsVisitor extends BaseRuleVisitor {
8942
8944
  return;
8943
8945
  if (tagName === "title" && this.insideSVG)
8944
8946
  return;
8947
+ if (tagName === "meta" && this.hasItempropAttribute(node))
8948
+ return;
8945
8949
  this.addOffense(`Element \`<${tagName}>\` must be placed inside the \`<head>\` tag.`, node.location);
8946
8950
  }
8951
+ hasItempropAttribute(node) {
8952
+ return hasAttribute(node.open_tag, "itemprop");
8953
+ }
8947
8954
  get insideHead() {
8948
8955
  return this.elementStack.includes("head");
8949
8956
  }