Add decimal parsing support (#11640)
* docs: add DecimalLiteral to AST spec * add decimal support * fix: throw invalid decimal on start * add DecimalLiteral type definitions * update parser typings * add generator support * add syntax-decimal plugin * Add syntax-decimal to babel-standalone * add syntax-decimal to missing plugin helpers * fix incorrect test macro
This commit is contained in:
3
packages/babel-plugin-syntax-decimal/.npmignore
Normal file
3
packages/babel-plugin-syntax-decimal/.npmignore
Normal file
@@ -0,0 +1,3 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
19
packages/babel-plugin-syntax-decimal/README.md
Normal file
19
packages/babel-plugin-syntax-decimal/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/plugin-syntax-decimal
|
||||
|
||||
> Allow parsing of decimal
|
||||
|
||||
See our website [@babel/plugin-syntax-decimal](https://babeljs.io/docs/en/next/babel-plugin-syntax-decimal.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-decimal
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-decimal --dev
|
||||
```
|
||||
27
packages/babel-plugin-syntax-decimal/package.json
Normal file
27
packages/babel-plugin-syntax-decimal/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-decimal",
|
||||
"version": "7.10.1",
|
||||
"description": "Allow parsing of decimal",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-syntax-decimal"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"exports": {
|
||||
".": "./lib/index.js"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.10.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
}
|
||||
}
|
||||
13
packages/babel-plugin-syntax-decimal/src/index.js
Normal file
13
packages/babel-plugin-syntax-decimal/src/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-decimal",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("decimal");
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user