diff options
author | Joel Kronqvist <work.joelkronqvist@pm.me> | 2022-03-11 20:46:06 +0200 |
---|---|---|
committer | Joel Kronqvist <work.joelkronqvist@pm.me> | 2022-03-11 20:46:06 +0200 |
commit | 080c5819d87b933816d724a83f3bf4f1686770a7 (patch) | |
tree | 4a2ccc68b27edf7d4cbc586c932cc7542b655e19 /node_modules/@babel/plugin-syntax-typescript | |
parent | 5ac7049a9d30733165cc212dee308163c2a14644 (diff) | |
parent | d003b82235a9329f912522a2f70aa950dfce4998 (diff) | |
download | LYLLRuoka-080c5819d87b933816d724a83f3bf4f1686770a7.tar.gz LYLLRuoka-080c5819d87b933816d724a83f3bf4f1686770a7.zip |
Merge branch 'master' of https://github.com/JoelHMikael/FoodJS
Updating remote changes
Diffstat (limited to 'node_modules/@babel/plugin-syntax-typescript')
13 files changed, 150 insertions, 0 deletions
diff --git a/node_modules/@babel/plugin-syntax-typescript/LICENSE b/node_modules/@babel/plugin-syntax-typescript/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/plugin-syntax-typescript/README.md b/node_modules/@babel/plugin-syntax-typescript/README.md new file mode 100644 index 0000000..9e1d1f5 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-syntax-typescript + +> Allow parsing of TypeScript syntax + +See our website [@babel/plugin-syntax-typescript](https://babeljs.io/docs/en/babel-plugin-syntax-typescript) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-syntax-typescript +``` + +or using yarn: + +```sh +yarn add @babel/plugin-syntax-typescript --dev +``` diff --git a/node_modules/@babel/plugin-syntax-typescript/lib/index.js b/node_modules/@babel/plugin-syntax-typescript/lib/index.js new file mode 100644 index 0000000..9e82364 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/lib/index.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _helperPluginUtils = require("@babel/helper-plugin-utils"); + +function removePlugin(plugins, name) { + const indices = []; + plugins.forEach((plugin, i) => { + const n = Array.isArray(plugin) ? plugin[0] : plugin; + + if (n === name) { + indices.unshift(i); + } + }); + + for (const i of indices) { + plugins.splice(i, 1); + } +} + +var _default = (0, _helperPluginUtils.declare)((api, { + isTSX, + disallowAmbiguousJSXLike +}) => { + api.assertVersion(7); + return { + name: "syntax-typescript", + + manipulateOptions(opts, parserOpts) { + const { + plugins + } = parserOpts; + removePlugin(plugins, "flow"); + removePlugin(plugins, "jsx"); + parserOpts.plugins.push(["typescript", { + disallowAmbiguousJSXLike + }], "classProperties"); + { + parserOpts.plugins.push("objectRestSpread"); + } + + if (isTSX) { + parserOpts.plugins.push("jsx"); + } + } + + }; +}); + +exports.default = _default;
\ No newline at end of file diff --git a/node_modules/@babel/plugin-syntax-typescript/package.json b/node_modules/@babel/plugin-syntax-typescript/package.json new file mode 100644 index 0000000..dcea4df --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/package.json @@ -0,0 +1,34 @@ +{ + "name": "@babel/plugin-syntax-typescript", + "version": "7.16.7", + "description": "Allow parsing of TypeScript syntax", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-plugin-syntax-typescript" + }, + "homepage": "https://babel.dev/docs/en/next/babel-plugin-syntax-typescript", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "keywords": [ + "babel-plugin", + "typescript" + ], + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.7" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + }, + "devDependencies": { + "@babel/core": "^7.16.7", + "@babel/helper-plugin-test-runner": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)" +}
\ No newline at end of file diff --git a/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/options.json b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/options.json new file mode 100644 index 0000000..747f9e6 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["syntax-typescript", { "disallowAmbiguousJSXLike": true }]] +} diff --git a/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/input.ts b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/input.ts new file mode 100644 index 0000000..68e8893 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/input.ts @@ -0,0 +1 @@ +<T>x; diff --git a/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/options.json b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/options.json new file mode 100644 index 0000000..d59f14f --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/options.json @@ -0,0 +1,3 @@ +{ + "throws": "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. (1:0)" +} diff --git a/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/input.ts b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/input.ts new file mode 100644 index 0000000..d9deae0 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/input.ts @@ -0,0 +1,2 @@ +<T,>() => 1; +<T,>(x) => 1; diff --git a/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/output.js b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/output.js new file mode 100644 index 0000000..26d3834 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/output.js @@ -0,0 +1,3 @@ +<T>() => 1; + +<T>(x) => 1; diff --git a/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/input.ts b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/input.ts new file mode 100644 index 0000000..4b2a849 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/input.ts @@ -0,0 +1,2 @@ +<T>() => 1; +<T>(x) => 1; diff --git a/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/options.json b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/options.json new file mode 100644 index 0000000..656905e --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`. (1:0)" +} diff --git a/node_modules/@babel/plugin-syntax-typescript/test/index.js b/node_modules/@babel/plugin-syntax-typescript/test/index.js new file mode 100644 index 0000000..21a55ce --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/index.js @@ -0,0 +1,3 @@ +import runner from "@babel/helper-plugin-test-runner"; + +runner(import.meta.url); diff --git a/node_modules/@babel/plugin-syntax-typescript/test/package.json b/node_modules/@babel/plugin-syntax-typescript/test/package.json new file mode 100644 index 0000000..5ffd980 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-typescript/test/package.json @@ -0,0 +1 @@ +{ "type": "module" } |