ember-eslint-parser
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "ember-eslint-parser", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -270,8 +270,8 @@ const ContentTag = require('content-tag'); | ||
for (const part of n.tag.split('.')) { | ||
const regex = new RegExp(`\\b${part}\\b`); | ||
let pattern = `\\b${part}\\b`; | ||
if (part.startsWith(':')) { | ||
pattern = `${part}\\b`; | ||
} | ||
const regex = new RegExp(pattern); | ||
const match = codeSlice.match(regex); | ||
// named-blocks are not ElementNodes | ||
if (!match && part.startsWith(':')) continue; | ||
const range = [start + match.index, 0]; | ||
@@ -430,17 +430,19 @@ range[1] = range[0] + part.length; | ||
// the whole tag + children | ||
// | ||
// However, with plain <footer> type nodes, there will be no "parts" | ||
const n = node.parts?.[0] ?? node; | ||
const name = n?.name ?? n.tag; | ||
if (htmlTags.includes(name)) { | ||
return null; | ||
} | ||
const n = node.parts[0]; | ||
const { scope, variable } = findVarInParentScopes(result.scopeManager, path, n.name) || {}; | ||
/* | ||
register a node in scope if we found a variable | ||
we ignore named-blocks as we know that it doesn't reference anything in current scope | ||
if we do not find a variable we register it with a missing variable if | ||
* it starts with upper case, it should be a component with a reference | ||
* it includes a dot, it's a path which should have a reference | ||
* it's NOT a standard html tag, it should have a referenced variable | ||
*/ | ||
if ( | ||
!n.name.startsWith(':') && | ||
scope && | ||
!name.startsWith(':') && | ||
(variable || isUpperCase(n.name[0]) || name.includes('.') || !htmlTags.includes(name)) | ||
(variable || | ||
isUpperCase(n.name[0]) || | ||
node.name.includes('.') || | ||
!htmlTags.includes(node.name)) | ||
) { | ||
@@ -447,0 +449,0 @@ registerNodeInScope(n, scope, variable); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28839
795