Socket
Socket
Sign inDemoInstall

@talend/babel-plugin-import-from-index

Package Overview
Dependencies
1
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.1 to 1.6.0

.eslintrc.json

6

CHANGELOG.md
# @talend/babel-plugin-import-from-index
## 1.6.0
### Minor Changes
- 673984929: add missing deps, fix eslint config (circular dependency) and fix lint issues
## 1.5.1

@@ -4,0 +10,0 @@

15

package.json
{
"name": "@talend/babel-plugin-import-from-index",
"version": "1.5.1",
"version": "1.6.0",
"description": "Transform default imports from specific path to named import from index",

@@ -17,13 +17,16 @@ "main": "src/index.js",

"scripts": {
"lint": "eslint ./src",
"test": "jest"
},
"dependencies": {
"semver": "^7.3.7"
"semver": "^7.5.4"
},
"devDependencies": {
"@babel/core": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"babel-jest": "^26.6.3",
"@babel/core": "^7.23.3",
"@babel/eslint-parser": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"babel-jest": "^29.7.0",
"babel-plugin-tester": "^10.1.0",
"jest": "^26.6.3"
"eslint": "^8.53.0",
"jest": "^29.7.0"
},

@@ -30,0 +33,0 @@ "jest": {

7

src/index.js

@@ -11,3 +11,3 @@ const dirname = require('path').dirname;

let pjson;
while(!pjson) {
while (!pjson) {
const pjsonPath = `${currentPath}/package.json`;

@@ -22,3 +22,3 @@ if (fs.existsSync(pjsonPath)) {

return require(pjson).version;
} catch(error) {
} catch (error) {
console.error(`${packageName} NOT FOUND`, error);

@@ -85,4 +85,3 @@ }

const packageName = find(importDeclarationPath);
const isPackageFrom =
PACKAGES.includes(importDeclarationPath.node.source.value);
const isPackageFrom = PACKAGES.includes(importDeclarationPath.node.source.value);
if (packageName && !importSpecifiers[packageName]) {

@@ -89,0 +88,0 @@ importSpecifiers[packageName] = [];

import pluginTester from 'babel-plugin-tester';
import babelPlugin from '.';

@@ -32,9 +33,8 @@

code: `
import _ from 'lodash';
_.toUpper('foo');`,
import _ from 'lodash';
_.toUpper('foo');`,
output: `
import _ from 'lodash';
import _ from 'lodash';
_.toUpper('foo');`,
_.toUpper('foo');`,
},

@@ -49,2 +49,3 @@ {

import React from 'react';
import { SidePanel, Actions, ActionButton, ActionDropdown, List } from '@talend/react-components';`,

@@ -63,2 +64,3 @@ },

import React from 'react';
import { SidePanel, ModelViewer as ModelViewerComponent } from '@talend/react-components';`,

@@ -65,0 +67,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc