@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.cjs CHANGED
@@ -186,7 +186,7 @@ class Token {
186
186
  }
187
187
 
188
188
  // NOTE: This file is generated by the templates/template.rb script and should not
189
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/errors.ts.erb
189
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/errors.ts.erb
190
190
  class HerbError {
191
191
  type;
192
192
  message;
@@ -716,7 +716,7 @@ function convertToUTF8(string) {
716
716
  }
717
717
 
718
718
  // NOTE: This file is generated by the templates/template.rb script and should not
719
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/nodes.ts.erb
719
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/nodes.ts.erb
720
720
  class Node {
721
721
  type;
722
722
  location;
@@ -2950,7 +2950,7 @@ class ParseResult extends Result {
2950
2950
  }
2951
2951
 
2952
2952
  // NOTE: This file is generated by the templates/template.rb script and should not
2953
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/node-type-guards.ts.erb
2953
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/node-type-guards.ts.erb
2954
2954
  /**
2955
2955
  * Type guard functions for AST nodes.
2956
2956
  * These functions provide type checking by combining both instanceof
@@ -3649,7 +3649,7 @@ function didyoumean(input, list, threshold) {
3649
3649
  }
3650
3650
 
3651
3651
  // NOTE: This file is generated by the templates/template.rb script and should not
3652
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.0/templates/javascript/packages/core/src/visitor.ts.erb
3652
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/core/src/visitor.ts.erb
3653
3653
  class Visitor {
3654
3654
  visit(node) {
3655
3655
  if (!node)
@@ -6864,6 +6864,8 @@ function findAttributeByName(attributes, attributeName) {
6864
6864
  * Checks if a tag has a specific attribute
6865
6865
  */
6866
6866
  function hasAttribute(node, attributeName) {
6867
+ if (!node)
6868
+ return false;
6867
6869
  return getAttribute(node, attributeName) !== null;
6868
6870
  }
6869
6871
  /**
@@ -8963,8 +8965,13 @@ class HeadOnlyElementsVisitor extends BaseRuleVisitor {
8963
8965
  return;
8964
8966
  if (tagName === "title" && this.insideSVG)
8965
8967
  return;
8968
+ if (tagName === "meta" && this.hasItempropAttribute(node))
8969
+ return;
8966
8970
  this.addOffense(`Element \`<${tagName}>\` must be placed inside the \`<head>\` tag.`, node.location);
8967
8971
  }
8972
+ hasItempropAttribute(node) {
8973
+ return hasAttribute(node.open_tag, "itemprop");
8974
+ }
8968
8975
  get insideHead() {
8969
8976
  return this.elementStack.includes("head");
8970
8977
  }