Type object
File match .babelrc .babelrc.json babel.config.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/babelrc-json/latest.json
Source https://www.schemastore.org/babelrc.json

Validate with Lintel

npx @lintel/lintel check
Type: object

All of

1. Options object
2. variant
env Record<string, object>

This is an object of keys that represent different environments. For example, you may have: { env: { production: { /* specific options */ } } } which will use those options when the environment variable BABEL_ENV is set to "production". If BABEL_ENV isn't set then NODE_ENV will be used, if it's not set then it defaults to "development"

Default:
{}

Definitions

Options object
ast boolean

Include the AST in the returned object

Default: true
auxiliaryCommentAfter string

Attach a comment after all non-user injected code.

auxiliaryCommentBefore string

Attach a comment before all non-user injected code.

code boolean

Enable code generation

Default: true
comments boolean

Output comments in generated output.

Default: true
compact string | boolean

Do not include superfluous whitespace characters and line terminators. When set to "auto" compact is set to true on input sizes of >500KB.

Default: "auto"
Values: "auto" true false
extends string

A path to a .babelrc file to extend

filename string

Filename for use in errors etc.

Default: "unknown"
filenameRelative string

Filename relative to sourceRoot (defaults to "filename")

highlightCode boolean

ANSI highlight syntax error code frames

ignore string | array

Opposite of the "only" option

inputSourceMap boolean | object

If true, attempt to load an input sourcemap from the file itself. If an object is provided, it will be treated as the source map object itself.

Default: true
keepModuleIdExtensions boolean

Keep extensions in module ids

Default: false
moduleId string

Specify a custom name for module ids.

moduleIds string

If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for common modules)

Default: false
moduleRoot string

Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. (defaults to "sourceRoot")

only string | array

A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim.

plugins string | array[]

List of plugins to load and use

presets string | array[]

List of presets (a set of plugins) to load and use

retainLines boolean

Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. NOTE: This will obviously not retain the columns.

Default: false
sourceFileName string

Set sources[0] on returned source map. (defaults to "filenameRelative")

sourceMaps string | boolean

If truthy, adds a map property to returned output. If set to "inline", a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to "both" then a map property is returned as well as a source map comment appended.

Default: false
Values: "both" "inline" true false
sourceMapTarget string

Set file on returned source map. (defaults to "filenameRelative")

sourceRoot string

The root from which all sources are relative. (defaults to "moduleRoot")