diff --git a/.eslintignore b/.eslintignore index 1954cc29ef..5ea6066c60 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,9 +1,11 @@ -packages/babel-core/src/transformation/templates +/lib scripts -lib +packages/babel-core/src/transformation/templates packages/babel-runtime packages/*/node_modules +packages/*/lib packages/*/dist +packages/*/test/fixtures vendor _babel.github.io Gulpfile.js diff --git a/Makefile b/Makefile index b196fb99d6..65fd96a276 100644 --- a/Makefile +++ b/Makefile @@ -18,13 +18,13 @@ watch: clean ./node_modules/.bin/gulp watch lint: - ./node_modules/.bin/eslint packages/*/{src,test}/*.js --format=codeframe + ./node_modules/.bin/eslint packages/ --format=codeframe flow: ./node_modules/.bin/flow check fix: - ./node_modules/.bin/eslint packages/*/{src,test}/*.js --format=codeframe --fix + ./node_modules/.bin/eslint packages/ --format=codeframe --fix clean: test-clean rm -rf packages/*/lib diff --git a/packages/babel-core/src/transformation/file/options/option-manager.js b/packages/babel-core/src/transformation/file/options/option-manager.js index d492eeda66..1ab1a5badb 100644 --- a/packages/babel-core/src/transformation/file/options/option-manager.js +++ b/packages/babel-core/src/transformation/file/options/option-manager.js @@ -182,7 +182,7 @@ export default class OptionManager { this.log.error(`Using removed Babel 5 option: ${alias}.${key} - ${removed[key].message}`, ReferenceError); } else { let unknownOptErr = `Unknown option: ${alias}.${key}. Check out http://babeljs.io/docs/usage/options/ for more information about options.`; - let presetConfigErr = `A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n \`{ presets: [{option: value}] }\`\nValid:\n \`{ presets: [['presetName', {option: value}]] }\`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.`; + let presetConfigErr = "A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options."; this.log.error(`${unknownOptErr}\n\n${presetConfigErr}`, ReferenceError); } diff --git a/packages/babel-traverse/src/path/lib/removal-hooks.js b/packages/babel-traverse/src/path/lib/removal-hooks.js index fc232871e5..e016c712f3 100644 --- a/packages/babel-traverse/src/path/lib/removal-hooks.js +++ b/packages/babel-traverse/src/path/lib/removal-hooks.js @@ -68,11 +68,11 @@ export let hooks = [ function (self, parent) { if ( - (parent.isIfStatement() && (self.key === 'consequent' || self.key === 'alternate')) || - (parent.isLoop() && self.key === 'body') + (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate")) || + (parent.isLoop() && self.key === "body") ) { self.replaceWith({ - type: 'BlockStatement', + type: "BlockStatement", body: [] }); return true; diff --git a/packages/babel-traverse/src/scope/lib/renamer.js b/packages/babel-traverse/src/scope/lib/renamer.js index 50da4ea40d..b8c1fb3b9c 100644 --- a/packages/babel-traverse/src/scope/lib/renamer.js +++ b/packages/babel-traverse/src/scope/lib/renamer.js @@ -42,7 +42,7 @@ export default class Renamer { let isDefault = exportDeclar.isExportDefaultDeclaration(); if (isDefault && (parentDeclar.isFunctionDeclaration() || - parentDeclar.isClassDeclaration())&& !parentDeclar.node.id) { + parentDeclar.isClassDeclaration()) && !parentDeclar.node.id) { // Ensure that default class and function exports have a name so they have a identifier to // reference from the export specifier list. parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier("default");