babelrc.json
Babel configuration file
.babelrc.babelrc.jsonbabel.config.json
Validate
Check your file against this schema
Opens the validator with this schema already loaded. Paste your
.babelrc and it validates in your browser — nothing is uploaded.
Reference
Fields
Generated directly from the schema, following local
$refs, to two levels of nesting.
| Field | Type | Description |
|---|---|---|
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 | anyOf | 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" |
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 | anyOf | Opposite of the "only" option |
inputSourceMap | anyOf | 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 | anyOf | 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 | array | List of plugins to load and use |
presets | 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 | anyOf | 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 default: 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") |
env | 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" default: {} |
Audit
What we found in this schema
- Declared draft: draft-07
- Validates cleanly against its own meta-schema.
- 25 properties, 100% carrying a description, max nesting depth 10.
Standards
Specification sections for the keywords in this schema
| Keyword | Document | Section |
|---|---|---|
$id | JSON Schema Core, draft 2020-12 | §8.2.1 — The "$id" Keyword |
$ref | JSON Schema Core, draft 2020-12 | §8.2.3.1 — Direct References with "$ref" |
$schema | JSON Schema Core, draft 2020-12 | §8.1.1 — "$schema" |
additionalProperties | JSON Schema Core, draft 2020-12 | §10.3.2.3 — "additionalProperties" |
allOf | JSON Schema Core, draft 2020-12 | §10.2.1.1 — "allOf" |
anyOf | JSON Schema Core, draft 2020-12 | §10.2.1.2 — "anyOf" |
default | JSON Schema Validation, draft 2020-12 | §9.2 — "default" |
description | JSON Schema Validation, draft 2020-12 | §9.1 — "title" and "description" |
items | JSON Schema Core, draft 2020-12 | §10.3.1.2 — "items" |
minItems | JSON Schema Validation, draft 2020-12 | §6.4.2 — "minItems" |
properties | JSON Schema Core, draft 2020-12 | §10.3.2.1 — "properties" |
type | JSON Schema Validation, draft 2020-12 | §6.1.1 — "type" |
Documents
- JSON Schema Core, draft 2020-12 — JSON Schema: A Media Type for Describing JSON Documents, A. Wright, H. Andrews, B. Hutton, G. Dennis, Eds., 2022. draft-bhutton-json-schema-01. An expired Internet-Draft with no formal standing in the IETF standards process; it is nonetheless the specification of record for JSON Schema 2020-12, published by json-schema.org.
- JSON Schema Validation, draft 2020-12 — JSON Schema Validation: A Vocabulary for Structural Validation of JSON, A. Wright, H. Andrews, B. Hutton, Eds., 2022.
- RFC 8259 (STD 90) — The JavaScript Object Notation (JSON) Data Interchange Format, T. Bray, Ed., 2017. The format a schema describes.
- RFC 6901 — JavaScript Object Notation (JSON) Pointer. Defines the pointer syntax used by $ref fragments and the ~0 / ~1 escapes.
Source
Attribution
This schema comes from SchemaStore, distributed under the Apache License 2.0. Copyright 2015–present Mads Kristensen and contributors. View the original file. The field table and audit on this page are generated by JSONTools.tools; the schema itself is unmodified.