mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 08:57:26 +08:00
Add babel-plugin-syntax-jsx package (#18282)
This commit is contained in:
committed by
Wesley Wigham
parent
cfb448f0ac
commit
d7a3309b4e
@@ -0,0 +1,10 @@
|
||||
import jsx from "babel-plugin-syntax-jsx";
|
||||
|
||||
// Example taken from the babel plugin handbook:
|
||||
// https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#-enabling-syntax-in-plugins
|
||||
export default function myBabelPlugin() {
|
||||
return {
|
||||
visitor: {},
|
||||
inherits: jsx,
|
||||
};
|
||||
}
|
||||
13
types/babel-plugin-syntax-jsx/index.d.ts
vendored
Normal file
13
types/babel-plugin-syntax-jsx/index.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for babel-plugin-syntax-jsx 6.18
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx
|
||||
// Definitions by: Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// NB: This export doesn't match the handbook example, where `jsx` is the default export.
|
||||
// But it does match the runtime behaviour (at least at the time of this writing). For some reason,
|
||||
// babel-plugin-syntax-jsx/lib/index.js has this line at the bottom: module.exports = exports["default"];
|
||||
declare function jsx(): {
|
||||
manipulateOptions(opts: any, parserOpts: { plugins: string[] }): void;
|
||||
};
|
||||
|
||||
export default jsx;
|
||||
22
types/babel-plugin-syntax-jsx/tsconfig.json
Normal file
22
types/babel-plugin-syntax-jsx/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"babel-plugin-syntax-jsx-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/babel-plugin-syntax-jsx/tslint.json
Normal file
1
types/babel-plugin-syntax-jsx/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user