From 39f56ba6d8c1bb370b60b87cae1f25e64a9f08f1 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 21 May 2015 10:53:06 -0400 Subject: [PATCH] linting --- src/Bundle.js | 1 - src/Module.js | 8 ++------ src/finalisers/amd.js | 2 -- src/finalisers/umd.js | 2 +- src/utils/map-helpers.js | 4 ++-- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Bundle.js b/src/Bundle.js index 45babe4..ad6410b 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -2,7 +2,6 @@ import { basename, dirname, extname, resolve } from 'path'; import { readFile, Promise } from 'sander'; import MagicString from 'magic-string'; import { keys, has } from './utils/object'; -import { sequence } from './utils/promise'; import Module from './Module'; import ExternalModule from './ExternalModule'; import finalisers from './finalisers/index'; diff --git a/src/Module.js b/src/Module.js index cf5bf59..f64260b 100644 --- a/src/Module.js +++ b/src/Module.js @@ -1,4 +1,4 @@ -import { dirname, relative, resolve } from 'path'; +import { relative } from 'path'; import { Promise } from 'sander'; import { parse } from 'acorn'; import MagicString from 'magic-string'; @@ -42,10 +42,6 @@ export default class Module { this.imports = {}; this.exports = {}; - let commentIndex = 0; - let previousNode; - let previousEnd = 0; - this.ast.body.forEach( node => { let source; @@ -329,7 +325,7 @@ export default class Module { result.push.apply( result, statements ); }); } - }) + }); } }); }) diff --git a/src/finalisers/amd.js b/src/finalisers/amd.js index 969505d..a81221e 100644 --- a/src/finalisers/amd.js +++ b/src/finalisers/amd.js @@ -2,8 +2,6 @@ import { has } from '../utils/object'; import { getName, quoteId } from '../utils/map-helpers'; export default function amd ( bundle, magicString, exportMode, options ) { - const indentStr = magicString.getIndentString(); - let deps = bundle.externalModules.map( quoteId ); let args = bundle.externalModules.map( getName ); diff --git a/src/finalisers/umd.js b/src/finalisers/umd.js index 052e597..53eba7e 100644 --- a/src/finalisers/umd.js +++ b/src/finalisers/umd.js @@ -17,7 +17,7 @@ export default function umd ( bundle, magicString, exportMode, options ) { if ( exportMode === 'named' ) { amdDeps.unshift( `'exports'` ); cjsDeps.unshift( `'exports'` ); - globalDeps.unshift( `(global.${moduleName} = {})` ); + globalDeps.unshift( `(global.${options.moduleName} = {})` ); args.unshift( 'exports' ); } diff --git a/src/utils/map-helpers.js b/src/utils/map-helpers.js index ef63ca6..49e0942 100644 --- a/src/utils/map-helpers.js +++ b/src/utils/map-helpers.js @@ -3,9 +3,9 @@ export function getName ( x ) { } export function quoteId ( x ) { - return `'${x.id}'` + return `'${x.id}'`; } export function req ( x ) { - return `require('${x.id}')` + return `require('${x.id}')`; }