Socket
Socket
Sign inDemoInstall

babel-plugin-filter-imports

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-filter-imports - npm Package Compare versions

Comparing version 0.3.1 to 1.0.0

src/getSpecifierNames.js

30

package.json
{
"name": "babel-plugin-filter-imports",
"version": "0.3.1",
"version": "1.0.0",
"description": "A babel transform for filtering out imports",
"main": "index.js",
"main": "lib/index.js",
"files": [
"index.js"
"lib",
"src"
],
"scripts": {
"test": "mocha"
"clean": "rimraf lib",
"build": "babel src -d lib",
"lint": "prettier --list-different \"src/**/*.js\" \"test/test.js\" && eslint \"src/**/*.js\" \"test/test.js\"",
"lint:fix": "prettier --write \"src/**/*.js\" \"test/test.js\" && eslint --fix \"src/**/*.js\" \"test/test.js\"",
"test": "mocha --compilers js:babel-register",
"test:watch": "npm run test -- --watch"
},

@@ -26,6 +32,18 @@ "repository": {

"homepage": "https://github.com/ember-cli/babel-plugin-filter-imports",
"dependencies": {
"babel-types": "^6.26.0",
"lodash": "^4.17.4"
},
"devDependencies": {
"babel-core": "^6.9.1",
"mocha": "^3.0.0"
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0",
"eslint": "^4.6.1",
"eslint-config-prettier": "^2.4.0",
"eslint-plugin-prettier": "^2.2.0",
"mocha": "^3.5.0",
"prettier": "^1.6.1",
"rimraf": "^2.6.1"
}
}

38

README.md
# babel-plugin-filter-imports
[![Build Status](https://travis-ci.org/ember-cli/babel-plugin-filter-imports.svg?branch=master)](https://travis-ci.org/ember-cli/babel-plugin-filter-imports)
[![npm](https://img.shields.io/npm/v/babel-plugin-filter-imports.svg?style=flat)](https://www.npmjs.com/package/babel-plugin-filter-imports)

@@ -16,3 +17,5 @@ *This plugin is for Babel 6. If you need to support Babel 5 use the [v0.2.x](https://github.com/ember-cli/babel-plugin-filter-imports/tree/v0.2.x) branch.*

"plugins": [["filter-imports", {
"debugging-tools": [ "warn" ]
"imports": {
"debugging-tools": [ "warn" ]
}
}]]

@@ -38,4 +41,2 @@ }

```js
import { warn } from 'debugging-tools';
function join(args, sep) {

@@ -50,3 +51,30 @@ if (arguments.length > 2) {

- `options` `[Object]`: An object whose keys are names of modules.
- `options[moduleName]` `[String]`: An array of names of imports from `moduleName` to be removed. You can include `'default'` for default export and `'*'` for a namespace export.
- `options[keepImports]` `[Boolean]`: An flag that indicates imports removal from header.
- `options[imports]` `[Object]`: An object whose keys are names of modules.
- `options[imports][moduleName]` `[String]`: An array of names of imports from `moduleName` to be removed. You can include `'default'` for default export and `'*'` for a namespace export.
## Upgrade to `1.x`
There were breaking changes in the plugin configuration, you must update it to work correctly.
##### Before `1.x`
```json
{
"plugins": [["filter-imports", {
"debugging-tools": [ "warn" ]
}]]
}
```
##### After
```json
{
"plugins": [["filter-imports", {
"imports": {
"debugging-tools": [ "warn" ]
}
}]]
}
```
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