Remove obsolete max-len eslint rule and reformat some stuff to fit (#7602)

This commit is contained in:
Daniel Tschinder
2018-03-20 14:51:47 +01:00
committed by Brian Ng
parent 6d6fe844fd
commit f0d681a238
14 changed files with 62 additions and 55 deletions

View File

@@ -105,7 +105,6 @@ function resolveStandardizedName(
} catch (e2) {}
if (resolvedOriginal) {
// eslint-disable-next-line max-len
e.message += `\n- If you want to resolve "${name}", use "module:${name}"`;
}
}
@@ -119,7 +118,6 @@ function resolveStandardizedName(
} catch (e2) {}
if (resolvedBabel) {
// eslint-disable-next-line max-len
e.message += `\n- Did you mean "@babel/${name}"?`;
}
@@ -131,7 +129,6 @@ function resolveStandardizedName(
} catch (e2) {}
if (resolvedOppositeType) {
// eslint-disable-next-line max-len
e.message += `\n- Did you accidentally pass a ${type} as a ${oppositeType}?`;
}
@@ -143,8 +140,9 @@ const LOADING_MODULES = new Set();
function requireModule(type: string, name: string): mixed {
if (LOADING_MODULES.has(name)) {
throw new Error(
// eslint-disable-next-line max-len
`Reentrant ${type} detected trying to load "${name}". This module is not ignored and is trying to load itself while compiling itself, leading to a dependency cycle. We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.`,
`Reentrant ${type} detected trying to load "${name}". This module is not ignored ` +
"and is trying to load itself while compiling itself, leading to a dependency cycle. " +
'We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.',
);
}

View File

@@ -1,5 +1,4 @@
// @flow
/* eslint max-len: "off" */
export default {
auxiliaryComment: {
@@ -16,36 +15,42 @@ export default {
},
externalHelpers: {
message:
"Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/",
"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/",
"use the `pragma` option in the `react-jsx` plugin. " +
"Check out http://babeljs.io/docs/plugins/transform-react-jsx/",
},
loose: {
message:
"Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option.",
"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",
"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/",
"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:
"The `sourceMapName` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.",
"The `sourceMapName` option has been removed because it makes more sense for the " +
"tooling that calls Babel to assign `map.file` themselves.",
},
stage: {
message:
@@ -69,6 +74,7 @@ export default {
sourceMapTarget: {
version: 6,
message:
"The `sourceMapTarget` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.",
"The `sourceMapTarget` option has been removed because it makes more sense for the tooling " +
"that calls Babel to assign `map.file` themselves.",
},
};