New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-openlayers-internal

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-openlayers-internal - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

2

package.json
{
"name": "eslint-plugin-openlayers-internal",
"version": "2.0.1",
"version": "2.1.0",
"description": "Custom ESLint rules for the OpenLayers project",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,15 @@ 'use strict';

const sourceRoot = path.join(__dirname, '..', 'src');
function longestCommonPrefix(path1, path2) {
const parts1 = path.resolve(path1).split(path.sep);
const parts2 = path.resolve(path2).split(path.sep);
const common = [];
for (let i = 0, ii = parts1.length; i < ii; ++i) {
if (parts1[i] === parts2[i]) {
common.push(parts1[i]);
} else {
break;
}
}
return common.join(path.sep);
}

@@ -43,5 +55,7 @@ exports.rule = {

const filePath = path.relative(sourceRoot, context.getFilename());
const filePath = context.getFilename();
const sourceRoot = path.join(longestCommonPrefix(__dirname, filePath), 'src');
const requirePath = path.relative(sourceRoot, filePath);
let ext;
if (path.basename(filePath) === 'index.js') {
if (path.basename(requirePath) === 'index.js') {
ext = path.sep + 'index.js';

@@ -53,4 +67,4 @@ } else {

const expectedPath = name.split('.').join(path.sep) + ext;
if (expectedPath.toLowerCase() !== filePath.toLowerCase()) {
return context.report(expression, `Expected goog.provide('${name}') to be like ${filePath}`);
if (expectedPath.toLowerCase() !== requirePath.toLowerCase()) {
return context.report(expression, `Expected goog.provide('${name}') to be like ${requirePath}`);
}

@@ -57,0 +71,0 @@ }

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