Give specific error messages for babel 5 options that were removed in babel 6
This commit is contained in:
@@ -13,6 +13,7 @@ import cloneDeep from "lodash/lang/cloneDeep";
|
||||
import clone from "lodash/lang/clone";
|
||||
import merge from "../../../helpers/merge";
|
||||
import config from "./config";
|
||||
import removed from "./removed";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
@@ -222,7 +223,13 @@ export default class OptionManager {
|
||||
|
||||
// check for an unknown option
|
||||
if (!option && this.log) {
|
||||
this.log.error(`Unknown option: ${alias}.${key}`, ReferenceError);
|
||||
let pluginOptsInfo = "Check out http://babeljs.io/docs/usage/options/ for more info";
|
||||
|
||||
if (removed[key]) {
|
||||
this.log.error(`Using removed Babel 5 option: ${alias}.${key} - ${removed[key].message}`, ReferenceError);
|
||||
} else {
|
||||
this.log.error(`Unknown option: ${alias}.${key}. ${pluginOptsInfo}`, ReferenceError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/* eslint max-len: 0 */
|
||||
|
||||
module.exports = {
|
||||
"auxiliaryComment": {
|
||||
"message": "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "Put the specific transforms you want in the `plugins` option"
|
||||
},
|
||||
"breakConfig": {
|
||||
"message": "This is not a necessary option in Babel 6"
|
||||
},
|
||||
"experimental": {
|
||||
"message": "Put the specific transforms you want in the `plugins` option"
|
||||
},
|
||||
"externalHelpers": {
|
||||
"message": "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"
|
||||
},
|
||||
"extra": {
|
||||
"message": ""
|
||||
},
|
||||
"jsxPragma": {
|
||||
"message": "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
|
||||
},
|
||||
// "keepModuleIdExtensions": {
|
||||
// "message": ""
|
||||
// },
|
||||
"loose": {
|
||||
"message": "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."
|
||||
},
|
||||
"metadataUsedHelpers": {
|
||||
"message": "Not required anymore as this is enabled by default"
|
||||
},
|
||||
"modules": {
|
||||
"message": "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules",
|
||||
},
|
||||
"nonStandard": {
|
||||
"message": "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/",
|
||||
},
|
||||
"optional": {
|
||||
"message": "Put the specific transforms you want in the `plugins` option"
|
||||
},
|
||||
"sourceMapName": {
|
||||
"message": "Use the `sourceMapTarget` option"
|
||||
},
|
||||
"stage": {
|
||||
"message": "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
|
||||
},
|
||||
"whitelist": {
|
||||
"message": "Put the specific transforms you want in the `plugins` option"
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user