Browse Source

linting

better-aggressive
Rich-Harris 9 years ago
parent
commit
769cf5834d
  1. 10
      src/Module.js
  2. 4
      src/Scope.js
  3. 1
      src/Statement.js

10
src/Module.js

@ -8,16 +8,6 @@ import getLocation from './utils/getLocation';
import makeLegalIdentifier from './utils/makeLegalIdentifier';
import SOURCEMAPPING_URL from './utils/sourceMappingURL';
function isEmptyExportedVarDeclaration ( node, exports, toExport ) {
if ( node.type !== 'VariableDeclaration' || node.declarations[0].init ) return false;
const name = node.declarations[0].id.name;
const id = exports.lookup( name );
return id && id.name in toExport;
}
function removeSourceMappingURLComments ( source, magicString ) {
const SOURCEMAPPING_URL_PATTERN = new RegExp( `\\/\\/#\\s+${SOURCEMAPPING_URL}=.+\\n?`, 'g' );
let match;

4
src/Scope.js

@ -41,9 +41,7 @@ function underscorePrefix () {
var map = blank();
return function ( x ) {
return '_' + x + number( x );
}
return x => `_${x}${number( x )}`;
}
// ## Scope

1
src/Statement.js

@ -91,6 +91,7 @@ export default class Statement {
switch ( node.type ) {
case 'FunctionDeclaration':
scope.addDeclaration( node, false, false );
break;
case 'BlockStatement':
if ( parent && /Function/.test( parent.type ) ) {

Loading…
Cancel
Save