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

eslint-plugin-front-require-in-package

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-front-require-in-package - npm Package Compare versions

Comparing version 1.0.3-1 to 1.0.3-2

19

lib/rules/require-in-package.js

@@ -13,8 +13,17 @@ var findup = require('findup-sync');

return {
"ImportDeclaration": function (node) {
var requirePath = node.source.value;
"CallExpression": function (node) {
if (node.callee.name !== "require")
return;
var requirePath = node.arguments
&& node.arguments.length > 0
&& node.arguments[0].value;
if (!requirePath)
return;
// Don't worry about relative paths or built ins
if (isRelativePath(requirePath) || isBuiltInModule(requirePath)) {
if (isRelativePath(requirePath) || isBuiltInModule(requirePath))
return;
}
var pkg = getLocalPackageJson(context.getFilename());

@@ -26,3 +35,3 @@ if (pkg) {

context.report(node, 'dependency not in the local package.json', {
dependency: node.source.value
dependency: requirePath
});

@@ -29,0 +38,0 @@ }

{
"name": "eslint-plugin-front-require-in-package",
"version": "1.0.3-1",
"version": "1.0.3-2",
"description": "ESLint rule that validates ES6 imports are defined in local package.json",

@@ -5,0 +5,0 @@ "repository": {

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