Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hermes-eslint

Package Overview
Dependencies
Maintainers
3
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hermes-eslint - npm Package Compare versions

Comparing version 0.17.1 to 0.18.0

75

dist/scope-manager/referencer/Referencer.js

@@ -239,5 +239,36 @@ /**

/////////////////////
visitJSXTag(node) {
const rootName = getJsxName(node.name);
if (this._fbtSupport !== true || !FBT_NAMES.has(rootName)) {
// <fbt /> does not reference the jsxPragma, but instead references the fbt import
this._referenceJsxPragma();
}
switch (node.name.type) {
case 'JSXIdentifier':
if (rootName[0].toUpperCase() === rootName[0] || this._fbtSupport === true && FBT_NAMES.has(rootName)) {
// lower cased component names are always treated as "intrinsic" names, and are converted to a string,
// not a variable by JSX transforms:
// <div /> => React.createElement("div", null)
this.visit(node.name);
}
break;
case 'JSXMemberExpression':
case 'JSXNamespacedName':
// special case for <this.Foo /> - we don't want to create an unclosed
// and impossible-to-resolve reference to a variable called `this`.
if (rootName !== 'this') {
this.visit(node.name);
}
break;
}
} /////////////////////
// Visit selectors //
/////////////////////
ArrowFunctionExpression(node) {

@@ -430,3 +461,14 @@ this.visitFunction(node);

JSXClosingElement(_) {// should not be counted as a reference
JSXClosingElement(node) {
/**
* Note that this was not previously considered to be a reference and that
* other scope analyzers do not count them either: e.g. TypeScript-eslint
* https://fburl.com/4q93a3x3
*
* We are considering this a reference because it technically includes an
* identifier that refers to a defined variable. So, if you want to answer:
* "what are all of the references to this variable?", the closing element
* should be included.
*/
this.visitJSXTag(node);
}

@@ -456,31 +498,4 @@

JSXOpeningElement(node) {
const rootName = getJsxName(node.name);
this.visitJSXTag(node); // the opening tag may also have type args and attributes
if (this._fbtSupport !== true || !FBT_NAMES.has(rootName)) {
// <fbt /> does not reference the jsxPragma, but instead references the fbt import
this._referenceJsxPragma();
}
switch (node.name.type) {
case 'JSXIdentifier':
if (rootName[0].toUpperCase() === rootName[0] || this._fbtSupport === true && FBT_NAMES.has(rootName)) {
// lower cased component names are always treated as "intrinsic" names, and are converted to a string,
// not a variable by JSX transforms:
// <div /> => React.createElement("div", null)
this.visit(node.name);
}
break;
case 'JSXMemberExpression':
case 'JSXNamespacedName':
// special case for <this.Foo /> - we don't want to create an unclosed
// and impossible-to-resolve reference to a variable called `this`.
if (rootName !== 'this') {
this.visit(node.name);
}
break;
}
this.visitType(node.typeArguments);

@@ -487,0 +502,0 @@

6

package.json
{
"name": "hermes-eslint",
"version": "0.17.1",
"version": "0.18.0",
"description": "A custom parser for ESLint using the Hermes parser",

@@ -19,5 +19,5 @@ "main": "dist/index.js",

"esrecurse": "^4.3.0",
"hermes-estree": "0.17.1",
"hermes-parser": "0.17.1"
"hermes-estree": "0.18.0",
"hermes-parser": "0.18.0"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc