From 5d01221214718edafa7d922bb44bd3f5a2d307cc Mon Sep 17 00:00:00 2001 From: Ivan Tusnolobov Date: Sun, 13 Oct 2019 01:01:36 +0300 Subject: [PATCH 001/110] Separate rafc and rafce snippets They both had export default --- snippets/snippets.json | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index d2c9760..48b7a32 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -346,8 +346,8 @@ ], "description": "Creates a React Functional Component with ES7 module system with PropTypes" }, - "reactArrowFunctionComponent": { - "prefix": ["rafc", "rafce"], + "reactArrowFunctionExportComponent": { + "prefix": ["rafce"], "body": [ "import React from 'react'", "", @@ -364,6 +364,22 @@ ], "description": "Creates a React Arrow Function Component with ES7 module system" }, + "reactArrowFunctionComponent": { + "prefix": ["rafc"], + "body": [ + "import React from 'react'", + "", + "export const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system" + }, "reactArrowFunctionComponentWithPropTypes": { "prefix": "rafcp", "body": [ From 1578416418a4ea9cc6dc3c74fd5ce5dd51ebf58c Mon Sep 17 00:00:00 2001 From: Ivan Tusnolobov Date: Sun, 13 Oct 2019 20:17:25 +0300 Subject: [PATCH 002/110] Apply suggestions from code review Co-Authored-By: Damian Sznajder --- snippets/snippets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 48b7a32..501d571 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -347,7 +347,7 @@ "description": "Creates a React Functional Component with ES7 module system with PropTypes" }, "reactArrowFunctionExportComponent": { - "prefix": ["rafce"], + "prefix": "rafce", "body": [ "import React from 'react'", "", @@ -365,7 +365,7 @@ "description": "Creates a React Arrow Function Component with ES7 module system" }, "reactArrowFunctionComponent": { - "prefix": ["rafc"], + "prefix": "rafc", "body": [ "import React from 'react'", "", From 5c8cb5c7838c518b73921433732df4bb0aa7e6b5 Mon Sep 17 00:00:00 2001 From: impulse Date: Tue, 15 Oct 2019 15:54:29 +0200 Subject: [PATCH 003/110] Fix return type for tsrfc / tsrfce fixes #86 --- snippets/ts-snippets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index ebe35fd..99429e6 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -64,7 +64,7 @@ "\t", "}", "", - "function ${1:${TM_FILENAME_BASE}}(): Props {", + "function ${1:${TM_FILENAME_BASE}}({}: Props): ReactElement {", "\treturn (", "\t\t
", "\t\t\t$0", @@ -86,7 +86,7 @@ "\t", "}", "", - "export default function ${1:${TM_FILENAME_BASE}}(): Props {", + "export default function ${1:${TM_FILENAME_BASE}}({}: Props): ReactElement {", "\treturn (", "\t\t
", "\t\t\t$0", From cd8db03bd526ff329ba2763c7f88dc434c5fbbf9 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 6 Nov 2019 14:24:26 +0100 Subject: [PATCH 004/110] 2.4.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c69a70..0d43eaf 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.4.3", + "version": "2.4.4", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From 6896ee77cc96c156f531951b7b6afa1a9fb6eb74 Mon Sep 17 00:00:00 2001 From: impulse Date: Tue, 12 Nov 2019 15:23:03 +0100 Subject: [PATCH 005/110] Import ReactElement for tsrfc / tsrfce --- snippets/ts-snippets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index 99429e6..e1b27df 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -58,7 +58,7 @@ "typeScriptReactFunctionalExportComponent": { "prefix": "tsrfce", "body": [ - "import React from 'react'", + "import React, { ReactElement } from 'react'", "", "interface Props {", "\t", @@ -80,7 +80,7 @@ "typeScriptReactFunctionalComponent": { "prefix": "tsrfc", "body": [ - "import React from 'react'", + "import React, { ReactElement } from 'react'", "", "interface Props {", "\t", From 1280e4b03c40016aa4e665312aba252854d3bafa Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 19 Dec 2019 15:25:14 +0000 Subject: [PATCH 006/110] Change `cmmb` to be more compliant with jsdocs --- CHANGELOG.md | 4 ++++ snippets/snippets.json | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d82b404..da02801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[2.4.5] - 2019-12-19 + +- Change `cmmb` to be more compliant with jsdocs + [2.3.0] - 2019-05-21 - Use `\t` instead of hard space for indent. diff --git a/snippets/snippets.json b/snippets/snippets.json index 501d571..e4bdad7 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1099,13 +1099,7 @@ }, "Comment Big Block": { "prefix": "cmmb", - "body": [ - "/**", - "|--------------------------------------------------", - "| $1", - "|--------------------------------------------------", - "*/" - ] + "body": ["/**", " * ${0}", " */"] }, "describeBlock": { "prefix": "desc", From bad7a1f89908963ab1ed5e275b758d6ddf2eb760 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 19 Dec 2019 15:26:36 +0000 Subject: [PATCH 007/110] 2.4.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0d43eaf..3037d1c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.4.4", + "version": "2.4.5", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From 21c24c01a6c129dde53326482ea72c07e8f91ad0 Mon Sep 17 00:00:00 2001 From: Hektor Misplon <36757790+hektormisplon@users.noreply.github.com> Date: Mon, 16 Dec 2019 15:04:09 +0100 Subject: [PATCH 008/110] Add hooks state import snippets A suggestion for adding import snippets with state features for functional components. --- snippets/snippets.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index e4bdad7..6c4f69d 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -235,6 +235,14 @@ "" ] }, + "import React, {useState}": { + "prefix": "imrs", + "body": ["import React, { useState } from 'react'", ""] + }, + "import React, {useState, useEffect}": { + "prefix": "imrse", + "body": ["import React, { useState, useEffect } from 'react'", ""] + }, "import PropTypes": { "prefix": "impt", "body": ["import PropTypes from 'prop-types'", ""] From 5208c712eabe91ce88d4d105dc63611d58ba984e Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 19 Dec 2019 15:33:26 +0000 Subject: [PATCH 009/110] Add `imrs` and `imrse` to imports for functional components. Removed `tsrafc`. --- CHANGELOG.md | 4 ++++ README.md | 17 +++++------------ snippets/ts-snippets.json | 20 -------------------- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da02801..22d29b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[2.5.0] - 2019-12-19 + +- Add `imrs` and `imrse` to imports for functional components. Removed `tsrafc`. + [2.4.5] - 2019-12-19 - Change `cmmb` to be more compliant with jsdocs diff --git a/README.md b/README.md index 8093773..ec41b48 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ I.E. `tsrcc` | `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` | | `impt→` | `import PropTypes from 'prop-types'` | | `imrr→` | `import { BrowserRouter as Router, Route, Link } from 'react-router-dom'` | +| `imrs→` | `import React, { useState } from 'react'` | +| `imrse→` | `import React, { useState, useEffect } from 'react'` | | `redux→` | `import { connect } from 'react-redux'` | | `rconst→` | `constructor(props) with this.state` | | `rconc→` | `constructor(props, context) with this.state` | @@ -402,10 +404,7 @@ const mapStateToProps = state => ({}) const mapDispatchToProps = {} -export default connect( - mapStateToProps, - mapDispatchToProps, -)(FileName) +export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` ### `rcreduxp` @@ -429,10 +428,7 @@ const mapStateToProps = state => ({}) const mapDispatchToProps = {} -export default connect( - mapStateToProps, - mapDispatchToProps -)(FileName) +export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` ### `reduxmap` @@ -543,10 +539,7 @@ const mapStateToProps = state => ({}) const mapDispatchToProps = {} -export default connect( - mapStateToProps, - mapDispatchToProps -)(FileName) +export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` ## Others diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index e1b27df..a305856 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -119,26 +119,6 @@ ], "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" }, - "typeScriptReactArrowFunctionComponent": { - "prefix": "tsrafc", - "body": [ - "import React from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "export const ${1:${TM_FILENAME_BASE}}: React.FC = () => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interfaces" - }, "typeScriptReactClassPureComponent": { "prefix": "tsrpc", "body": [ From fab891b02ae09beb96491b24e0492b1f5e4c8f07 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 19 Dec 2019 15:33:37 +0000 Subject: [PATCH 010/110] 2.5.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3037d1c..84f99a8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.4.5", + "version": "2.5.0", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From a80035b7e116faa9184130e203a9738595733107 Mon Sep 17 00:00:00 2001 From: PunitLodha Date: Mon, 6 Jan 2020 19:45:40 +0530 Subject: [PATCH 011/110] fixed error in documentation --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index ec41b48..e6a4e42 100644 --- a/README.md +++ b/README.md @@ -344,11 +344,9 @@ export default $1 ```javascript import React from 'react' -const $1 = () => { +export const $1 = () => { return
$0
} - -export default $1 ``` ### `rafce` From 370b5bd84f6267f45efa46c1817c5d009cad20be Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Thu, 13 Feb 2020 18:40:35 +0100 Subject: [PATCH 012/110] Added export interface --- snippets/ts-snippets.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index a305856..158562f 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -222,5 +222,11 @@ "" ], "description": "Creates a React component class with PropTypes with connected redux and ES7 module system and TypeScript interfaces" + }, + "Export interface": { + "prefix": "expointface", + "body": [ + "export interface ${1:${TM_FILENAME_BASE} {$2}" + ] } } From 2b70fd13c69830c4288e735c2f46196430bef204 Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Thu, 13 Feb 2020 18:47:17 +0100 Subject: [PATCH 013/110] Added Destructuring props object --- snippets/snippets.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 6c4f69d..1064418 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1344,5 +1344,12 @@ "\t};", "}, [${3:input}])" ] + }, + "Destructuring props object": { + "prefix": "desprs", + "body": [ + "const { ${0:prop} } = props" + ], + "description": "Destructuring props object in ES7 syntax" } } From a29495b6df6281571e6003eb46973c7ec6472f79 Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Thu, 13 Feb 2020 18:49:09 +0100 Subject: [PATCH 014/110] Update prefix name for new snippet --- snippets/ts-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index 158562f..2d698da 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -224,7 +224,7 @@ "description": "Creates a React component class with PropTypes with connected redux and ES7 module system and TypeScript interfaces" }, "Export interface": { - "prefix": "expointface", + "prefix": "expoint", "body": [ "export interface ${1:${TM_FILENAME_BASE} {$2}" ] From 559189559b59b3904c11d77525fa15186f71b381 Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Thu, 13 Feb 2020 18:54:26 +0100 Subject: [PATCH 015/110] Update snippets.json --- snippets/snippets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 1064418..b874df0 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1345,11 +1345,11 @@ "}, [${3:input}])" ] }, - "Destructuring props object": { + "Props Object Destructuring": { "prefix": "desprs", "body": [ "const { ${0:prop} } = props" ], - "description": "Destructuring props object in ES7 syntax" + "description": "Props object destructuring in ES7 syntax" } } From 5fdb96ef01a75b173950899d04224b6f8203fc47 Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Thu, 13 Feb 2020 19:05:41 +0100 Subject: [PATCH 016/110] fix(snippet): forgot a } --- snippets/ts-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index 2d698da..fec45ac 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -226,7 +226,7 @@ "Export interface": { "prefix": "expoint", "body": [ - "export interface ${1:${TM_FILENAME_BASE} {$2}" + "export interface ${1:${TM_FILENAME_BASE}} {$0}" ] } } From c22fffdcb7400b5006df4f9dd43a7bc98563281d Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Sat, 15 Feb 2020 11:40:20 +0100 Subject: [PATCH 017/110] Update snippets.json --- snippets/snippets.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index b874df0..6c4f69d 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1344,12 +1344,5 @@ "\t};", "}, [${3:input}])" ] - }, - "Props Object Destructuring": { - "prefix": "desprs", - "body": [ - "const { ${0:prop} } = props" - ], - "description": "Props object destructuring in ES7 syntax" } } From ba8856193a37a794d14a5a7dc4d44a960754cae0 Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Sat, 15 Feb 2020 11:51:44 +0100 Subject: [PATCH 018/110] Update snippets/ts-snippets.json Co-Authored-By: Damian Sznajder --- snippets/ts-snippets.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index fec45ac..cb3a147 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -224,7 +224,8 @@ "description": "Creates a React component class with PropTypes with connected redux and ES7 module system and TypeScript interfaces" }, "Export interface": { - "prefix": "expoint", + "prefix": "expint", + "body": [ "export interface ${1:${TM_FILENAME_BASE}} {$0}" ] From 4ca658631f2dda35094c6182d23978ee51751cdd Mon Sep 17 00:00:00 2001 From: Navneet Karnani Date: Mon, 17 Feb 2020 10:38:57 +0530 Subject: [PATCH 019/110] Add react native arrow function component with styles Added a new template for "rnfs" similar to "rnf" but with a "StyleSheet" declaration. --- snippets/snippets.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 6c4f69d..1c8d4b3 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -948,6 +948,26 @@ "" ] }, + "reactNativeArrowFunctionComponentWithStyles": { + "prefix": "rnfs", + "body": [ + "import React from 'react'", + "import { View, Text, StyleSheet } from 'react-native'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "const styles = StyleSheet.create({})", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ] + }, "reactNativeImport": { "prefix": "imrn", "body": "import { ${1:moduleName} } from 'react-native'" From 50c1f6c8440d1e8f2faff2d2c774e11d133bdca1 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 15 Feb 2020 11:53:55 +0100 Subject: [PATCH 020/110] 2.5.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84f99a8..b92d05c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.5.0", + "version": "2.5.1", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From 51d42e524f291ae9931b833469d755f31d9b00aa Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sun, 23 Feb 2020 12:34:46 +0100 Subject: [PATCH 021/110] Add `rnfs` to changelog --- CHANGELOG.md | 4 ++++ README.md | 19 +++++++++++++++++++ snippets/snippets.json | 8 ++++---- snippets/ts-snippets.json | 5 +---- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d29b4..955f5ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[2.6.0] - 2020-02-23 + +- Add `rnfs`. + [2.5.0] - 2019-12-19 - Add `imrs` and `imrse` to imports for functional components. Removed `tsrafc`. diff --git a/README.md b/README.md index e6a4e42..560d57d 100644 --- a/README.md +++ b/README.md @@ -473,6 +473,25 @@ const $1 = () => { export default $1 ``` +### `rnfs` + +```javascript +import React from 'react' +import { StyleSheet, View, Text } from 'react-native' + +const $1 = () => { + return ( + + $2 + + ) +} + +export default $1 + +const styles = StyleSheet.create({}) +``` + ### `rncs` ```javascript diff --git a/snippets/snippets.json b/snippets/snippets.json index 1c8d4b3..5ddd3b1 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -242,7 +242,7 @@ "import React, {useState, useEffect}": { "prefix": "imrse", "body": ["import React, { useState, useEffect } from 'react'", ""] - }, + }, "import PropTypes": { "prefix": "impt", "body": ["import PropTypes from 'prop-types'", ""] @@ -952,7 +952,7 @@ "prefix": "rnfs", "body": [ "import React from 'react'", - "import { View, Text, StyleSheet } from 'react-native'", + "import { StyleSheet, Text, View } from 'react-native'", "", "const ${1:${TM_FILENAME_BASE}} = () => {", "\treturn (", @@ -962,9 +962,9 @@ "\t)", "}", "", - "const styles = StyleSheet.create({})", - "", "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})", "" ] }, diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index cb3a147..23f9ca5 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -225,9 +225,6 @@ }, "Export interface": { "prefix": "expint", - - "body": [ - "export interface ${1:${TM_FILENAME_BASE}} {$0}" - ] + "body": ["export interface ${1:${TM_FILENAME_BASE}} {$0}"] } } From 005286821e19466628340461c3a8a5fc819f717a Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sun, 23 Feb 2020 12:34:52 +0100 Subject: [PATCH 022/110] 2.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b92d05c..94faee7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.5.1", + "version": "2.6.0", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From f6af1f4608eff45ee8b9a35565059842c9aa43cc Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Fri, 6 Mar 2020 12:11:04 +0100 Subject: [PATCH 023/110] feat: added PropTypes.exact --- snippets/snippets.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 5ddd3b1..68fb006 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1116,6 +1116,16 @@ "body": ["PropTypes.shape({", "\t$0", "}).isRequired,"], "description": "An object taking on a particular shape required" }, + "propTypeExact": { + "prefix": "ptex", + "body": ["PropTypes.exact({", "\t$0", "}),"], + "description": "An object with warnings on extra properties" + }, + "propTypeExactRequired": { + "prefix": "ptexr", + "body": ["PropTypes.exact({", "\t$0", "}).isRequired,"], + "description": "An object with warnings on extra properties required" + }, "staticPropTpyes": { "prefix": "ptypes", "body": ["static propTypes = {", "$0", "}", ""] From 513687eac87ea73d9206ad6c56177b39bb245cdf Mon Sep 17 00:00:00 2001 From: impulse Date: Tue, 10 Mar 2020 10:10:39 +0100 Subject: [PATCH 024/110] Update ts-snippets.json Closes #112 --- snippets/ts-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index 23f9ca5..0709c59 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -106,7 +106,7 @@ "\t", "}", "", - "const ${1:${TM_FILENAME_BASE}}: React.FC = () => {", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", "\treturn (", "\t\t
", "\t\t\t$0", From bb833e609f1457412c6547fcab28d2005d96b39b Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 10 Mar 2020 10:58:40 +0100 Subject: [PATCH 025/110] 2.6.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 94faee7..b7078a6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.6.0", + "version": "2.6.1", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From d544deeaaa2b78c8f50dc2fae58b8f5f6a5368e1 Mon Sep 17 00:00:00 2001 From: Skyler Dowdy Date: Tue, 10 Mar 2020 16:14:39 -0400 Subject: [PATCH 026/110] Added Some Imports and Fixed others. --- README.md | 78 +++++++++++++++++++++++------------------- snippets/snippets.json | 44 +++++++++++++++++++++++- 2 files changed, 85 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 560d57d..317e288 100644 --- a/README.md +++ b/README.md @@ -60,42 +60,48 @@ I.E. `tsrcc` ## React -| Prefix | Method | -| ----------: | ----------------------------------------------------------------------------------- | -| `imr→` | `import React from 'react'` | -| `imrd→` | `import ReactDOM from 'react-dom'` | -| `imrc→` | `import React, { Component } from 'react'` | -| `imrcp→` | `import React, { Component } from 'react' & import PropTypes from 'prop-types'` | -| `imrpc→` | `import React, { PureComponent } from 'react'` | -| `imrpcp→` | `import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'` | -| `imrm→` | `import React, { memo } from 'react'` | -| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` | -| `impt→` | `import PropTypes from 'prop-types'` | -| `imrr→` | `import { BrowserRouter as Router, Route, Link } from 'react-router-dom'` | -| `imrs→` | `import React, { useState } from 'react'` | -| `imrse→` | `import React, { useState, useEffect } from 'react'` | -| `redux→` | `import { connect } from 'react-redux'` | -| `rconst→` | `constructor(props) with this.state` | -| `rconc→` | `constructor(props, context) with this.state` | -| `est→` | `this.state = { }` | -| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | -| `cdm→` | `componentDidMount = () => { }` | -| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | -| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | -| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | -| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | -| `cwun→` | `componentWillUnmount = () => { }` | -| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | -| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | -| `ren→` | `render() { return( ) }` | -| `sst→` | `this.setState({ })` | -| `ssf→` | `this.setState((state, props) => return { })` | -| `props→` | `this.props.propName` | -| `state→` | `this.state.stateName` | -| `rcontext→` | `const ${1:contextName} = React.createContext()` | -| `cref→` | `this.${1:refName}Ref = React.createRef()` | -| `fref→` | `const ref = React.createRef()` | -| `bnd→` | `this.methodName = this.methodName.bind(this)` | +| Prefix | Method | +| ----------: | --------------------------------------------------------------------------------------| +| `imr→` | `import React from 'react'` | +| `imrd→` | `import ReactDOM from 'react-dom'` | +| `imrc→` | `import React, { Component } from 'react'` | +| `imrcp→` | `import React, { Component } from 'react' & import PropTypes from 'prop-types'` | +| `imrpc→` | `import React, { PureComponent } from 'react'` | +| `imrpcp→` | `import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'` | +| `imrm→` | `import React, { memo } from 'react'` | +| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` | +| `impt→` | `import PropTypes from 'prop-types'` | +| `imrr→` | `import { BrowserRouter as BR, Route as R, NavLink as NL } from 'react-router-dom'` | +| `imbr→` | `import { BrowserRouter as BR} from 'react-router-dom'` | +| `imbrc→` | `import { Route as R, Switch as S, NavLink as NL, Link as L } from react-router-dom'` | +| `imbrr→` | `import { Route as R } from 'react-router-dom'` | +| `imbrs→` | `import { Switch as S } from 'react-router-dom'` | +| `imbrl→` | `import { Link as L } from 'react-router-dom'` | +| `imbrnl→` | `import { NavLink as NL } from 'react-router-dom'` | +| `imrs→` | `import React, { useState } from 'react'` | +| `imrse→` | `import React, { useState, useEffect } from 'react'` | +| `redux→` | `import { connect } from 'react-redux'` | +| `rconst→` | `constructor(props) with this.state` | +| `rconc→` | `constructor(props, context) with this.state` | +| `est→` | `this.state = { }` | +| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | +| `cdm→` | `componentDidMount = () => { }` | +| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | +| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | +| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | +| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | +| `cwun→` | `componentWillUnmount = () => { }` | +| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | +| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | +| `ren→` | `render() { return( ) }` | +| `sst→` | `this.setState({ })` | +| `ssf→` | `this.setState((state, props) => return { })` | +| `props→` | `this.props.propName` | +| `state→` | `this.state.stateName` | +| `rcontext→` | `const ${1:contextName} = React.createContext()` | +| `cref→` | `this.${1:refName}Ref = React.createRef()` | +| `fref→` | `const ref = React.createRef()` | +| `bnd→` | `this.methodName = this.methodName.bind(this)` | ## React Hooks diff --git a/snippets/snippets.json b/snippets/snippets.json index 68fb006..7ef92b5 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -250,7 +250,49 @@ "import React Router": { "prefix": "imrr", "body": [ - "import { BrowserRouter as Router, Route, Link } from 'react-router-dom'", + "import { BrowserRouter as BR, Route as R, NavLink as NL } from 'react-router-dom'", + "" + ] + }, + "import React Browser Router": { + "prefix": "imbr", + "body": [ + "import { BrowserRouter as Router } from 'react-router-dom'", + "" + ] + }, + "import React Browser Router - Route": { + "prefix": "imbrr", + "body": [ + "import { Route as R } from 'react-router-dom'", + "" + ] + }, + "import React Browser Router - Route Combo": { + "prefix": "imbrc", + "body": [ + "import { Route as R, Switch as S, NavLink as NL, Link as L } from 'react-router-dom'", + "" + ] + }, + "import React Browser Router - Switch": { + "prefix": "imbrs", + "body": [ + "import { Switch as S } from 'react-router-dom'", + "" + ] + }, + "import React Browser Router - Link": { + "prefix": "imbrl", + "body": [ + "import { Link as L } from 'react-router-dom'", + "" + ] + }, + "import React Browser Router - NavLink": { + "prefix": "imbrnl", + "body": [ + "import { NavLink as NL } from 'react-router-dom'", "" ] }, From 961bb68f8b9ee3c23774f9d11ecd9c0cab903643 Mon Sep 17 00:00:00 2001 From: Skyler Dowdy Date: Tue, 10 Mar 2020 16:36:26 -0400 Subject: [PATCH 027/110] fix error 109 --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 317e288..a37c500 100644 --- a/README.md +++ b/README.md @@ -159,14 +159,11 @@ I.E. `tsrcc` | `ptypes→` | `static propTypes = {}` | ## GraphQL +| Prefix | Method | +| --------: | ----------------------------------- | +|`graphql→`|`import { compose, graphql } from react-apollo'`| +| `expgql->`|`export default compose(graphql($1, { name: $2 }))($3)`| -|`graphql→`|`import { compose, graphql } from 'react-apollo'`| - -### `expgql` - -```js -export default compose(graphql($1, { name: $2 }))($3) -``` ## Console From db77c5a0acf48ddd81abeb83f65a57c47bd99ed2 Mon Sep 17 00:00:00 2001 From: Skyler Dowdy Date: Wed, 11 Mar 2020 10:51:46 -0400 Subject: [PATCH 028/110] Removed aliases from Readme I believe this is what you mean --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a37c500..2ceb254 100644 --- a/README.md +++ b/README.md @@ -71,13 +71,13 @@ I.E. `tsrcc` | `imrm→` | `import React, { memo } from 'react'` | | `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` | | `impt→` | `import PropTypes from 'prop-types'` | -| `imrr→` | `import { BrowserRouter as BR, Route as R, NavLink as NL } from 'react-router-dom'` | -| `imbr→` | `import { BrowserRouter as BR} from 'react-router-dom'` | -| `imbrc→` | `import { Route as R, Switch as S, NavLink as NL, Link as L } from react-router-dom'` | -| `imbrr→` | `import { Route as R } from 'react-router-dom'` | -| `imbrs→` | `import { Switch as S } from 'react-router-dom'` | -| `imbrl→` | `import { Link as L } from 'react-router-dom'` | -| `imbrnl→` | `import { NavLink as NL } from 'react-router-dom'` | +| `imrr→` | `import { BrowserRouter as Router, Route, NavLink} from 'react-router-dom'` | +| `imbr→` | `import { BrowserRouter as Router} from 'react-router-dom'` | +| `imbrc→` | `import { Route, Switch, NavLink, Link } from react-router-dom'` | +| `imbrr→` | `import { Route } from 'react-router-dom'` | +| `imbrs→` | `import { Switch } from 'react-router-dom'` | +| `imbrl→` | `import { Link } from 'react-router-dom'` | +| `imbrnl→` | `import { NavLink } from 'react-router-dom'` | | `imrs→` | `import React, { useState } from 'react'` | | `imrse→` | `import React, { useState, useEffect } from 'react'` | | `redux→` | `import { connect } from 'react-redux'` | From 1edd3eda8cc105201d7c4af5e8717893e5f1c3c0 Mon Sep 17 00:00:00 2001 From: Skyler Dowdy Date: Wed, 11 Mar 2020 10:54:00 -0400 Subject: [PATCH 029/110] Removed aliases I believe this is what you meant --- snippets/snippets.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 7ef92b5..2cef717 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -250,7 +250,7 @@ "import React Router": { "prefix": "imrr", "body": [ - "import { BrowserRouter as BR, Route as R, NavLink as NL } from 'react-router-dom'", + "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", "" ] }, @@ -264,35 +264,35 @@ "import React Browser Router - Route": { "prefix": "imbrr", "body": [ - "import { Route as R } from 'react-router-dom'", + "import { Route } from 'react-router-dom'", "" ] }, "import React Browser Router - Route Combo": { "prefix": "imbrc", "body": [ - "import { Route as R, Switch as S, NavLink as NL, Link as L } from 'react-router-dom'", + "import { Route, Switch, NavLink, Link } from 'react-router-dom'", "" ] }, "import React Browser Router - Switch": { "prefix": "imbrs", "body": [ - "import { Switch as S } from 'react-router-dom'", + "import { Switch } from 'react-router-dom'", "" ] }, "import React Browser Router - Link": { "prefix": "imbrl", "body": [ - "import { Link as L } from 'react-router-dom'", + "import { Link } from 'react-router-dom'", "" ] }, "import React Browser Router - NavLink": { "prefix": "imbrnl", "body": [ - "import { NavLink as NL } from 'react-router-dom'", + "import { NavLink } from 'react-router-dom'", "" ] }, From e94bd2145004873ce2c4c3e3e02c0de9d08e4167 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 11 Mar 2020 17:01:06 +0100 Subject: [PATCH 030/110] Lint README.md --- CHANGELOG.md | 4 ++ README.md | 92 +++++++++++++++++++++--------------------- snippets/snippets.json | 27 +++---------- 3 files changed, 56 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 955f5ec..12d402d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[2.7.0] - 2020-03-11 + +- Add few snippets for react-router + [2.6.0] - 2020-02-23 - Add `rnfs`. diff --git a/README.md b/README.md index 2ceb254..7008a2e 100644 --- a/README.md +++ b/README.md @@ -60,48 +60,48 @@ I.E. `tsrcc` ## React -| Prefix | Method | -| ----------: | --------------------------------------------------------------------------------------| -| `imr→` | `import React from 'react'` | -| `imrd→` | `import ReactDOM from 'react-dom'` | -| `imrc→` | `import React, { Component } from 'react'` | -| `imrcp→` | `import React, { Component } from 'react' & import PropTypes from 'prop-types'` | -| `imrpc→` | `import React, { PureComponent } from 'react'` | -| `imrpcp→` | `import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'` | -| `imrm→` | `import React, { memo } from 'react'` | -| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` | -| `impt→` | `import PropTypes from 'prop-types'` | -| `imrr→` | `import { BrowserRouter as Router, Route, NavLink} from 'react-router-dom'` | -| `imbr→` | `import { BrowserRouter as Router} from 'react-router-dom'` | -| `imbrc→` | `import { Route, Switch, NavLink, Link } from react-router-dom'` | -| `imbrr→` | `import { Route } from 'react-router-dom'` | -| `imbrs→` | `import { Switch } from 'react-router-dom'` | -| `imbrl→` | `import { Link } from 'react-router-dom'` | -| `imbrnl→` | `import { NavLink } from 'react-router-dom'` | -| `imrs→` | `import React, { useState } from 'react'` | -| `imrse→` | `import React, { useState, useEffect } from 'react'` | -| `redux→` | `import { connect } from 'react-redux'` | -| `rconst→` | `constructor(props) with this.state` | -| `rconc→` | `constructor(props, context) with this.state` | -| `est→` | `this.state = { }` | -| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | -| `cdm→` | `componentDidMount = () => { }` | -| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | -| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | -| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | -| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | -| `cwun→` | `componentWillUnmount = () => { }` | -| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | -| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | -| `ren→` | `render() { return( ) }` | -| `sst→` | `this.setState({ })` | -| `ssf→` | `this.setState((state, props) => return { })` | -| `props→` | `this.props.propName` | -| `state→` | `this.state.stateName` | -| `rcontext→` | `const ${1:contextName} = React.createContext()` | -| `cref→` | `this.${1:refName}Ref = React.createRef()` | -| `fref→` | `const ref = React.createRef()` | -| `bnd→` | `this.methodName = this.methodName.bind(this)` | +| Prefix | Method | +| ----------: | ----------------------------------------------------------------------------------- | +| `imr→` | `import React from 'react'` | +| `imrd→` | `import ReactDOM from 'react-dom'` | +| `imrc→` | `import React, { Component } from 'react'` | +| `imrcp→` | `import React, { Component } from 'react' & import PropTypes from 'prop-types'` | +| `imrpc→` | `import React, { PureComponent } from 'react'` | +| `imrpcp→` | `import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'` | +| `imrm→` | `import React, { memo } from 'react'` | +| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` | +| `impt→` | `import PropTypes from 'prop-types'` | +| `imrr→` | `import { BrowserRouter as Router, Route, NavLink} from 'react-router-dom'` | +| `imbr→` | `import { BrowserRouter as Router} from 'react-router-dom'` | +| `imbrc→` | `import { Route, Switch, NavLink, Link } from react-router-dom'` | +| `imbrr→` | `import { Route } from 'react-router-dom'` | +| `imbrs→` | `import { Switch } from 'react-router-dom'` | +| `imbrl→` | `import { Link } from 'react-router-dom'` | +| `imbrnl→` | `import { NavLink } from 'react-router-dom'` | +| `imrs→` | `import React, { useState } from 'react'` | +| `imrse→` | `import React, { useState, useEffect } from 'react'` | +| `redux→` | `import { connect } from 'react-redux'` | +| `rconst→` | `constructor(props) with this.state` | +| `rconc→` | `constructor(props, context) with this.state` | +| `est→` | `this.state = { }` | +| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | +| `cdm→` | `componentDidMount = () => { }` | +| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | +| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | +| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | +| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | +| `cwun→` | `componentWillUnmount = () => { }` | +| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | +| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | +| `ren→` | `render() { return( ) }` | +| `sst→` | `this.setState({ })` | +| `ssf→` | `this.setState((state, props) => return { })` | +| `props→` | `this.props.propName` | +| `state→` | `this.state.stateName` | +| `rcontext→` | `const ${1:contextName} = React.createContext()` | +| `cref→` | `this.${1:refName}Ref = React.createRef()` | +| `fref→` | `const ref = React.createRef()` | +| `bnd→` | `this.methodName = this.methodName.bind(this)` | ## React Hooks @@ -159,11 +159,11 @@ I.E. `tsrcc` | `ptypes→` | `static propTypes = {}` | ## GraphQL -| Prefix | Method | -| --------: | ----------------------------------- | -|`graphql→`|`import { compose, graphql } from react-apollo'`| -| `expgql->`|`export default compose(graphql($1, { name: $2 }))($3)`| +| Prefix | Method | +| ---------: | ------------------------------------------------------- | +| `graphql→` | `import { compose, graphql } from react-apollo'` | +| `expgql->` | `export default compose(graphql($1, { name: $2 }))($3)` | ## Console diff --git a/snippets/snippets.json b/snippets/snippets.json index 2cef717..7a7ceb3 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -256,17 +256,11 @@ }, "import React Browser Router": { "prefix": "imbr", - "body": [ - "import { BrowserRouter as Router } from 'react-router-dom'", - "" - ] + "body": ["import { BrowserRouter as Router } from 'react-router-dom'", ""] }, "import React Browser Router - Route": { "prefix": "imbrr", - "body": [ - "import { Route } from 'react-router-dom'", - "" - ] + "body": ["import { Route } from 'react-router-dom'", ""] }, "import React Browser Router - Route Combo": { "prefix": "imbrc", @@ -277,24 +271,15 @@ }, "import React Browser Router - Switch": { "prefix": "imbrs", - "body": [ - "import { Switch } from 'react-router-dom'", - "" - ] + "body": ["import { Switch } from 'react-router-dom'", ""] }, "import React Browser Router - Link": { "prefix": "imbrl", - "body": [ - "import { Link } from 'react-router-dom'", - "" - ] + "body": ["import { Link } from 'react-router-dom'", ""] }, "import React Browser Router - NavLink": { "prefix": "imbrnl", - "body": [ - "import { NavLink } from 'react-router-dom'", - "" - ] + "body": ["import { NavLink } from 'react-router-dom'", ""] }, "import redux statement": { "prefix": "redux", @@ -1357,7 +1342,7 @@ "\t${1:effect}", "\treturn () => {", "\t\t${2:cleanup}", - "\t};", + "\t}", "}, [${3:input}])" ] }, From cb88c055f412078ab66c1b1613cec3c7a896e45f Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 11 Mar 2020 17:02:54 +0100 Subject: [PATCH 031/110] 2.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7078a6..45f1929 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.6.1", + "version": "2.7.0", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From d4f90d4e1a39f0c4e9a61777d258056ec4b71898 Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Wed, 18 Mar 2020 20:33:35 +0100 Subject: [PATCH 032/110] Added typeof keyword --- snippets/snippets.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 7a7ceb3..c1f8296 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1401,5 +1401,9 @@ "\t};", "}, [${3:input}])" ] + }, + "typeof": { + "prefix": "tpf", + "body": ["typeof ${0}"] } } From 47af8267eca93dd1ccbad99a5a1f785eb5894b2d Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Wed, 18 Mar 2020 20:39:41 +0100 Subject: [PATCH 033/110] Added export type --- snippets/ts-snippets.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index 0709c59..4d77e9a 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -226,5 +226,9 @@ "Export interface": { "prefix": "expint", "body": ["export interface ${1:${TM_FILENAME_BASE}} {$0}"] + }, + "Export type": { + "prefix": "exptp", + "body": ["export type ${1:${TM_FILENAME_BASE}} = {$0}"] } } From f7ee493a48f89812354c276f702f98077346e692 Mon Sep 17 00:00:00 2001 From: Dan Wood Date: Thu, 19 Mar 2020 16:09:37 +0000 Subject: [PATCH 034/110] Add rfcredux and rfreduxp Added equivelant redux components but for function components. --- README.md | 47 ++++++++++++++++++++++++++++++++++ snippets/snippets.json | 58 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/README.md b/README.md index 7008a2e..baa6313 100644 --- a/README.md +++ b/README.md @@ -432,6 +432,53 @@ const mapDispatchToProps = {} export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` +### `rfcredux` + +```javascript +import React, { Component } from 'react' +import { connect } from 'react-redux' + +export const FileName = () => { + return ( +
+ $4 +
+ ) +} + +const mapStateToProps = state => ({}) + +const mapDispatchToProps = {} + +export default connect(mapStateToProps, mapDispatchToProps)(FileName) +``` + +### `rfreduxp` + +```javascript +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import { connect } from 'react-redux' + +export const FileName = () => { + return ( +
+ $4 +
+ ) +} + +FileName.propTypes = { + $2: $3 +} + +const mapStateToProps = state => ({}) + +const mapDispatchToProps = {} + +export default connect(mapStateToProps, mapDispatchToProps)(FileName) +``` + ### `reduxmap` ```javascript diff --git a/snippets/snippets.json b/snippets/snippets.json index c1f8296..3eab669 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -648,6 +648,64 @@ "" ], "description": "Creates a React component class with PropTypes with connected redux and ES7 module system" + },"reactFunctionalCompomentRedux": { + "prefix": "rfcredux", + "body": [ + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "", + "const mapStateToProps = (state) => ({", + "\t", + "})", + "", + "const mapDispatchToProps = {", + "\t", + "}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", + "" + ], + "description": "Creates a React functional component with connected redux and ES7 module system" + }, + "reactFunctionalCompomentReduxPropTypes": { + "prefix": "rfcreduxp", + "body": [ + "import React, { Component } from 'react'", + "import PropTypes from 'prop-types'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {", + "\t${2:prop}: ${3:PropTypes}", + "}", + "", + "const mapStateToProps = (state) => ({", + "\t", + "})", + "", + "const mapDispatchToProps = {", + "\t", + "}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", + "" + ], + "description": "Creates a React functional component with PropTypes with connected redux and ES7 module system" }, "mappingToProps": { "prefix": "reduxmap", From 2e632b74e5d2429cbf1d82da5015b6ad1d208383 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 26 Mar 2020 20:41:01 +0100 Subject: [PATCH 035/110] 2.7.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45f1929..16873cc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.7.0", + "version": "2.7.1", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From 5380016ec1ecd1bf15ece2c0993d13e9d98cf1a3 Mon Sep 17 00:00:00 2001 From: Victor Camnerin Date: Thu, 16 Apr 2020 14:04:27 +0200 Subject: [PATCH 036/110] Add useSelector and useDispatch Proposel for this issue: https://github.com/dsznajder/vscode-es7-javascript-react-snippets/issues/120 --- snippets/snippets.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 3eab669..5ac00b4 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1460,6 +1460,18 @@ "}, [${3:input}])" ] }, + "useSelector": { + "prefix": "useSelector", + "body": [ + "const ${1:state} = useSelector(state => state.${1:state})" + ] + }, + "useDispatch": { + "prefix": "useDispatch", + "body": [ + "const dispatch = useDispatch(${1:function})" + ] + }, "typeof": { "prefix": "tpf", "body": ["typeof ${0}"] From feae4b09f2810966f63468844bb7ea5f5b7fadd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2020 12:51:39 +0000 Subject: [PATCH 037/110] Bump https-proxy-agent from 2.2.1 to 2.2.4 Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.1 to 2.2.4. - [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases) - [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.1...2.2.4) Signed-off-by: dependabot[bot] --- yarn.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index 27d7a89..4b804ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.0.tgz#b0df8d6ef9b5001b2be3a94d909ce3c29a80f9e1" integrity sha512-rx29MMkRdVmzunmiA4lzBYJNnXsW/PhG4kMBy2ATsYaDjGGR75dCFEVVROKpNwlVdcUX3xxlghKQOeDPBJobng== -agent-base@4, agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== +agent-base@4, agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== dependencies: es6-promisify "^5.0.0" @@ -228,9 +228,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" es6-promise@^4.0.3: - version "4.2.6" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f" - integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q== + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== es6-promisify@^5.0.0: version "5.0.0" @@ -387,11 +387,11 @@ http-signature@~1.2.0: sshpk "^1.7.0" https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + version "2.2.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" + integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== dependencies: - agent-base "^4.1.0" + agent-base "^4.3.0" debug "^3.1.0" inflight@^1.0.4: @@ -513,9 +513,9 @@ ms@2.0.0: integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== oauth-sign@~0.9.0: version "0.9.0" From 78bdce56e0348be8c8a6cfed72ad87a9ec7d41ce Mon Sep 17 00:00:00 2001 From: impulse Date: Wed, 20 May 2020 10:16:30 +0200 Subject: [PATCH 038/110] Add ts function components for react-native ^ title --- snippets/ts-snippets.json | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index 4d77e9a..e9692ed 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -223,6 +223,54 @@ ], "description": "Creates a React component class with PropTypes with connected redux and ES7 module system and TypeScript interfaces" }, + "typescriptReactNativeArrowFunctionComponent": { + "prefix": "tsrnf", + "body": [ + "import React from 'react'", + "import { View, Text } from 'react-native'", + "", + "interface Props {", + "\t", + "}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface" + }, + "typescriptReactNativeArrowFunctionComponentWithStyles": { + "prefix": "tsrnfs", + "body": [ + "import React from 'react'", + "import { StyleSheet, Text, View } from 'react-native'", + "", + "interface Props {", + "\t", + "}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})", + "" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet" + }, "Export interface": { "prefix": "expint", "body": ["export interface ${1:${TM_FILENAME_BASE}} {$0}"] From 6102ea077fce273a849a19afecdddb5839afa5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20Figuer=C3=AAdo=20Domingues?= <45567521+bernardodomingues-hotmart@users.noreply.github.com> Date: Tue, 26 May 2020 12:40:32 -0300 Subject: [PATCH 039/110] Add asynchronous test blocks I use the `tit` snipped a lot, but whenever I have async tests, I sometimes forget to add the `async` keyword before the arrow function. It would be great if there were snippets that cover this use case. This PR adds two new snippets the create asynchronous tests: * `testa` -> Creates a `test('should ', async () => {})` block * `tita` -> Creates an `it('should ', async () => {})` block --- snippets/snippets.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 5ac00b4..adebefb 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1234,11 +1234,21 @@ "body": ["test('should $1', () => {", "\t$0", "})", ""], "description": "Testing `test` block" }, + "testAsyncBlock": { + "prefix": "testa", + "body": ["test('should $1', async () => {", "\t$0", "})", ""], + "description": "Testing `asynchronous test` block" + }, "itBlock": { "prefix": "tit", "body": ["it('should $1', () => {", "\t$0", "})", ""], "description": "Testing `it` block" }, + "itAsyncBlock": { + "prefix": "tita", + "body": ["it('should $1', async () => {", "\t$0", "})", ""], + "description": "Testing asynchronous `it` block" + }, "setupReactTest": { "prefix": "stest", "body": [ From 3a1822658d26da0d7213cbfd4b4a821aafe633d8 Mon Sep 17 00:00:00 2001 From: AliRezaBeigy <46004092+AliRezaBeigy@users.noreply.github.com> Date: Sat, 30 May 2020 12:45:35 +0430 Subject: [PATCH 040/110] Update ReactNative snippets --- snippets/snippets.json | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index adebefb..b06695a 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1015,8 +1015,8 @@ ], "description": "Creates a React Native component class with PropTypes with connected redux and ES7 module system" }, - "reactNativeArrowFunctionComponent": { - "prefix": "rnf", + "reactNativeFunctionalExportComponent": { + "prefix": "rnfe", "body": [ "import React from 'react'", "import { View, Text } from 'react-native'", @@ -1033,8 +1033,8 @@ "" ] }, - "reactNativeArrowFunctionComponentWithStyles": { - "prefix": "rnfs", + "reactNativeFunctionalExportComponentWithStyles": { + "prefix": "rnfes", "body": [ "import React from 'react'", "import { StyleSheet, Text, View } from 'react-native'", @@ -1053,6 +1053,40 @@ "" ] }, + "reactNativeFunctionalComponent": { + "prefix": "rnf", + "body": [ + "import React from 'react'", + "import { View, Text } from 'react-native'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "" + ] + }, + "reactNativeFunctionalComponentWithStyles": { + "prefix": "rnfs", + "body": [ + "import React from 'react'", + "import { StyleSheet, Text, View } from 'react-native'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "const styles = StyleSheet.create({})", + "" + ] + }, "reactNativeImport": { "prefix": "imrn", "body": "import { ${1:moduleName} } from 'react-native'" From 43132b9c7c116e1806e2a541243cdb5d47fb9906 Mon Sep 17 00:00:00 2001 From: AliRezaBeigy <46004092+AliRezaBeigy@users.noreply.github.com> Date: Sat, 30 May 2020 12:53:29 +0430 Subject: [PATCH 041/110] Update ReactNative Snippet ReadMe --- CHANGELOG.md | 4 +++ README.md | 72 ++++++++++++++++++++++++++++++++++------------------ package.json | 4 ++- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d402d..74d98b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[2.8.0] - 2020-06-06 + +- Add few snippets for React-Native & Typescript + [2.7.0] - 2020-03-11 - Add few snippets for react-router diff --git a/README.md b/README.md index baa6313..05411c8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This extension provides you JavaScript and React/Redux snippets in ES7 with Babe ## Search command -You can search through snippets with `ES7 snippet search` command which can be run with `CMD + Shift + P` or just use `CMD + Shift + R` keybinding. +You can search through snippets with `ES7 snippet search` command which can be run with `CMD + Shift + P` or just use `CMD + Shift + R` (`CTRL + ALT + R` for Windows & Linux) keybinding. Here is direct link to marketplace [ES7 React/Redux/React-Native/JS Snippets](https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets) @@ -281,7 +281,7 @@ import PropTypes from 'prop-types' export default class FileName extends Component { static propTypes = { - $2: $3 + $2: $3, } render() { @@ -333,7 +333,7 @@ export default $1 import React from 'react' import PropTypes from 'prop-types' -const $1 = props => { +const $1 = (props) => { return
$0
} @@ -401,7 +401,7 @@ export class FileName extends Component { } } -const mapStateToProps = state => ({}) +const mapStateToProps = (state) => ({}) const mapDispatchToProps = {} @@ -417,7 +417,7 @@ import { connect } from 'react-redux' export class FileName extends Component { static propTypes = { - $2: $3 + $2: $3, } render() { @@ -425,7 +425,7 @@ export class FileName extends Component { } } -const mapStateToProps = state => ({}) +const mapStateToProps = (state) => ({}) const mapDispatchToProps = {} @@ -439,14 +439,10 @@ import React, { Component } from 'react' import { connect } from 'react-redux' export const FileName = () => { - return ( -
- $4 -
- ) + return
$4
} -const mapStateToProps = state => ({}) +const mapStateToProps = (state) => ({}) const mapDispatchToProps = {} @@ -461,18 +457,14 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' export const FileName = () => { - return ( -
- $4 -
- ) + return
$4
} FileName.propTypes = { - $2: $3 + $2: $3, } -const mapStateToProps = state => ({}) +const mapStateToProps = (state) => ({}) const mapDispatchToProps = {} @@ -482,7 +474,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(FileName) ### `reduxmap` ```javascript -const mapStateToProps = state => ({}) +const mapStateToProps = (state) => ({}) const mapDispatchToProps = {} ``` @@ -512,6 +504,38 @@ export default class FileName extends Component { import React from 'react' import { View, Text } from 'react-native' +export default function $1() { + return ( + + $2 + + ) +} +``` + +### `rnfs` + +```javascript +import React from 'react' +import { StyleSheet, View, Text } from 'react-native' + +export default function $1() { + return ( + + $2 + + ) +} + +const styles = StyleSheet.create({}) +``` + +### `rnfe` + +```javascript +import React from 'react' +import { View, Text } from 'react-native' + const $1 = () => { return ( @@ -523,7 +547,7 @@ const $1 = () => { export default $1 ``` -### `rnfs` +### `rnfes` ```javascript import React from 'react' @@ -590,7 +614,7 @@ import { connect } from 'react-redux' export class FileName extends Component { static propTypes = { - $2: $3 + $2: $3, } render() { @@ -602,7 +626,7 @@ export class FileName extends Component { } } -const mapStateToProps = state => ({}) +const mapStateToProps = (state) => ({}) const mapDispatchToProps = {} @@ -767,7 +791,7 @@ export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)( import React from 'react' import PropTypes from 'prop-types' -export default WrappedComponent => { +export default (WrappedComponent) => { const hocComponent = ({ ...props }) => hocComponent.propTypes = {} diff --git a/package.json b/package.json index 16873cc..a520351 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,9 @@ "categories": [ "Snippets" ], - "extensionKind": "ui", + "extensionKind": [ + "ui" + ], "main": "./out/index.js", "activationEvents": [ "onCommand:extension.snippetSearch" From 563d6b2783ac0d61c9df277433739d2a53d4a915 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 6 Jun 2020 16:18:40 +0200 Subject: [PATCH 042/110] 2.8.0 --- .vscodeignore | 1 - extension/index.ts | 6 +- package.json | 15 +- tslint.json | 12 - yarn.lock | 803 +-------------------------------------------- 5 files changed, 23 insertions(+), 814 deletions(-) delete mode 100644 tslint.json diff --git a/.vscodeignore b/.vscodeignore index a326a11..116dc6b 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -6,5 +6,4 @@ extension/** vsc-extension-quickstart.md **/tsconfig.json **/tslint.json -**/*.map **/*.ts diff --git a/extension/index.ts b/extension/index.ts index e36127f..5879eac 100644 --- a/extension/index.ts +++ b/extension/index.ts @@ -42,7 +42,7 @@ export function activate(context: vscode.ExtensionContext) { description: description || shortDescription, label: value, value, - body + body, } } ) @@ -50,11 +50,11 @@ export function activate(context: vscode.ExtensionContext) { const options = { matchOnDescription: true, matchOnDetail: true, - placeHolder: 'Search snippet' + placeHolder: 'Search snippet', } const snippet = (await vscode.window.showQuickPick(items, options)) || { - body: '' + body: '', } const activeTextEditor = vscode.window.activeTextEditor const body = diff --git a/package.json b/package.json index a520351..56584eb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.7.1", + "version": "2.8.0", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ @@ -19,7 +19,7 @@ "url": "https://github.com/dsznajder/vscode-es7-javascript-react-snippets" }, "engines": { - "vscode": "^1.22.0" + "vscode": "^1.45.0" }, "categories": [ "Snippets" @@ -76,14 +76,11 @@ "scripts": { "vscode:prepublish": "yarn run compile", "compile": "tsc -p ./", - "watch": "tsc -watch -p ./", - "postinstall": "node ./node_modules/vscode/bin/install", - "test": "yarn run compile && node ./node_modules/vscode/bin/test" + "watch": "tsc -watch -p ./" }, "devDependencies": { - "typescript": "3.4.2", - "vscode": "1.1.33", - "tslint": "5.15.0", - "@types/node": "11.13.0" + "typescript": "3.9.5", + "@types/vscode": "1.45.1", + "@types/node": "14.0.11" } } diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 6b8a7b6..0000000 --- a/tslint.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "rules": { - "no-string-throw": true, - "no-unused-expression": true, - "no-duplicate-variable": true, - "curly": true, - "class-name": true, - "semicolon": [true, "never"], - "triple-equals": true - }, - "defaultSeverity": "warning" -} diff --git a/yarn.lock b/yarn.lock index 4b804ca..0377b10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,792 +2,17 @@ # yarn lockfile v1 -"@types/node@11.13.0": - version "11.13.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.0.tgz#b0df8d6ef9b5001b2be3a94d909ce3c29a80f9e1" - integrity sha512-rx29MMkRdVmzunmiA4lzBYJNnXsW/PhG4kMBy2ATsYaDjGGR75dCFEVVROKpNwlVdcUX3xxlghKQOeDPBJobng== - -agent-base@4, agent-base@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" - integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== - dependencies: - es6-promisify "^5.0.0" - -ajv@^6.5.5: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== - -babel-code-frame@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== - dependencies: - delayed-stream "~1.0.0" - -commander@2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== - -commander@^2.12.1: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -diff@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" - integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== - -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -es6-promise@^4.0.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.1, glob@^7.1.2: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -growl@1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" - integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.0: - version "5.1.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== - dependencies: - ajv "^6.5.5" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== - dependencies: - agent-base "4" - debug "3.1.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-proxy-agent@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" - integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== - dependencies: - agent-base "^4.3.0" - debug "^3.1.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@^3.13.0: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -mime-db@~1.38.0: - version "1.38.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" - integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.22" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" - integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== - dependencies: - mime-db "~1.38.0" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -mkdirp@0.5.1, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mocha@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" - integrity sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA== - dependencies: - browser-stdout "1.3.0" - commander "2.11.0" - debug "3.1.0" - diff "3.3.1" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.3" - he "1.1.1" - mkdirp "0.5.1" - supports-color "4.4.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -psl@^1.1.24: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" - integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== - -punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -querystringify@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" - integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== - -request@^2.88.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -resolve@^1.3.2: - version "1.10.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" - integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== - dependencies: - path-parse "^1.0.6" - -safe-buffer@^5.0.1, safe-buffer@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^5.3.0, semver@^5.4.1: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== - -source-map-support@^0.5.0: - version "0.5.11" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.11.tgz#efac2ce0800355d026326a0ca23e162aeac9a4e2" - integrity sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -supports-color@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" - integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== - dependencies: - has-flag "^2.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - -tslib@^1.8.0, tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tslint@5.15.0: - version "5.15.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.15.0.tgz#6ffb180986d63afa1e531feb2a134dbf961e27d3" - integrity sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA== - dependencies: - babel-code-frame "^6.22.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^3.2.0" - glob "^7.1.1" - js-yaml "^3.13.0" - minimatch "^3.0.4" - mkdirp "^0.5.1" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.29.0" - -tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -typescript@3.4.2: - version "3.4.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.2.tgz#9ed4e6475d906f589200193be056f5913caed481" - integrity sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A== - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -url-parse@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.4.tgz#cac1556e95faa0303691fec5cf9d5a1bc34648f8" - integrity sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg== - dependencies: - querystringify "^2.0.0" - requires-port "^1.0.0" - -uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vscode-test@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/vscode-test/-/vscode-test-0.1.5.tgz#250534f90e78d37a84419a00f9bd15341e1a4f8f" - integrity sha512-s+lbF1Dtasc0yXVB9iQTexBe2JK6HJAUJe3fWezHKIjq+xRw5ZwCMEMBaonFIPy7s95qg2HPTRDR5W4h4kbxGw== - dependencies: - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - -vscode@1.1.33: - version "1.1.33" - resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.33.tgz#e05d5ca25eb35d799fc20622af7c7a561abf6fba" - integrity sha512-sXedp2oF6y4ZvqrrFiZpeMzaCLSWV+PpYkIxjG/iYquNZ9KrLL2LujltGxPLvzn49xu2sZkyC+avVNFgcJD1Iw== - dependencies: - glob "^7.1.2" - mocha "^4.0.1" - request "^2.88.0" - semver "^5.4.1" - source-map-support "^0.5.0" - url-parse "^1.4.4" - vscode-test "^0.1.4" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +"@types/node@14.0.11": + version "14.0.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.11.tgz#61d4886e2424da73b7b25547f59fdcb534c165a3" + integrity sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg== + +"@types/vscode@1.45.1": + version "1.45.1" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.45.1.tgz#672fb8c2cc33cf14cd4d3bdaa19bb294fe2b2706" + integrity sha512-0NO9qrrEJBO8FsqHCrFMgR2suKnwCsKBWvRSb2OzH5gs4i3QO5AhEMQYrSzDbU/wLPt7N617/rN9lPY213gmwg== + +typescript@3.9.5: + version "3.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" + integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== From a61e12c6b7dd359174e37a9ac6326d2a8618c056 Mon Sep 17 00:00:00 2001 From: Paulo Eduardo Rezende Date: Sun, 7 Jun 2020 21:19:25 -0300 Subject: [PATCH 043/110] chore: update install instructions --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index 05411c8..760ded8 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,50 @@ This extension provides you JavaScript and React/Redux snippets in ES7 with Babel plugin features for [VS Code](https://code.visualstudio.com/) +## Installation + +##### Visual Studio Marketplace + +Launch _Quick Open_: + +- Linux `Ctrl+P` +- macOS `⌘P` +- Windows `Ctrl+P` + +Paste the following command and press `Enter`: + +```shell +ext install dsznajder.es7-react-js-snippets +``` + +##### GitHub Repository Clone + +Change to your `.vscode/extensions` [VS Code extensions directory](https://code.visualstudio.com/docs/extensions/install-extension#_side-loading). +Depending on your platform it is located in the following folders: + +- **Linux** `~/.vscode/extensions` +- **macOs** `~/.vscode/extensions` +- **Windows** `%USERPROFILE%\.vscode\extensions` + +Clone the Material Theme repository as `dsznajder.es7-react-js-snippets`: + +```shell +git clone https://github.com/dsznajder/vscode-es7-javascript-react-snippets.git dsznajder.es7-react-js-snippets +``` + +##### Conquer of Completion + +It is possible to use this package in your vim/neovim text editor, to make this possible, make sure you have the `coc.nvim` previously configured, then add this command to your `init.vim` + +``` +Plug 'dsznajder/vscode-es7-javascript-react-snippets', { + \ 'do': 'yarn install --frozen-lockfile && yarn compile' } +``` + +Update your vim / neovim settings with `:source %` and then install the new package with `:PlugInstall` + +Note: This example uses `vim-plug` as a package manager, feel free to use some other + ## Search command You can search through snippets with `ES7 snippet search` command which can be run with `CMD + Shift + P` or just use `CMD + Shift + R` (`CTRL + ALT + R` for Windows & Linux) keybinding. From 33dc1ffa598bc6472b0d40fb269e7061c01d32b0 Mon Sep 17 00:00:00 2001 From: Tej Date: Sun, 14 Jun 2020 23:06:38 -0400 Subject: [PATCH 044/110] add OS shortcut links --- README.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 760ded8..985e0d8 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ This extension provides you JavaScript and React/Redux snippets in ES7 with Babe ## Installation -##### Visual Studio Marketplace +### Visual Studio Marketplace Launch _Quick Open_: -- Linux `Ctrl+P` -- macOS `⌘P` -- Windows `Ctrl+P` +- [_Linux_](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf): `Ctrl+P` +- [_macOS_](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf): `⌘P` +- [_Windows_](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf): `Ctrl+P` Paste the following command and press `Enter`: @@ -23,14 +23,14 @@ Paste the following command and press `Enter`: ext install dsznajder.es7-react-js-snippets ``` -##### GitHub Repository Clone +### GitHub Repository Clone Change to your `.vscode/extensions` [VS Code extensions directory](https://code.visualstudio.com/docs/extensions/install-extension#_side-loading). Depending on your platform it is located in the following folders: -- **Linux** `~/.vscode/extensions` -- **macOs** `~/.vscode/extensions` -- **Windows** `%USERPROFILE%\.vscode\extensions` +- _Linux_: `~/.vscode/extensions` +- _macOS_: `~/.vscode/extensions` +- _Windows_: `%USERPROFILE%\.vscode\extensions` Clone the Material Theme repository as `dsznajder.es7-react-js-snippets`: @@ -38,13 +38,12 @@ Clone the Material Theme repository as `dsznajder.es7-react-js-snippets`: git clone https://github.com/dsznajder/vscode-es7-javascript-react-snippets.git dsznajder.es7-react-js-snippets ``` -##### Conquer of Completion +### Conquer of Completion It is possible to use this package in your vim/neovim text editor, to make this possible, make sure you have the `coc.nvim` previously configured, then add this command to your `init.vim` -``` -Plug 'dsznajder/vscode-es7-javascript-react-snippets', { - \ 'do': 'yarn install --frozen-lockfile && yarn compile' } +```shell +Plug 'dsznajder/vscode-es7-javascript-react-snippets', { \ 'do': 'yarn install --frozen-lockfile && yarn compile' } ``` Update your vim / neovim settings with `:source %` and then install the new package with `:PlugInstall` From ff29c026b48ea117dc03c4f6f8f3d4174590c7de Mon Sep 17 00:00:00 2001 From: Niklas Lindroos Date: Fri, 26 Jun 2020 11:34:39 +0300 Subject: [PATCH 045/110] New ts rn snippet with named props interface and correct ts typings added. --- snippets/ts-snippets.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index e9692ed..be440b8 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -246,6 +246,29 @@ ], "description": "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface" }, + "typescriptReactNativeArrowFunctionComponentNamedProps": { + "prefix": "tsrnfi", + "body": [ + "import React from 'react'", + "import { View } from 'react-native'", + "", + "interface ${1:${TM_FILENAME_BASE}}Props {", + "\t", + "}", + "", + "const ${1:${TM_FILENAME_BASE}}: React.FunctionComponent<${1:${TM_FILENAME_BASE}}Props> = (props) => {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface" + }, "typescriptReactNativeArrowFunctionComponentWithStyles": { "prefix": "tsrnfs", "body": [ From bd84e45ea271f79089ac1f9f078508638b4aee96 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 4 Jul 2020 11:10:59 +0200 Subject: [PATCH 046/110] v2.8.2 --- package.json | 8 ++++---- yarn.lock | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 56584eb..2d6242a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.8.0", + "version": "2.8.2", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ @@ -79,8 +79,8 @@ "watch": "tsc -watch -p ./" }, "devDependencies": { - "typescript": "3.9.5", - "@types/vscode": "1.45.1", - "@types/node": "14.0.11" + "typescript": "3.9.6", + "@types/vscode": "^1.45.0", + "@types/node": "^14.0.14" } } diff --git a/yarn.lock b/yarn.lock index 0377b10..d1f4ed6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,17 +2,17 @@ # yarn lockfile v1 -"@types/node@14.0.11": - version "14.0.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.11.tgz#61d4886e2424da73b7b25547f59fdcb534c165a3" - integrity sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg== +"@types/node@^14.0.14": + version "14.0.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.14.tgz#24a0b5959f16ac141aeb0c5b3cd7a15b7c64cbce" + integrity sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ== -"@types/vscode@1.45.1": - version "1.45.1" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.45.1.tgz#672fb8c2cc33cf14cd4d3bdaa19bb294fe2b2706" - integrity sha512-0NO9qrrEJBO8FsqHCrFMgR2suKnwCsKBWvRSb2OzH5gs4i3QO5AhEMQYrSzDbU/wLPt7N617/rN9lPY213gmwg== +"@types/vscode@^1.45.0": + version "1.46.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.46.0.tgz#53f2075986e901ed25cd1ec5f3ffa5db84a111b3" + integrity sha512-8m9wPEB2mcRqTWNKs9A9Eqs8DrQZt0qNFO8GkxBOnyW6xR//3s77SoMgb/nY1ctzACsZXwZj3YRTDsn4bAoaUw== -typescript@3.9.5: - version "3.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" - integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== +typescript@3.9.6: + version "3.9.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a" + integrity sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw== From 9ee63483eab6c38409b7522a27491dba06345944 Mon Sep 17 00:00:00 2001 From: Jeff Sutherland Date: Sat, 1 Aug 2020 09:43:22 -0700 Subject: [PATCH 047/110] fix vim plug in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 985e0d8..aa6671f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ git clone https://github.com/dsznajder/vscode-es7-javascript-react-snippets.git It is possible to use this package in your vim/neovim text editor, to make this possible, make sure you have the `coc.nvim` previously configured, then add this command to your `init.vim` ```shell -Plug 'dsznajder/vscode-es7-javascript-react-snippets', { \ 'do': 'yarn install --frozen-lockfile && yarn compile' } +Plug 'dsznajder/vscode-es7-javascript-react-snippets', { 'do': 'yarn install --frozen-lockfile && yarn compile' } ``` Update your vim / neovim settings with `:source %` and then install the new package with `:PlugInstall` From ae0b7e671a4046470d9bab8f5aa54cb6cb920b57 Mon Sep 17 00:00:00 2001 From: Heeryong Date: Fri, 14 Aug 2020 19:27:22 +0900 Subject: [PATCH 048/110] Add tsrafc --- snippets/snippets.json | 11 ++++------- snippets/ts-snippets.json | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index b06695a..4327ae2 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -648,7 +648,8 @@ "" ], "description": "Creates a React component class with PropTypes with connected redux and ES7 module system" - },"reactFunctionalCompomentRedux": { + }, + "reactFunctionalCompomentRedux": { "prefix": "rfcredux", "body": [ "import React, { Component } from 'react'", @@ -1506,15 +1507,11 @@ }, "useSelector": { "prefix": "useSelector", - "body": [ - "const ${1:state} = useSelector(state => state.${1:state})" - ] + "body": ["const ${1:state} = useSelector(state => state.${1:state})"] }, "useDispatch": { "prefix": "useDispatch", - "body": [ - "const dispatch = useDispatch(${1:function})" - ] + "body": ["const dispatch = useDispatch(${1:function})"] }, "typeof": { "prefix": "tpf", diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index be440b8..81c5f27 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -119,6 +119,26 @@ ], "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" }, + "typeScriptReactArrowFunctionComponent": { + "prefix": "tsrafc", + "body": [ + "import React from 'react'", + "", + "interface Props {", + "\t", + "}", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" + }, "typeScriptReactClassPureComponent": { "prefix": "tsrpc", "body": [ From 5065a7c978620414eeba65e6b67e9e41de496725 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 14 Aug 2020 12:55:45 +0200 Subject: [PATCH 049/110] 2.8.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d6242a..0b773bd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.8.2", + "version": "2.8.3", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From d18c01aff7966c965cba1d96c6a4670bfb5e806d Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 11 Sep 2020 14:35:52 +0200 Subject: [PATCH 050/110] Enable extension on workspaces (i.e. GitHub codespaces). --- CHANGELOG.md | 4 ++++ package.json | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74d98b6..a8a016b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[3.0.0] - 2020-09-11 + +- Enable extension on workspaces (i.e. GitHub codespaces). + [2.8.0] - 2020-06-06 - Add few snippets for React-Native & Typescript diff --git a/package.json b/package.json index 0b773bd..f559cab 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "Snippets" ], "extensionKind": [ - "ui" + "ui", + "workspace" ], "main": "./out/index.js", "activationEvents": [ From ef5df7821b838b141f9cba2e7de98a309994019c Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 11 Sep 2020 14:36:50 +0200 Subject: [PATCH 051/110] 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f559cab..12439f3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "2.8.3", + "version": "3.0.0", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From a7b84d5d76f2197377e9e2db8e18a73dc3b35df0 Mon Sep 17 00:00:00 2001 From: KingxBeta Date: Wed, 14 Oct 2020 19:07:47 +0800 Subject: [PATCH 052/110] Update snippets.json do not insert new line at the end of `anfn`, it is frequently used in inline style, insert new line cause confusion. --- snippets/snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 4327ae2..14f280b 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -78,7 +78,7 @@ }, "anonymousFunction": { "prefix": "anfn", - "body": ["(${1:params}) => {", "\t${2}", "}", ""], + "body": ["(${1:params}) => {", "\t${2}", "}"], "description": "Creates an anonymous function in ES7 syntax" }, "namedFunction": { From 03a84d1384bbd5f0c9ef0b806311e4974b75c3d9 Mon Sep 17 00:00:00 2001 From: "K.C" Date: Thu, 12 Nov 2020 21:47:02 +0300 Subject: [PATCH 053/110] Add redux-toolkit createSlice --- README.md | 1 + snippets/snippets.json | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/README.md b/README.md index aa6671f..0fac955 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,7 @@ I.E. `tsrcc` | `rxconst→` | `export const $1 = '$1'` | | `rxreducer→` | `redux reducer template` | | `rxselect→` | `redux selector template` | +| `rxslice→` | `redux slice template` | ## PropTypes diff --git a/snippets/snippets.json b/snippets/snippets.json index 14f280b..5cf9645 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -885,6 +885,29 @@ "" ] }, + "reduxSlice": { + "prefix": "rxslice", + "body": [ + "import { createSlice } from '@reduxjs/toolkit'", + "", + "const initialState = {", + "", + "}", + "", + "const ${1:${TM_FILENAME_BASE}} = createSlice({", + "\tname: ${2:sliceName},", + "\tinitialState,", + "\treducers: {", + "\t", + "\t}", + "});", + "", + "export const {", + "", + "} = ${1:${TM_FILENAME_BASE}}.actions", + "export default ${1:${TM_FILENAME_BASE}}.reducer" + ] + }, "reactNativeComponent": { "prefix": "rnc", "body": [ From 511c055bca979dbe0c7b6509c908a39a579264d6 Mon Sep 17 00:00:00 2001 From: Anees Date: Mon, 14 Dec 2020 12:59:16 +0530 Subject: [PATCH 054/110] Snippet update for react 17 with _prefix --- snippets/snippets.json | 303 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 303 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 5cf9645..2e6306f 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1539,5 +1539,308 @@ "typeof": { "prefix": "tpf", "body": ["typeof ${0}"] + }, + "_reactFunctionalExportComponent": { + "prefix": "_rfce", + "body": [ + "function ${1:${TM_FILENAME_BASE}}() {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React 17 Functional Component with ES7 module system" + }, + "_reactFunctionalComponent": { + "prefix": "_rfc", + "body": [ + "export default function ${1:${TM_FILENAME_BASE}}() {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "" + ], + "description": "Creates a React 17 Functional Component with ES7 module system" + }, + "_reactFunctionalComponentWithPropTypes": { + "prefix": "_rfcp", + "body": [ + "import PropTypes from 'prop-types'", + "", + "function ${1:${TM_FILENAME_BASE}}(props) {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {", + "", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "" + ], + "description": "Creates a React 17 Functional Component with ES7 module system with PropTypes" + }, + "_reactArrowFunctionExportComponent": { + "prefix": "_rafce", + "body": [ + "const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React 17 Arrow Function Component with ES7 module system" + }, + "_reactArrowFunctionComponent": { + "prefix": "_rafc", + "body": [ + "export const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "" + ], + "description": "Creates a React 17 Arrow Function Component with ES7 module system" + }, + "_reactArrowFunctionComponentWithPropTypes": { + "prefix": "_rafcp", + "body": [ + "import PropTypes from 'prop-types'", + "", + "const ${1:${TM_FILENAME_BASE}} = props => {", + "\treturn (", + "\t\t
", + "\t\t\t$0", + "\t\t
", + "\t)", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {", + "", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React 17 Arrow Function Component with ES7 module system with PropTypes" + }, + "_reactNativeFunctionalExportComponent": { + "prefix": "_rnfe", + "body": [ + "import { View, Text } from 'react-native'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ] + }, + "_reactNativeFunctionalExportComponentWithStyles": { + "prefix": "_rnfes", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})", + "" + ] + }, + "_reactNativeFunctionalComponent": { + "prefix": "_rnf", + "body": [ + "import { View, Text } from 'react-native'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "" + ] + }, + "_reactNativeFunctionalComponentWithStyles": { + "prefix": "_rnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "const styles = StyleSheet.create({})", + "" + ] + }, + "_setupReactTest": { + "prefix": "_stest", + "body": [ + "import renderer from 'react-test-renderer'", + "", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + "\tconst defaultProps = {}", + "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + "\ttest('render', () => {", + "\t\texpect(wrapper).toMatchSnapshot()", + "\t})", + "})", + "" + ] + }, + "_setupReactNativeTest": { + "prefix": "_sntest", + "body": [ + "import 'react-native'", + "import renderer from 'react-test-renderer'", + "", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + "\tconst defaultProps = {}", + "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + "\ttest('render', () => {", + "\t\texpect(wrapper).toMatchSnapshot()", + "\t})", + "})", + "" + ] + }, + "_setupReactComponentTestWithRedux": { + "prefix": "_srtest", + "body": [ + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from 'src/store'", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + "\tconst defaultProps = {}", + "\tconst wrapper = renderer.create(", + "\t\t", + "\t\t <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + "\t\t,", + "\t)", + "", + "\ttest('render', () => {", + "\t\texpect(wrapper).toMatchSnapshot()", + "\t})", + "})", + "" + ], + "description": "Create test component" + }, + "_setupReactNativeTestWithRedux": { + "prefix": "_snrtest", + "body": [ + "import 'react-native'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from 'src/store'", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + "\tconst defaultProps = {}", + "\tconst wrapper = renderer.create(", + "\t\t", + "\t\t\t<${1:${TM_FILENAME_BASE}} {...defaultProps} />", + "\t\t,", + "\t)", + "", + "\ttest('render', () => {", + "\t\texpect(wrapper).toMatchSnapshot()", + "\t})", + "})", + "" + ] + }, + "_hocComponentWithRedux": { + "prefix": "_hocredux", + "body": [ + "import PropTypes from 'prop-types'", + "import { connect } from 'react-redux'", + "", + "export const mapStateToProps = state => ({", + "", + "})", + "", + "export const mapDispatchToProps = {", + " ", + "}", + "", + "export const ${1:hocComponentName} = (WrappedComponent) => {", + "\tconst hocComponent = ({ ...props }) => ", + "", + "\thocComponent.propTypes = {", + "\t}", + "", + "\treturn hocComponent", + "}", + "", + "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent))", + "" + ] + }, + "_hocComponent": { + "prefix": "_hoc", + "body": [ + "import PropTypes from 'prop-types'", + "", + "export default (WrappedComponent) => {", + "\tconst hocComponent = ({ ...props }) => ", + "", + "\thocComponent.propTypes = {", + "\t}", + "", + "\treturn hocComponent", + "}", + "" + ] } } From 55f491f2099a87b38c286ee7250b28c64d841dc5 Mon Sep 17 00:00:00 2001 From: Vladislav <49246934+Huzzky@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:01:23 +0300 Subject: [PATCH 055/110] delete { Component } from rfcredux and rfcreduxp delete { Component } from rfcredux and rfcreduxp, because these are functional components and do not need them Component --- snippets/snippets.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 2e6306f..29d7b88 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -652,10 +652,10 @@ "reactFunctionalCompomentRedux": { "prefix": "rfcredux", "body": [ - "import React, { Component } from 'react'", + "import React from 'react'", "import { connect } from 'react-redux'", "", - "export const ${1:${TM_FILENAME_BASE}} = () => {", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", "\treturn (", "\t\t
", "\t\t\t$0", @@ -679,11 +679,11 @@ "reactFunctionalCompomentReduxPropTypes": { "prefix": "rfcreduxp", "body": [ - "import React, { Component } from 'react'", + "import React from 'react'", "import PropTypes from 'prop-types'", "import { connect } from 'react-redux'", "", - "export const ${1:${TM_FILENAME_BASE}} = () => {", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", "\treturn (", "\t\t
", "\t\t\t$0", From 35362beda7f534534cb4861cfb6a5dea6c374376 Mon Sep 17 00:00:00 2001 From: Vladislav <49246934+Huzzky@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:05:55 +0300 Subject: [PATCH 056/110] Update snippets.json --- snippets/snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 29d7b88..15961c5 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -692,7 +692,7 @@ "}", "", "${1:${TM_FILENAME_BASE}}.propTypes = {", - "\t${2:prop}: ${3:PropTypes}", + "\t${2:props}: ${3:PropTypes}", "}", "", "const mapStateToProps = (state) => ({", From cb7b74128956bc39cead919438182f55a69bf63f Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 18 Dec 2020 17:27:34 +0100 Subject: [PATCH 057/110] Add couple of snippets and React 17 components --- .gitignore | 1 + CHANGELOG.md | 4 ++++ README.md | 2 ++ 3 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 33a91d9..23afddd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules .vscode-test/ *.vsix *.log +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index a8a016b..56298c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[3.1.0] - 2020-12-18 + +- Add couple of snippets and React 17 components + [3.0.0] - 2020-09-11 - Enable extension on workspaces (i.e. GitHub codespaces). diff --git a/README.md b/README.md index 0fac955..16ea37d 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,8 @@ I.E. `tsrcc` ## React Components +### Note for React 17 use `_` prefix. Currently workaround for future options. + ### `rcc` ```javascript From e359db82a7cf4dde31fb87b69c6b280bc7f48bb0 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 18 Dec 2020 17:27:57 +0100 Subject: [PATCH 058/110] 3.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 12439f3..c67b620 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "3.0.0", + "version": "3.1.0", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From 4dc37edf61f28f116cdedc2fd1c0ab1fc52cdcee Mon Sep 17 00:00:00 2001 From: PrashoonB Date: Fri, 15 Jan 2021 18:09:55 +0530 Subject: [PATCH 059/110] Added snippets for importing useEffect and useRef. --- snippets/snippets.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 15961c5..f16401f 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -239,6 +239,14 @@ "prefix": "imrs", "body": ["import React, { useState } from 'react'", ""] }, + "import React, {useEffect}": { + "prefix": "imre", + "body": ["import React, { useEffect } from 'react'", ""] + }, + "import React, {useRef}": { + "prefix": "imrr", + "body": ["import React, { useRef } from 'react'", ""] + }, "import React, {useState, useEffect}": { "prefix": "imrse", "body": ["import React, { useState, useEffect } from 'react'", ""] From 29f639c65da4e0bf503c73c8ac8e5bce7c830fc1 Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Sun, 31 Jan 2021 00:34:23 +0000 Subject: [PATCH 060/110] use string template literals for console snippets with string arguments --- README.md | 6 +++--- snippets/snippets.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 16ea37d..cb99c89 100644 --- a/README.md +++ b/README.md @@ -214,9 +214,9 @@ I.E. `tsrcc` | Prefix | Method | | -----: | ----------------------------------- | | `clg→` | `console.log(object)` | -| `clo→` | `console.log("object", object)` | -| `ctm→` | `console.time("timeId")` | -| `cte→` | `console.timeEnd("timeId")` | +| `clo→` | ```console.log(`object`, object)``` | +| `ctm→` | ```console.time(`timeId`)``` | +| `cte→` | ```console.timeEnd(`timeId`)``` | | `cas→` | `console.assert(expression,object)` | | `ccl→` | `console.clear()` | | `cco→` | `console.count(label)` | diff --git a/snippets/snippets.json b/snippets/snippets.json index f16401f..366092e 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -158,17 +158,17 @@ }, "consoleLogObject": { "prefix": "clo", - "body": "console.log('${1:object}', ${1:object})", + "body": "console.log(`${1:object}`, ${1:object})", "description": "Logs property with name." }, "consoleTime": { "prefix": "ctm", - "body": "console.time('${1:object}')", + "body": "console.time(`${1:object}`)", "description": "Console time wrapper" }, "consoleTimeEnd": { "prefix": "cte", - "body": "console.timeEnd('${1:object}')", + "body": "console.timeEnd(`${1:object}`)", "description": "Console time end wrapper" }, "consoleWarn": { From 5e7210d0ad3b78b7b6ea9904b1473f249583f150 Mon Sep 17 00:00:00 2001 From: Piyush <63099829+41y08h@users.noreply.github.com> Date: Fri, 26 Feb 2021 21:17:33 +0530 Subject: [PATCH 061/110] Add snippet for react custom hook --- snippets/snippets.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 366092e..87bbe6d 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1850,5 +1850,17 @@ "}", "" ] - } + }, + "reactCustomHook": { + "prefix": "rch", + "body": [ + "import {$1} from 'react'", + "", + "export default function ${2:${TM_FILENAME_BASE}}($3) => {", + "\t$4", + "}", + "" + ], + "description": "Creates a React Custom Hook with ES7 module system" + } } From 6f06374ea80270b71d2606eeac6cc496c9c8bda6 Mon Sep 17 00:00:00 2001 From: Piyush <63099829+41y08h@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:36:27 +0530 Subject: [PATCH 062/110] Fix indenting and syntax --- snippets/snippets.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 87bbe6d..3801c08 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1852,15 +1852,15 @@ ] }, "reactCustomHook": { - "prefix": "rch", - "body": [ - "import {$1} from 'react'", - "", - "export default function ${2:${TM_FILENAME_BASE}}($3) => {", - "\t$4", - "}", - "" - ], - "description": "Creates a React Custom Hook with ES7 module system" - } + "prefix": "rch", + "body": [ + "import {$1} from 'react'", + "", + "export default function ${2:${TM_FILENAME_BASE}}($3) {", + "\t$4", + "}", + "" + ], + "description": "Creates a React Custom Hook with ES7 module system" + }, } From 7939c22b38a412badeb3798d718c1484f54c9702 Mon Sep 17 00:00:00 2001 From: Piyush <63099829+41y08h@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:37:42 +0530 Subject: [PATCH 063/110] Fix json format --- snippets/snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 3801c08..eb08707 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1862,5 +1862,5 @@ "" ], "description": "Creates a React Custom Hook with ES7 module system" - }, + } } From 4cfa1fc5056f8f51f6a54056e0f08fa516c96466 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 13 Mar 2021 12:15:10 +0100 Subject: [PATCH 064/110] Added CodeStream sponsor to README.md --- README.md | 58 ++++++++++++++++++++++-------------------- snippets/snippets.json | 11 ++++---- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index cb99c89..5012249 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# VS Code ES7 React/Redux/React-Native/JS snippets - [![Version](https://vsmarketplacebadge.apphb.com/version/dsznajder.es7-react-js-snippets.svg)](https://vsmarketplacebadge.apphb.com/version-short/dsznajder.es7-react-js-snippets.svg) [![Install](https://vsmarketplacebadge.apphb.com/installs/dsznajder.es7-react-js-snippets.svg)](https://vsmarketplacebadge.apphb.com/installs-short/dsznajder.es7-react-js-snippets.svg) [![Downloads](https://vsmarketplacebadge.apphb.com/downloads/dsznajder.es7-react-js-snippets.svg)](https://vsmarketplacebadge.apphb.com/downloads-short/dsznajder.es7-react-js-snippets.svg) [![Ratings](https://vsmarketplacebadge.apphb.com/rating-short/dsznajder.es7-react-js-snippets.svg)](https://vsmarketplacebadge.apphb.com/rating-short/dsznajder.es7-react-js-snippets.svg) -This extension provides you JavaScript and React/Redux snippets in ES7 with Babel plugin features for [VS Code](https://code.visualstudio.com/) +# VS Code ES7 React/Redux/React-Native/JS snippets + +JavaScript and React/Redux snippets in ES7+ with Babel plugin features for [VS Code](https://code.visualstudio.com/) ## Installation @@ -23,20 +23,12 @@ Paste the following command and press `Enter`: ext install dsznajder.es7-react-js-snippets ``` -### GitHub Repository Clone +# Sponsors -Change to your `.vscode/extensions` [VS Code extensions directory](https://code.visualstudio.com/docs/extensions/install-extension#_side-loading). -Depending on your platform it is located in the following folders: +


+Manage pull requests and conduct code reviews in your IDE with full source-tree context. Comment on any line, not just the diffs. Use jump-to-definition, your favorite keybindings, and code intelligence with more of your workflow.
Learn More

-- _Linux_: `~/.vscode/extensions` -- _macOS_: `~/.vscode/extensions` -- _Windows_: `%USERPROFILE%\.vscode\extensions` - -Clone the Material Theme repository as `dsznajder.es7-react-js-snippets`: - -```shell -git clone https://github.com/dsznajder/vscode-es7-javascript-react-snippets.git dsznajder.es7-react-js-snippets -``` +
### Conquer of Completion @@ -50,12 +42,16 @@ Update your vim / neovim settings with `:source %` and then install the new pack Note: This example uses `vim-plug` as a package manager, feel free to use some other +
+ ## Search command You can search through snippets with `ES7 snippet search` command which can be run with `CMD + Shift + P` or just use `CMD + Shift + R` (`CTRL + ALT + R` for Windows & Linux) keybinding. Here is direct link to marketplace [ES7 React/Redux/React-Native/JS Snippets](https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets) +
+ ## Supported languages (file extensions) - JavaScript (.js) @@ -72,7 +68,11 @@ _TypeScript_ has own components and own snippets. Use search or just type `ts` b I.E. `tsrcc` -## Basic Methods +React 17 is currently supported by `_` prefix. + +
+ +### Basic Methods | Prefix | Method | | ------: | --------------------------------------------------- | @@ -101,7 +101,7 @@ I.E. `tsrcc` | `cp→` | `const { } = this.props` | | `cs→` | `const { } = this.state` | -## React +### React | Prefix | Method | | ----------: | ----------------------------------------------------------------------------------- | @@ -146,18 +146,22 @@ I.E. `tsrcc` | `fref→` | `const ref = React.createRef()` | | `bnd→` | `this.methodName = this.methodName.bind(this)` | -## React Hooks +### React Hooks - All hooks from [official docs](https://reactjs.org/docs/hooks-reference.html) are added with hook name prefix. -## React Native +| Prefix | Method | +| -----: | ----------------------------------- | +| `rch→` | `import { $1 } from 'react-native'` | + +### React Native | Prefix | Method | | ---------: | -------------------------------------- | | `imrn→` | `import { $1 } from 'react-native'` | | `rnstyle→` | `const styles = StyleSheet.create({})` | -## Redux +### Redux | Prefix | Method | | -----------: | ------------------------- | @@ -167,7 +171,7 @@ I.E. `tsrcc` | `rxselect→` | `redux selector template` | | `rxslice→` | `redux slice template` | -## PropTypes +### PropTypes | Prefix | Method | | --------: | ---------------------------------------- | @@ -202,21 +206,21 @@ I.E. `tsrcc` | `ptany→` | `PropTypes.any` | | `ptypes→` | `static propTypes = {}` | -## GraphQL +### GraphQL | Prefix | Method | | ---------: | ------------------------------------------------------- | | `graphql→` | `import { compose, graphql } from react-apollo'` | | `expgql->` | `export default compose(graphql($1, { name: $2 }))($3)` | -## Console +### Console | Prefix | Method | | -----: | ----------------------------------- | | `clg→` | `console.log(object)` | -| `clo→` | ```console.log(`object`, object)``` | -| `ctm→` | ```console.time(`timeId`)``` | -| `cte→` | ```console.timeEnd(`timeId`)``` | +| `clo→` | `` console.log(`object`, object) `` | +| `ctm→` | `` console.time(`timeId`) `` | +| `cte→` | `` console.timeEnd(`timeId`) `` | | `cas→` | `console.assert(expression,object)` | | `ccl→` | `console.clear()` | | `cco→` | `console.count(label)` | @@ -228,7 +232,7 @@ I.E. `tsrcc` | `cwa→` | `console.warn` | | `cin→` | `console.info` | -## React Components +### React Components ### Note for React 17 use `_` prefix. Currently workaround for future options. diff --git a/snippets/snippets.json b/snippets/snippets.json index eb08707..9807929 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1854,12 +1854,11 @@ "reactCustomHook": { "prefix": "rch", "body": [ - "import {$1} from 'react'", - "", - "export default function ${2:${TM_FILENAME_BASE}}($3) {", - "\t$4", - "}", - "" + "const ${1:${TM_FILENAME_BASE}} = () => {", + "\t$2", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Custom Hook with ES7 module system" } From 2f98253dbf223fd59e04e44c07baf4c94079e71a Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 13 Mar 2021 12:15:17 +0100 Subject: [PATCH 065/110] 3.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c67b620..05aa8a2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "3.1.0", + "version": "3.1.1", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ From 83b7f03e84f267fc791c8c7fd9acf32a1172a21a Mon Sep 17 00:00:00 2001 From: Jaime Rios Date: Fri, 4 Jun 2021 07:18:35 -0500 Subject: [PATCH 066/110] Fixes typo. Updates Compoment to Component in reactClassCompoment --- snippets/snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 9807929..c93b340 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -293,7 +293,7 @@ "prefix": "redux", "body": ["import { connect } from 'react-redux'", ""] }, - "reactClassCompoment": { + "reactClassComponent": { "prefix": "rcc", "body": [ "import React, { Component } from 'react'", From 437570cffe1a841ea175cc0228ea6e31d1e9f1b1 Mon Sep 17 00:00:00 2001 From: Aryan Barnwal <55250734+Aryan6290@users.noreply.github.com> Date: Thu, 1 Jul 2021 13:05:15 +0530 Subject: [PATCH 067/110] Changed FunctionalComponent to FC in tsrnfi --- snippets/ts-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ts-snippets.json b/snippets/ts-snippets.json index 81c5f27..a02539f 100644 --- a/snippets/ts-snippets.json +++ b/snippets/ts-snippets.json @@ -276,7 +276,7 @@ "\t", "}", "", - "const ${1:${TM_FILENAME_BASE}}: React.FunctionComponent<${1:${TM_FILENAME_BASE}}Props> = (props) => {", + "const ${1:${TM_FILENAME_BASE}}: React.FC<${1:${TM_FILENAME_BASE}}Props> = (props) => {", "\treturn (", "\t\t", "\t\t\t$0", From b9304d130a4a925b70ee90299960f453c95ab818 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 18 Jul 2021 23:03:27 +0800 Subject: [PATCH 068/110] Need to improve the code snippet of useDispatch #189 --- snippets/snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index c93b340..896ef2c 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1542,7 +1542,7 @@ }, "useDispatch": { "prefix": "useDispatch", - "body": ["const dispatch = useDispatch(${1:function})"] + "body": ["const dispatch = useDispatch()"] }, "typeof": { "prefix": "tpf", From d6f5622c4af1dd7a477261667c30e6a561dabbaf Mon Sep 17 00:00:00 2001 From: huangtao <719012229@qq.com> Date: Tue, 27 Jul 2021 10:49:03 +0800 Subject: [PATCH 069/110] Change 'dob' & 'dar' cursor order for better autocompetetion. --- snippets/snippets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 896ef2c..11a1f6d 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -88,12 +88,12 @@ }, "destructingObject": { "prefix": "dob", - "body": "const {${1:propertyName}} = ${2:objectToDestruct}", + "body": "const {${2:propertyName}} = ${1:objectToDestruct}", "description": "Creates and assigns a local variable using object destructing" }, "destructingArray": { "prefix": "dar", - "body": "const [${1:propertyName}] = ${2:arrayToDestruct}", + "body": "const [${2:propertyName}] = ${1:arrayToDestruct}", "description": "Creates and assigns a local variable using array destructing" }, "setInterval": { From fb43931e3c67896fb900ea59e520e4f6f86cc891 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 29 Jul 2021 20:25:38 +0200 Subject: [PATCH 070/110] chore: update extension packages --- extension/index.ts | 83 +++++++++++++++++++++------------------------- package.json | 11 +++--- yarn.lock | 24 +++++++------- 3 files changed, 55 insertions(+), 63 deletions(-) diff --git a/extension/index.ts b/extension/index.ts index 5879eac..2cc6354 100644 --- a/extension/index.ts +++ b/extension/index.ts @@ -1,5 +1,3 @@ -// The module 'vscode' contains the VS Code extensibility API -// Import the module and reference it with the alias vscode in your code below import * as vscode from 'vscode' const jsSnippets = require('../snippets/snippets.json') @@ -14,60 +12,53 @@ type Snippet = { const convertSnippetArrayToString = (snippetArray: Array): string => snippetArray.join('\n') -// this method is called when your extension is activated -// your extension is activated the very first time the command is executed export function activate(context: vscode.ExtensionContext) { - // Use the console to output diagnostic information (console.log) and errors (console.error) - // This line of code will only be executed once when your extension is activated - console.log('Congratulations, your extension "snippet-search" is now active!') + const { + commands: { registerCommand }, + window: { showQuickPick, activeTextEditor }, + } = vscode - // The command has been defined in the package.json file - // Now provide the implementation of the command with registerCommand - // The commandId parameter must match the command field in package.json - const disposable = vscode.commands.registerCommand( - 'extension.snippetSearch', - async () => { - const javascriptSnippets = Object.entries(jsSnippets as Array) - const typescriptSnippets = Object.entries(tsSnippets as Array) - const snippetsArray: Array<[string, Snippet]> = javascriptSnippets.concat( - typescriptSnippets - ) + const disposable = registerCommand('extension.snippetSearch', async () => { + const javascriptSnippets = Object.entries(jsSnippets as Array) + const typescriptSnippets = Object.entries(tsSnippets as Array) + const snippetsArray: Array<[string, Snippet]> = + javascriptSnippets.concat(typescriptSnippets) - const items = snippetsArray.map( - ([shortDescription, { prefix, body, description }], index) => { - const value = typeof prefix === 'string' ? prefix : prefix[0] + const items = snippetsArray.map( + ([shortDescription, { prefix, body, description }], index) => { + const value = typeof prefix === 'string' ? prefix : prefix[0] - return { - id: index, - description: description || shortDescription, - label: value, - value, - body, - } + return { + id: index, + description: description || shortDescription, + label: value, + value, + body, } - ) - - const options = { - matchOnDescription: true, - matchOnDetail: true, - placeHolder: 'Search snippet', } + ) - const snippet = (await vscode.window.showQuickPick(items, options)) || { - body: '', - } - const activeTextEditor = vscode.window.activeTextEditor - const body = - typeof snippet.body === 'string' - ? snippet.body - : convertSnippetArrayToString(snippet.body) - activeTextEditor && - activeTextEditor.insertSnippet(new vscode.SnippetString(body)) + const options = { + matchOnDescription: true, + matchOnDetail: true, + placeHolder: 'Search snippet', + } + + const snippet = (await showQuickPick(items, options)) || { + body: '', + } + + const body = + typeof snippet.body === 'string' + ? snippet.body + : convertSnippetArrayToString(snippet.body) + + if (activeTextEditor) { + activeTextEditor.insertSnippet(new vscode.SnippetString(body)) } - ) + }) context.subscriptions.push(disposable) } -// this method is called when your extension is deactivated export function deactivate() {} diff --git a/package.json b/package.json index 05aa8a2..326426f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", - "version": "3.1.1", + "version": "3.2.0", "publisher": "dsznajder", "icon": "images/logo.png", "keywords": [ @@ -77,11 +77,12 @@ "scripts": { "vscode:prepublish": "yarn run compile", "compile": "tsc -p ./", - "watch": "tsc -watch -p ./" + "watch": "tsc -watch -p ./", + "typescript": "tsc --noEmit" }, "devDependencies": { - "typescript": "3.9.6", - "@types/vscode": "^1.45.0", - "@types/node": "^14.0.14" + "typescript": "4.3.5", + "@types/vscode": "1.58.1", + "@types/node": "16.4.7" } } diff --git a/yarn.lock b/yarn.lock index d1f4ed6..a33ca26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,17 +2,17 @@ # yarn lockfile v1 -"@types/node@^14.0.14": - version "14.0.14" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.14.tgz#24a0b5959f16ac141aeb0c5b3cd7a15b7c64cbce" - integrity sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ== +"@types/node@16.4.7": + version "16.4.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.7.tgz#f7afa78769d4b477f5092d7c3468e2e8653d779c" + integrity sha512-aDDY54sst8sx47CWT6QQqIZp45yURq4dic0+HCYfYNcY5Ejlb/CLmFnRLfy3wQuYafOeh3lB/DAKaqRKBtcZmA== -"@types/vscode@^1.45.0": - version "1.46.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.46.0.tgz#53f2075986e901ed25cd1ec5f3ffa5db84a111b3" - integrity sha512-8m9wPEB2mcRqTWNKs9A9Eqs8DrQZt0qNFO8GkxBOnyW6xR//3s77SoMgb/nY1ctzACsZXwZj3YRTDsn4bAoaUw== +"@types/vscode@1.58.1": + version "1.58.1" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.58.1.tgz#7deae08792adc73fa57383244a0c79d3530df4f7" + integrity sha512-sa76rDXiSif09he8KoaWWUQxsuBr2+uND0xn1GUbEODkuEjp2p7Rqd3t5qlvklfmAedLFdL7MdnsPa57uzwcOw== -typescript@3.9.6: - version "3.9.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a" - integrity sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw== +typescript@4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" + integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== From e111cc13a0bc148af4513993cc40c2d24dbb7a01 Mon Sep 17 00:00:00 2001 From: Paul Crussaire <36532199+devpolo@users.noreply.github.com> Date: Tue, 31 Aug 2021 16:19:34 +0200 Subject: [PATCH 071/110] docs: add clj method --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5012249..7553feb 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,7 @@ React 17 is currently supported by `_` prefix. | -----: | ----------------------------------- | | `clg→` | `console.log(object)` | | `clo→` | `` console.log(`object`, object) `` | +| `clj→` | `` console.log(`object`, JSON.stringify(object, null, 2)) `` | | `ctm→` | `` console.time(`timeId`) `` | | `cte→` | `` console.timeEnd(`timeId`) `` | | `cas→` | `console.assert(expression,object)` | From bb33d71b19bedf05ef86fd3609c7edce6f7dc4c3 Mon Sep 17 00:00:00 2001 From: Paul Crussaire <36532199+devpolo@users.noreply.github.com> Date: Tue, 31 Aug 2021 16:21:38 +0200 Subject: [PATCH 072/110] style: format console table --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 7553feb..b313a0b 100644 --- a/README.md +++ b/README.md @@ -215,23 +215,23 @@ React 17 is currently supported by `_` prefix. ### Console -| Prefix | Method | -| -----: | ----------------------------------- | -| `clg→` | `console.log(object)` | -| `clo→` | `` console.log(`object`, object) `` | +| Prefix | Method | +|--------|--------------------------------------------------------------| +| `clg→` | `console.log(object)` | +| `clo→` | `` console.log(`object`, object) `` | | `clj→` | `` console.log(`object`, JSON.stringify(object, null, 2)) `` | -| `ctm→` | `` console.time(`timeId`) `` | -| `cte→` | `` console.timeEnd(`timeId`) `` | -| `cas→` | `console.assert(expression,object)` | -| `ccl→` | `console.clear()` | -| `cco→` | `console.count(label)` | -| `cdi→` | `console.dir` | -| `cer→` | `console.error(object)` | -| `cgr→` | `console.group(label)` | -| `cge→` | `console.groupEnd()` | -| `ctr→` | `console.trace(object)` | -| `cwa→` | `console.warn` | -| `cin→` | `console.info` | +| `ctm→` | `` console.time(`timeId`) `` | +| `cte→` | `` console.timeEnd(`timeId`) `` | +| `cas→` | `console.assert(expression,object)` | +| `ccl→` | `console.clear()` | +| `cco→` | `console.count(label)` | +| `cdi→` | `console.dir` | +| `cer→` | `console.error(object)` | +| `cgr→` | `console.group(label)` | +| `cge→` | `console.groupEnd()` | +| `ctr→` | `console.trace(object)` | +| `cwa→` | `console.warn` | +| `cin→` | `console.info` | ### React Components From 34989984c8df96149c24fdfdc7e1e770ae26886a Mon Sep 17 00:00:00 2001 From: Paul Crussaire <36532199+devpolo@users.noreply.github.com> Date: Tue, 31 Aug 2021 16:25:44 +0200 Subject: [PATCH 073/110] feat: add log stringified JSON property with name --- snippets/snippets.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 11a1f6d..9a660d9 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -161,6 +161,11 @@ "body": "console.log(`${1:object}`, ${1:object})", "description": "Logs property with name." }, + "consoleLogJson": { + "prefix": "clj", + "body": "console.log(`${1:object}`, JSON.stringify(${1:object}, null, 2))", + "description": "Logs stringified JSON property with name." + }, "consoleTime": { "prefix": "ctm", "body": "console.time(`${1:object}`)", From 89f27c53bb447bd02f92c615aecbd149689bc2a8 Mon Sep 17 00:00:00 2001 From: "Dr. Derek Austin" Date: Sun, 11 Apr 2021 21:06:17 -0500 Subject: [PATCH 074/110] Create ednf snippet --- README.md | 1 + snippets/snippets.json | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b313a0b..a71a2ce 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ React 17 is currently supported by `_` prefix. | `exa→` | `export { originalName as aliasName} from 'module'` | | `enf→` | `export const functionName = (params) => { }` | | `edf→` | `export default (params) => { }` | +| `ednf→` | `export default function functionName(params) { }` | | `met→` | `methodName = (params) => { }` | | `fre→` | `arrayName.forEach(element => { }` | | `fof→` | `for(let itemName of objectName { }` | diff --git a/snippets/snippets.json b/snippets/snippets.json index 9a660d9..cabc6bb 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -46,6 +46,16 @@ "body": ["export default (${1:params}) => {", "\t$0", "}", ""], "description": "Export default function in ES7 syntax" }, + "exportDefaultNamedFunction": { + "prefix": "ednf", + "body": [ + "export default function ${1:functionName}(${2:params}) {", + "\t$0", + "}", + "" + ], + "description": "Export default named function in ES7 syntax" + }, "method": { "prefix": "met", "body": ["${1:methodName} = (${2:params}) => {", "\t${0}", "}", ""], @@ -1864,7 +1874,7 @@ "}", "", "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Custom Hook with ES7 module system" - } + ], + "description": "Creates a React Custom Hook with ES7 module system" + } } From 2a6a1ffac598d7f5b4097d06c4190c5bcced99d9 Mon Sep 17 00:00:00 2001 From: tanhakabir Date: Mon, 29 Nov 2021 18:53:08 +0000 Subject: [PATCH 075/110] add bundling to enable on web --- package.json | 16 +- webpack.config.js | 57 +++ yarn.lock | 900 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 967 insertions(+), 6 deletions(-) create mode 100644 webpack.config.js diff --git a/package.json b/package.json index 326426f..c46e257 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "ui", "workspace" ], - "main": "./out/index.js", + "browser": "./out/extension.js", "activationEvents": [ "onCommand:extension.snippetSearch" ], @@ -75,14 +75,18 @@ ] }, "scripts": { - "vscode:prepublish": "yarn run compile", - "compile": "tsc -p ./", - "watch": "tsc -watch -p ./", + "vscode:prepublish": "yarn run package", + "compile": "webpack", + "watch": "webpack --watch", + "package": "webpack --mode production --devtool hidden-source-map", "typescript": "tsc --noEmit" }, "devDependencies": { - "typescript": "4.3.5", + "@types/node": "16.4.7", "@types/vscode": "1.58.1", - "@types/node": "16.4.7" + "ts-loader": "^9.2.6", + "typescript": "4.3.5", + "webpack": "^5.64.4", + "webpack-cli": "^4.9.1" } } diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..12c7e40 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,57 @@ +const path = require('path'); +const webpack = require('webpack'); + +/** @typedef {import('webpack').Configuration} WebpackConfig **/ +/** @type WebpackConfig */ +const webExtensionConfig = { + mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') + target: 'webworker', // extensions run in a webworker context + entry: { + extension: './extension/index.ts', // source of the web extension main file + }, + externals: { + vscode: 'commonjs vscode' // ignored because it doesn't exist + }, + performance: { + hints: false + }, + devtool: 'nosources-source-map', // create a source map that points to the original source file + resolve: { + mainFields: ['browser', 'module', 'main'], // look for `browser` entry point in imported node modules + extensions: ['.ts', '.js'], // support ts-files and js-files + alias: { + // provides alternate implementation for node module and source files + }, + fallback: { + // Webpack 5 no longer polyfills Node.js core modules automatically. + // see https://webpack.js.org/configuration/resolve/#resolvefallback + // for the list of Node.js core module polyfills. + } + }, + plugins: [ + new webpack.ProvidePlugin({ + process: 'process/browser' // provide a shim for the global `process` variable + }) + ], + module: { + rules: [ + { + test: /\.ts$/, + exclude: /node_modules/, + use: [ + { + loader: 'ts-loader' + } + ] + } + ] + }, + output: { + filename: '[name].js', + path: path.join(__dirname, './out'), + libraryTarget: 'commonjs', + devtoolModuleFilenameTemplate: '../../[resource-path]' + }, +}; + +module.exports = webExtensionConfig; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a33ca26..5015aac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,42 @@ # yarn lockfile v1 +"@discoveryjs/json-ext@^0.5.0": + version "0.5.5" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz#9283c9ce5b289a3c4f61c12757469e59377f81f3" + integrity sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA== + +"@types/eslint-scope@^3.7.0": + version "3.7.1" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.1.tgz#8dc390a7b4f9dd9f1284629efce982e41612116e" + integrity sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.2.0.tgz#afd0519223c29c347087542cbaee2fedc0873b16" + integrity sha512-74hbvsnc+7TEDa1z5YLSe4/q8hGYB3USNvCuzHUJrjPV6hXaq8IXcngCrHkuvFt0+8rFz7xYXrHgNayIX0UZvQ== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^0.0.50": + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + +"@types/json-schema@*", "@types/json-schema@^7.0.8": + version "7.0.9" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + +"@types/node@*": + version "16.11.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" + integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== + "@types/node@16.4.7": version "16.4.7" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.7.tgz#f7afa78769d4b477f5092d7c3468e2e8653d779c" @@ -12,7 +48,871 @@ resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.58.1.tgz#7deae08792adc73fa57383244a0c79d3530df4f7" integrity sha512-sa76rDXiSif09he8KoaWWUQxsuBr2+uND0xn1GUbEODkuEjp2p7Rqd3t5qlvklfmAedLFdL7MdnsPa57uzwcOw== +"@webassemblyjs/ast@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + +"@webassemblyjs/floating-point-hex-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== + +"@webassemblyjs/helper-api-error@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== + +"@webassemblyjs/helper-buffer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== + +"@webassemblyjs/helper-numbers@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/helper-wasm-bytecode@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== + +"@webassemblyjs/helper-wasm-section@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + +"@webassemblyjs/ieee754@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== + +"@webassemblyjs/wasm-edit@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-wasm-section" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-opt" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + "@webassemblyjs/wast-printer" "1.11.1" + +"@webassemblyjs/wasm-gen@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wasm-opt@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + +"@webassemblyjs/wasm-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wast-printer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webpack-cli/configtest@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.0.tgz#8342bef0badfb7dfd3b576f2574ab80c725be043" + integrity sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg== + +"@webpack-cli/info@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.0.tgz#b9179c3227ab09cbbb149aa733475fcf99430223" + integrity sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw== + dependencies: + envinfo "^7.7.3" + +"@webpack-cli/serve@^1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.0.tgz#2c275aa05c895eccebbfc34cfb223c6e8bd591a2" + integrity sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA== + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +acorn-import-assertions@^1.7.6: + version "1.8.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" + integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== + +acorn@^8.4.1: + version "8.6.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" + integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== + +ajv-keywords@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== + +ajv@^6.12.5: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browserslist@^4.14.5: + version "4.18.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" + integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ== + dependencies: + caniuse-lite "^1.0.30001280" + electron-to-chromium "^1.3.896" + escalade "^3.1.1" + node-releases "^2.0.1" + picocolors "^1.0.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +caniuse-lite@^1.0.30001280: + version "1.0.30001283" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001283.tgz#8573685bdae4d733ef18f78d44ba0ca5fe9e896b" + integrity sha512-9RoKo841j1GQFSJz/nCXOj0sD7tHBtlowjYlrqIUS812x9/emfBLBt6IyMz1zIaYc/eRL8Cs6HPUVi2Hzq4sIg== + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chrome-trace-event@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colorette@^2.0.14: + version "2.0.16" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +electron-to-chromium@^1.3.896: + version "1.4.4" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.4.tgz#57311918524c1a26878c330537f967804d43788a" + integrity sha512-teHtgwcmVcL46jlFvAaqjyiTLWuMrUQO1JqV303JKB4ysXG6m8fXSFhbjal9st0r9mNskI22AraJZorb1VcLVg== + +enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.3: + version "5.8.3" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" + integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +envinfo@^7.7.3: + version "7.8.1" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" + integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + +es-module-lexer@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +events@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fastest-levenshtein@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" + integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + +graceful-fs@^4.1.2, graceful-fs@^4.2.4: + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +import-local@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" + integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +interpret@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" + integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== + +is-core-module@^2.2.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== + dependencies: + has "^1.0.3" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +jest-worker@^27.0.6: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.0.tgz#fa10dddc611cbb47a4153543dd16a0c7e7fd745c" + integrity sha512-4WuKcUxtzxBoKOUFbt1MtTY9fJwPVD4aN/4Cgxee7OLetPZn5as2bjfZz98XSf2Zq1JFfhqPZpS+43BmWXKgCA== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +loader-runner@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" + integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +micromatch@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + +mime-db@1.51.0: + version "1.51.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" + integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== + +mime-types@^2.1.27: + version "2.1.34" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" + integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + dependencies: + mime-db "1.51.0" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +neo-async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + +node-releases@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.2.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +rechoir@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.1.tgz#9478a96a1ca135b5e88fc027f03ee92d6c645686" + integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg== + dependencies: + resolve "^1.9.0" + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve@^1.9.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +schema-utils@^3.1.0, schema-utils@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +semver@^7.3.4: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^3.0.3: + version "3.0.6" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" + integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== + +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@~0.7.2: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + +terser-webpack-plugin@^5.1.3: + version "5.2.5" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.2.5.tgz#ce65b9880a0c36872555c4874f45bbdb02ee32c9" + integrity sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g== + dependencies: + jest-worker "^27.0.6" + schema-utils "^3.1.1" + serialize-javascript "^6.0.0" + source-map "^0.6.1" + terser "^5.7.2" + +terser@^5.7.2: + version "5.10.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc" + integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== + dependencies: + commander "^2.20.0" + source-map "~0.7.2" + source-map-support "~0.5.20" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +ts-loader@^9.2.6: + version "9.2.6" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.6.tgz#9937c4dd0a1e3dbbb5e433f8102a6601c6615d74" + integrity sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw== + dependencies: + chalk "^4.1.0" + enhanced-resolve "^5.0.0" + micromatch "^4.0.0" + semver "^7.3.4" + typescript@4.3.5: version "4.3.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +watchpack@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.0.tgz#a41bca3da6afaff31e92a433f4c856a0c25ea0c4" + integrity sha512-MnN0Q1OsvB/GGHETrFeZPQaOelWh/7O+EiFlj8sM9GPjtQkis7k01aAxrg/18kTfoIVcLL+haEVFlXDaSRwKRw== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + +webpack-cli@^4.9.1: + version "4.9.1" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.1.tgz#b64be825e2d1b130f285c314caa3b1ba9a4632b3" + integrity sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ== + dependencies: + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^1.1.0" + "@webpack-cli/info" "^1.4.0" + "@webpack-cli/serve" "^1.6.0" + colorette "^2.0.14" + commander "^7.0.0" + execa "^5.0.0" + fastest-levenshtein "^1.0.12" + import-local "^3.0.2" + interpret "^2.2.0" + rechoir "^0.7.0" + webpack-merge "^5.7.3" + +webpack-merge@^5.7.3: + version "5.8.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" + integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== + dependencies: + clone-deep "^4.0.1" + wildcard "^2.0.0" + +webpack-sources@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.2.tgz#d88e3741833efec57c4c789b6010db9977545260" + integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw== + +webpack@^5.64.4: + version "5.64.4" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.64.4.tgz#e1454b6a13009f57cc2c78e08416cd674622937b" + integrity sha512-LWhqfKjCLoYJLKJY8wk2C3h77i8VyHowG3qYNZiIqD6D0ZS40439S/KVuc/PY48jp2yQmy0mhMknq8cys4jFMw== + dependencies: + "@types/eslint-scope" "^3.7.0" + "@types/estree" "^0.0.50" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.4.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.8.3" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.4" + json-parse-better-errors "^1.0.2" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.3.0" + webpack-sources "^3.2.2" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wildcard@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" + integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== From 5a23c71b6806b8e61dddb3102f34e648700b7bfb Mon Sep 17 00:00:00 2001 From: Antoine Lelaisant Date: Tue, 21 Dec 2021 11:25:04 +0100 Subject: [PATCH 076/110] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a71a2ce..aaed7f6 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ React 17 is currently supported by `_` prefix. | Prefix | Method | | ---------: | ------------------------------------------------------- | -| `graphql→` | `import { compose, graphql } from react-apollo'` | +| `graphql→` | `import { compose, graphql } from 'react-apollo'` | | `expgql->` | `export default compose(graphql($1, { name: $2 }))($3)` | ### Console From 42fa163ff36370daf19646dac6e55826f324212a Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 24 Sep 2021 01:58:26 +0200 Subject: [PATCH 077/110] chore: file restructure, add eslint & prettier --- .eslintrc.js | 55 + .gitignore | 1 + .vscode/settings.json | 15 +- .vscodeignore | 8 +- extension/index.ts | 64 - package.json | 54 +- src/index.ts | 55 + {snippets => src/snippets}/snippets.json | 0 {snippets => src/snippets}/ts-snippets.json | 0 tsconfig.json | 28 +- yarn.lock | 2049 ++++++++++++++++++- 11 files changed, 2195 insertions(+), 134 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 extension/index.ts create mode 100644 src/index.ts rename {snippets => src/snippets}/snippets.json (100%) rename {snippets => src/snippets}/ts-snippets.json (100%) diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..45139aa --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,55 @@ +module.exports = { + env: { + es6: true, + node: true, + jest: true, + }, + + plugins: ["simple-import-sort"], + extends: ["satya164"], + + rules: { + "babel/no-unused-expressions": "off", + "import/extensions": "off", + "import/named": "off", + "import/no-unresolved": "off", + "jest/consistent-test-it": ["error", { fn: "test" }], + "jest/no-truthy-falsy": "off", + "jest/expect-expect": ["error", { assertFunctionNames: ["expect", "element"] }], + + "prettier/prettier": [ + "error", + { + bracketSameLine: false, + bracketSpacing: true, + printWidth: 100, + semi: true, + singleQuote: false, + tabWidth: 2, + trailingComma: "all", + useTabs: false, + }, + ], + + "simple-import-sort/exports": "error", + "simple-import-sort/imports": [ + "error", + { + groups: [ + // Side effect imports. + ["^\\u0000"], + // Packages. + ["^@?\\w"], + ["^../"], + ["^./"], + ], + }, + ], + + "@typescript-eslint/array-type": ["error", { default: "generic", readonly: "generic" }], + }, + globals: { + __DEV__: true, + jasmine: true, + }, +}; diff --git a/.gitignore b/.gitignore index 23afddd..42ffe71 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules *.vsix *.log .DS_Store +lib/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 6d9419c..4ba2e2c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,10 @@ { - "files.exclude": { - "out": false + "editor.tabSize": 2, + "javascript.format.enable": false, + "typescript.format.enable": false, + "typescript.tsdk": "node_modules/typescript/lib", + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true }, - "search.exclude": { - "out": true - }, - "typescript.tsc.autoDetect": "off", - "prettier.semi": false, - "prettier.singleQuote": true } diff --git a/.vscodeignore b/.vscodeignore index 116dc6b..8fb7f19 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,9 +1,5 @@ .vscode/** -.vscode-test/** -out/test/** -extension/** +src/** .gitignore -vsc-extension-quickstart.md **/tsconfig.json -**/tslint.json -**/*.ts +*.ts diff --git a/extension/index.ts b/extension/index.ts deleted file mode 100644 index 2cc6354..0000000 --- a/extension/index.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as vscode from 'vscode' - -const jsSnippets = require('../snippets/snippets.json') -const tsSnippets = require('../snippets/ts-snippets.json') - -type Snippet = { - body: Array | string - description: string - prefix: Array | string -} - -const convertSnippetArrayToString = (snippetArray: Array): string => - snippetArray.join('\n') - -export function activate(context: vscode.ExtensionContext) { - const { - commands: { registerCommand }, - window: { showQuickPick, activeTextEditor }, - } = vscode - - const disposable = registerCommand('extension.snippetSearch', async () => { - const javascriptSnippets = Object.entries(jsSnippets as Array) - const typescriptSnippets = Object.entries(tsSnippets as Array) - const snippetsArray: Array<[string, Snippet]> = - javascriptSnippets.concat(typescriptSnippets) - - const items = snippetsArray.map( - ([shortDescription, { prefix, body, description }], index) => { - const value = typeof prefix === 'string' ? prefix : prefix[0] - - return { - id: index, - description: description || shortDescription, - label: value, - value, - body, - } - } - ) - - const options = { - matchOnDescription: true, - matchOnDetail: true, - placeHolder: 'Search snippet', - } - - const snippet = (await showQuickPick(items, options)) || { - body: '', - } - - const body = - typeof snippet.body === 'string' - ? snippet.body - : convertSnippetArrayToString(snippet.body) - - if (activeTextEditor) { - activeTextEditor.insertSnippet(new vscode.SnippetString(body)) - } - }) - - context.subscriptions.push(disposable) -} - -export function deactivate() {} diff --git a/package.json b/package.json index c46e257..1d009c7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "es7-react-js-snippets", - "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", - "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7 syntax", + "displayName": "ES7+ React/Redux/GraphQL/React-Native snippets", + "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7+ syntax", "version": "3.2.0", "publisher": "dsznajder", "icon": "images/logo.png", @@ -29,6 +29,13 @@ "workspace" ], "browser": "./out/extension.js", + "main": "./lib/index.js", + "capabilities": { + "virtualWorkspaces": true, + "untrustedWorkspaces": { + "supported": true + } + }, "activationEvents": [ "onCommand:extension.snippetSearch" ], @@ -50,43 +57,62 @@ "snippets": [ { "language": "javascript", - "path": "./snippets/snippets.json" + "path": "./lib/snippets/snippets.json" }, { "language": "javascriptreact", - "path": "./snippets/snippets.json" + "path": "./lib/snippets/snippets.json" }, { "language": "typescript", - "path": "./snippets/snippets.json" + "path": "./lib/snippets/snippets.json" }, { "language": "typescriptreact", - "path": "./snippets/snippets.json" + "path": "./lib/snippets/snippets.json" }, { "language": "typescript", - "path": "./snippets/ts-snippets.json" + "path": "./lib/snippets/ts-snippets.json" }, { "language": "typescriptreact", - "path": "./snippets/ts-snippets.json" + "path": "./lib/snippets/ts-snippets.json" } ] }, "scripts": { "vscode:prepublish": "yarn run package", - "compile": "webpack", - "watch": "webpack --watch", - "package": "webpack --mode production --devtool hidden-source-map", + "compile": "tsc -p ./ --noEmit false --outDir lib/", + "compile:web": "webpack --mode production --devtool hidden-source-map", + "watch": "tsc -watch -p ./", + "watch:web": "webpack --watch", + "package": "yarn compile && webpack --mode production --devtool hidden-source-map", "typescript": "tsc --noEmit" }, + "dependencies": { + "vscode": "1.1.37" + }, "devDependencies": { - "@types/node": "16.4.7", - "@types/vscode": "1.58.1", + "@types/node": "16.9.6", + "@types/vscode": "1.60.0", + "eslint": "7.32.0", + "eslint-config-satya164": "3.1.10", + "eslint-plugin-simple-import-sort": "7.0.0", + "prettier": "2.4.1", "ts-loader": "^9.2.6", - "typescript": "4.3.5", + "typescript": "4.4.3", "webpack": "^5.64.4", "webpack-cli": "^4.9.1" + }, + "prettier": { + "bracketSameLine": false, + "bracketSpacing": true, + "printWidth": 100, + "semi": true, + "singleQuote": false, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": false } } diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..9fe6fa2 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,55 @@ +import * as vscode from "vscode"; + +import jsSnippets from "./snippets/snippets.json"; +import tsSnippets from "./snippets/ts-snippets.json"; + +const convertSnippetArrayToString = (snippetArray: Array) => snippetArray.join("\n"); + +export function activate(context: vscode.ExtensionContext) { + const { + commands: { registerCommand }, + window: { showQuickPick, activeTextEditor }, + } = vscode; + + const disposable = registerCommand("extension.snippetSearch", async () => { + const javascriptSnippets = Object.entries(jsSnippets); + const typescriptSnippets = Object.entries(tsSnippets); + const snippetsArray = javascriptSnippets.concat(typescriptSnippets); + + const items = snippetsArray.map( + // @ts-expect-error + ([shortDescription, { prefix, body, description }], index) => { + const value = typeof prefix === "string" ? prefix : prefix[0]; + + return { + id: index, + description: description || shortDescription, + label: value, + value, + body, + }; + }, + ); + + const options = { + matchOnDescription: true, + matchOnDetail: true, + placeHolder: "Search snippet", + }; + + const snippet = (await showQuickPick(items, options)) || { + body: "", + }; + + const body = + typeof snippet.body === "string" ? snippet.body : convertSnippetArrayToString(snippet.body); + + if (activeTextEditor) { + activeTextEditor.insertSnippet(new vscode.SnippetString(body)); + } + }); + + context.subscriptions.push(disposable); +} + +export function deactivate() {} diff --git a/snippets/snippets.json b/src/snippets/snippets.json similarity index 100% rename from snippets/snippets.json rename to src/snippets/snippets.json diff --git a/snippets/ts-snippets.json b/src/snippets/ts-snippets.json similarity index 100% rename from snippets/ts-snippets.json rename to src/snippets/ts-snippets.json diff --git a/tsconfig.json b/tsconfig.json index 5adeb0a..79e9c2c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,23 @@ { "compilerOptions": { - "lib": ["es2017"], - "module": "commonjs", - "outDir": "out", - "rootDir": "extension", + "allowJs": true, + "allowSyntheticDefaultImports": true, + "baseUrl": "./", + "esModuleInterop": true, + "module": "ESNext", + "moduleResolution": "Node", + "noEmit": true, + "noImplicitAny": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "skipDefaultLibCheck": true, + "skipLibCheck": true, "sourceMap": true, "strict": true, - "target": "es6", - - /* Additional Checks */ - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "noUnusedParameters": true + "strictNullChecks": true, + "target": "ESNext" }, - "exclude": ["node_modules", ".vscode-test"] + "exclude": ["node_modules", "jest", "**/__tests__/*"], + "compileOnSave": false } diff --git a/yarn.lock b/yarn.lock index 5015aac..01f9c82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,11 +2,281 @@ # yarn lockfile v1 +"@babel/code-frame@7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/code-frame@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== + dependencies: + "@babel/highlight" "^7.14.5" + +"@babel/compat-data@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" + integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== + +"@babel/core@^7.13.10": + version "7.15.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" + integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-compilation-targets" "^7.15.4" + "@babel/helper-module-transforms" "^7.15.4" + "@babel/helpers" "^7.15.4" + "@babel/parser" "^7.15.5" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + +"@babel/eslint-parser@^7.13.10": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.15.7.tgz#2dc3d0ff0ea22bb1e08d93b4eeb1149bf1c75f2d" + integrity sha512-yJkHyomClm6A2Xzb8pdAo4HzYMSXFn1O5zrCYvbFP0yQFvHueLedV8WiEno8yJOKStjUXzBZzJFeWQ7b3YMsqQ== + dependencies: + eslint-scope "^5.1.1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + +"@babel/generator@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" + integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== + dependencies: + "@babel/types" "^7.15.4" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/helper-compilation-targets@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" + integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== + dependencies: + "@babel/compat-data" "^7.15.0" + "@babel/helper-validator-option" "^7.14.5" + browserslist "^4.16.6" + semver "^6.3.0" + +"@babel/helper-function-name@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" + integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== + dependencies: + "@babel/helper-get-function-arity" "^7.15.4" + "@babel/template" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/helper-get-function-arity@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" + integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-hoist-variables@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" + integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-member-expression-to-functions@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" + integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-module-imports@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" + integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-module-transforms@^7.15.4": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" + integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== + dependencies: + "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-replace-supers" "^7.15.4" + "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-validator-identifier" "^7.15.7" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.6" + +"@babel/helper-optimise-call-expression@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" + integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-replace-supers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" + integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.15.4" + "@babel/helper-optimise-call-expression" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/helper-simple-access@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" + integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-split-export-declaration@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" + integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== + +"@babel/helper-validator-option@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + +"@babel/helpers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" + integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== + dependencies: + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.15.4", "@babel/parser@^7.15.5": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" + integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== + +"@babel/template@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" + integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/traverse@^7.15.4", "@babel/traverse@^7.7.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" + integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-function-name" "^7.15.4" + "@babel/helper-hoist-variables" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.15.4", "@babel/types@^7.15.6": + version "7.15.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" + integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== + dependencies: + "@babel/helper-validator-identifier" "^7.14.9" + to-fast-properties "^2.0.0" + "@discoveryjs/json-ext@^0.5.0": version "0.5.5" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz#9283c9ce5b289a3c4f61c12757469e59377f81f3" integrity sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA== +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@tootallnate/once@1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" + integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== + "@types/eslint-scope@^3.7.0": version "3.7.1" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.1.tgz#8dc390a7b4f9dd9f1284629efce982e41612116e" @@ -28,25 +298,99 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== -"@types/json-schema@*", "@types/json-schema@^7.0.8": +"@types/json-schema@*", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + "@types/node@*": version "16.11.10" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== -"@types/node@16.4.7": - version "16.4.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.7.tgz#f7afa78769d4b477f5092d7c3468e2e8653d779c" - integrity sha512-aDDY54sst8sx47CWT6QQqIZp45yURq4dic0+HCYfYNcY5Ejlb/CLmFnRLfy3wQuYafOeh3lB/DAKaqRKBtcZmA== +"@types/node@16.9.6": + version "16.9.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.6.tgz#040a64d7faf9e5d9e940357125f0963012e66f04" + integrity sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ== + +"@types/vscode@1.60.0": + version "1.60.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.60.0.tgz#9330c317691b4f53441a18b598768faeeb71618a" + integrity sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow== -"@types/vscode@1.58.1": - version "1.58.1" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.58.1.tgz#7deae08792adc73fa57383244a0c79d3530df4f7" - integrity sha512-sa76rDXiSif09he8KoaWWUQxsuBr2+uND0xn1GUbEODkuEjp2p7Rqd3t5qlvklfmAedLFdL7MdnsPa57uzwcOw== +"@typescript-eslint/eslint-plugin@^4.19.0": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz#9f41efaee32cdab7ace94b15bd19b756dd099b0a" + integrity sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA== + dependencies: + "@typescript-eslint/experimental-utils" "4.31.2" + "@typescript-eslint/scope-manager" "4.31.2" + debug "^4.3.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@4.31.2", "@typescript-eslint/experimental-utils@^4.0.1": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz#98727a9c1e977dd5d20c8705e69cd3c2a86553fa" + integrity sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.31.2" + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/typescript-estree" "4.31.2" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^4.19.0": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" + integrity sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw== + dependencies: + "@typescript-eslint/scope-manager" "4.31.2" + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/typescript-estree" "4.31.2" + debug "^4.3.1" + +"@typescript-eslint/scope-manager@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz#1d528cb3ed3bcd88019c20a57c18b897b073923a" + integrity sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w== + dependencies: + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/visitor-keys" "4.31.2" + +"@typescript-eslint/types@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" + integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== + +"@typescript-eslint/typescript-estree@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" + integrity sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA== + dependencies: + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/visitor-keys" "4.31.2" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" + integrity sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug== + dependencies: + "@typescript-eslint/types" "4.31.2" + eslint-visitor-keys "^2.0.0" "@webassemblyjs/ast@1.11.1": version "1.11.1" @@ -201,17 +545,41 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== +acorn-jsx@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^7.4.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + acorn@^8.4.1: version "8.6.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== +agent-base@4, agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + dependencies: + es6-promisify "^5.0.0" + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.12.5: +ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -221,13 +589,100 @@ ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-styles@^4.1.0: +ajv@^8.0.1: + version "8.6.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" + integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +array-includes@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" + integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + get-intrinsic "^1.1.1" + is-string "^1.0.5" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array.prototype.flat@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" + integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + +array.prototype.flatmap@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" + integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + function-bind "^1.1.1" + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + braces@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -235,6 +690,11 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + browserslist@^4.14.5: version "4.18.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" @@ -246,17 +706,57 @@ browserslist@^4.14.5: node-releases "^2.0.1" picocolors "^1.0.0" +browserslist@^4.16.6: + version "4.17.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.1.tgz#a98d104f54af441290b7d592626dd541fa642eb9" + integrity sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ== + dependencies: + caniuse-lite "^1.0.30001259" + electron-to-chromium "^1.3.846" + escalade "^3.1.1" + nanocolors "^0.1.5" + node-releases "^1.1.76" + buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +caniuse-lite@^1.0.30001259: + version "1.0.30001260" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz#e3be3f34ddad735ca4a2736fa9e768ef34316270" + integrity sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg== + dependencies: + nanocolors "^0.1.0" + caniuse-lite@^1.0.30001280: version "1.0.30001283" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001283.tgz#8573685bdae4d733ef18f78d44ba0ca5fe9e896b" integrity sha512-9RoKo841j1GQFSJz/nCXOj0sD7tHBtlowjYlrqIUS812x9/emfBLBt6IyMz1zIaYc/eRL8Cs6HPUVi2Hzq4sIg== -chalk@^4.1.0: +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -278,6 +778,13 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -285,6 +792,11 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -295,6 +807,11 @@ colorette@^2.0.14: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== + commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -305,7 +822,19 @@ commander@^7.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== -cross-spawn@^7.0.3: +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.7.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== + dependencies: + safe-buffer "~5.1.1" + +cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -314,11 +843,87 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + +debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.1.0, debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +electron-to-chromium@^1.3.846: + version "1.3.849" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.849.tgz#45a65a392565abc5b864624b9753393336426f4b" + integrity sha512-RweyW60HPOqIcxoKTGr38Yvtf2aliSUqX8dB3e9geJ0Bno0YLjcOX5F7/DPVloBkJWaPZ7xOM1A0Yme2T1A34w== + electron-to-chromium@^1.3.896: version "1.4.4" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.4.tgz#57311918524c1a26878c330537f967804d43788a" integrity sha512-teHtgwcmVcL46jlFvAaqjyiTLWuMrUQO1JqV303JKB4ysXG6m8fXSFhbjal9st0r9mNskI22AraJZorb1VcLVg== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.3: version "5.8.3" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" @@ -327,22 +932,238 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.3: graceful-fs "^4.2.4" tapable "^2.2.0" +enquirer@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + envinfo@^7.7.3: version "7.8.1" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.1, es-abstract@^1.18.2: + version "1.18.6" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.6.tgz#2c44e3ea7a6255039164d26559777a6d978cb456" + integrity sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.1" + is-regex "^1.1.4" + is-string "^1.0.7" + object-inspect "^1.11.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" + es-module-lexer@^0.9.0: version "0.9.3" resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -eslint-scope@5.1.1: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-prettier@^8.1.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" + integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== + +eslint-config-satya164@3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/eslint-config-satya164/-/eslint-config-satya164-3.1.10.tgz#26a8b7df0fa67cc9222cac7f315ce33830f519df" + integrity sha512-7fiPBr04CGKRfnllJMXiwJnBaALQ3kx8l/V+Ft+1ENo4uyOAzqrRQp3v9X59DCpXWyUt7rvWwWn4hTDUucF0tQ== + dependencies: + "@babel/core" "^7.13.10" + "@babel/eslint-parser" "^7.13.10" + "@typescript-eslint/eslint-plugin" "^4.19.0" + "@typescript-eslint/parser" "^4.19.0" + eslint-config-prettier "^8.1.0" + eslint-plugin-babel "^5.3.1" + eslint-plugin-eslint-comments "^3.2.0" + eslint-plugin-flowtype "^5.4.0" + eslint-plugin-import "^2.22.1" + eslint-plugin-jest "^24.3.2" + eslint-plugin-prettier "^3.3.1" + eslint-plugin-react "^7.23.0" + eslint-plugin-react-hooks "^4.2.0" + eslint-plugin-react-native "^3.10.0" + +eslint-import-resolver-node@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" + integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-module-utils@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz#94e5540dd15fe1522e8ffa3ec8db3b7fa7e7a534" + integrity sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q== + dependencies: + debug "^3.2.7" + pkg-dir "^2.0.0" + +eslint-plugin-babel@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.1.tgz#75a2413ffbf17e7be57458301c60291f2cfbf560" + integrity sha512-VsQEr6NH3dj664+EyxJwO4FCYm/00JhYb3Sk3ft8o+fpKuIfQ9TaW6uVUfvwMXHcf/lsnRIoyFPsLMyiWCSL/g== + dependencies: + eslint-rule-composer "^0.3.0" + +eslint-plugin-eslint-comments@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz#9e1cd7b4413526abb313933071d7aba05ca12ffa" + integrity sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ== + dependencies: + escape-string-regexp "^1.0.5" + ignore "^5.0.5" + +eslint-plugin-flowtype@^5.4.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.10.0.tgz#7764cc63940f215bf3f0bd2d9a1293b2b9b2b4bb" + integrity sha512-vcz32f+7TP+kvTUyMXZmCnNujBQZDNmcqPImw8b9PZ+16w1Qdm6ryRuYZYVaG9xRqqmAPr2Cs9FAX5gN+x/bjw== + dependencies: + lodash "^4.17.15" + string-natural-compare "^3.0.1" + +eslint-plugin-import@^2.22.1: + version "2.24.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz#2c8cd2e341f3885918ee27d18479910ade7bb4da" + integrity sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q== + dependencies: + array-includes "^3.1.3" + array.prototype.flat "^1.2.4" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.6.2" + find-up "^2.0.0" + has "^1.0.3" + is-core-module "^2.6.0" + minimatch "^3.0.4" + object.values "^1.1.4" + pkg-up "^2.0.0" + read-pkg-up "^3.0.0" + resolve "^1.20.0" + tsconfig-paths "^3.11.0" + +eslint-plugin-jest@^24.3.2: + version "24.4.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.4.2.tgz#9e8cf05ee6a0e3025e6149df2f36950abfa8d5bf" + integrity sha512-jNMnqwX75z0RXRMXkxwb/+9ylKJYJLJ8nT8nBT0XFM5qx4IQGxP4edMawa0qGkSbHae0BDPBmi8I2QF0/F04XQ== + dependencies: + "@typescript-eslint/experimental-utils" "^4.0.1" + +eslint-plugin-prettier@^3.3.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" + integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-plugin-react-hooks@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556" + integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ== + +eslint-plugin-react-native-globals@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz#ee1348bc2ceb912303ce6bdbd22e2f045ea86ea2" + integrity sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g== + +eslint-plugin-react-native@^3.10.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-native/-/eslint-plugin-react-native-3.11.0.tgz#c73b0886abb397867e5e6689d3a6a418682e6bac" + integrity sha512-7F3OTwrtQPfPFd+VygqKA2VZ0f2fz0M4gJmry/TRE18JBb94/OtMxwbL7Oqwu7FGyrdeIOWnXQbBAveMcSTZIA== + dependencies: + "@babel/traverse" "^7.7.4" + eslint-plugin-react-native-globals "^0.1.1" + +eslint-plugin-react@^7.23.0: + version "7.26.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.0.tgz#3ae019a35d542b98e5af9e2f96b89c232c74b55b" + integrity sha512-dceliS5itjk4EZdQYtLMz6GulcsasguIs+VTXuiC7Q5IPIdGTkyfXVdmsQOqEhlD9MciofH4cMcT1bw1WWNxCQ== + dependencies: + array-includes "^3.1.3" + array.prototype.flatmap "^1.2.4" + doctrine "^2.1.0" + estraverse "^5.2.0" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.0.4" + object.entries "^1.1.4" + object.fromentries "^2.0.4" + object.hasown "^1.0.0" + object.values "^1.1.4" + prop-types "^15.7.2" + resolve "^2.0.0-next.3" + semver "^6.3.0" + string.prototype.matchall "^4.0.5" + +eslint-plugin-simple-import-sort@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz#a1dad262f46d2184a90095a60c66fef74727f0f8" + integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw== + +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" + integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== + +eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -350,6 +1171,97 @@ eslint-scope@5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" +eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint@7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== + dependencies: + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.4.3" + "@humanwhocodes/config-array" "^0.5.0" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.1.2" + globals "^13.6.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.9" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== + dependencies: + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" @@ -362,10 +1274,15 @@ estraverse@^4.1.1: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== events@^3.2.0: version "3.3.0" @@ -387,21 +1304,56 @@ execa@^5.0.0: signal-exit "^3.0.3" strip-final-newline "^2.0.0" -fast-deep-equal@^3.1.1: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-glob@^3.1.1: + version "3.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + fastest-levenshtein@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -409,6 +1361,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + find-up@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -417,31 +1376,158 @@ find-up@^4.0.0: locate-path "^5.0.0" path-exists "^4.0.0" +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" + integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== +glob@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2, glob@^7.1.3: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^13.6.0, globals@^13.9.0: + version "13.11.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" + integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== + dependencies: + type-fest "^0.20.2" + +globby@^11.0.3: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + graceful-fs@^4.1.2, graceful-fs@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -449,11 +1535,72 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= + +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + +http-proxy-agent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== + dependencies: + agent-base "4" + debug "3.1.0" + +http-proxy-agent@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" + integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== + dependencies: + "@tootallnate/once" "1" + agent-base "6" + debug "4" + +https-proxy-agent@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" + integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + dependencies: + agent-base "6" + debug "4" + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +ignore@^5.0.5, ignore@^5.1.4: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-local@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" @@ -462,18 +1609,106 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + interpret@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== -is-core-module@^2.2.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" - integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + +is-core-module@^2.2.0, is-core-module@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" + integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== dependencies: has "^1.0.3" +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.0, is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + +is-number-object@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + dependencies: + has-tostringtag "^1.0.0" + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -486,11 +1721,33 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -510,7 +1767,25 @@ jest-worker@^27.0.6: merge-stream "^2.0.0" supports-color "^8.0.0" -json-parse-better-errors@^1.0.2: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== @@ -520,16 +1795,74 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +json5@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" + +"jsx-ast-utils@^2.4.1 || ^3.0.0": + version "3.2.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b" + integrity sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA== + dependencies: + array-includes "^3.1.3" + object.assign "^4.1.2" + kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + loader-runner@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -537,6 +1870,33 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= + +lodash@^4.17.15: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -549,7 +1909,12 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -micromatch@^4.0.0: +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.0, micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -574,16 +1939,97 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mkdirp@0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +mocha@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== + dependencies: + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "5.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanocolors@^0.1.0, nanocolors@^0.1.5: + version "0.1.12" + resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6" + integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +node-releases@^1.1.76: + version "1.1.76" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e" + integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== + node-releases@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -591,6 +2037,74 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-inspect@^1.11.0, object-inspect@^1.9.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" + integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.entries@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd" + integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + +object.fromentries@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" + integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + has "^1.0.3" + +object.hasown@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.0.0.tgz#bdbade33cfacfb25d7f26ae2b6cb870bf99905c2" + integrity sha512-qYMF2CLIjxxLGleeM0jrcB4kiv3loGVAjKQKvH8pSU/i2VcRRvUNmxbD+nEMmrXRfORhuVJuH8OtSYCZoue3zA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.18.1" + +object.values@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" + integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" @@ -598,6 +2112,25 @@ onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -605,6 +2138,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -612,16 +2152,46 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -632,6 +2202,18 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -642,6 +2224,18 @@ picomatch@^2.2.3: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" @@ -649,11 +2243,54 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" + integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= + dependencies: + find-up "^2.1.0" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -661,6 +2298,28 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" +react-is@^16.8.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +read-pkg-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + rechoir@^0.7.0: version "0.7.1" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.1.tgz#9478a96a1ca135b5e88fc027f03ee92d6c645686" @@ -668,6 +2327,24 @@ rechoir@^0.7.0: dependencies: resolve "^1.9.0" +regexp.prototype.flags@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" + integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +regexpp@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -675,12 +2352,17 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-from@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.9.0: +resolve@^1.10.0, resolve@^1.20.0, resolve@^1.9.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -688,11 +2370,43 @@ resolve@^1.9.0: is-core-module "^2.2.0" path-parse "^1.0.6" +resolve@^2.0.0-next.3: + version "2.0.0-next.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" + integrity sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + safe-buffer@^5.1.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + schema-utils@^3.1.0, schema-utils@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" @@ -702,7 +2416,17 @@ schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" -semver@^7.3.4: +"semver@2 || 3 || 4 || 5", semver@^5.4.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.2.1, semver@^7.3.4, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -735,11 +2459,42 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.3: version "3.0.6" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +source-map-support@^0.5.0: + version "0.5.20" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -748,6 +2503,11 @@ source-map-support@~0.5.20: buffer-from "^1.0.0" source-map "^0.6.0" +source-map@^0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -758,11 +2518,117 @@ source-map@~0.7.2: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.10" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" + integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +string-natural-compare@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" + integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== + +string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string.prototype.matchall@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.5.tgz#59370644e1db7e4c0c045277690cf7b01203c4da" + integrity sha512-Z5ZaXO0svs0M2xd/6By3qpeKpLKd9mO4v4q3oMEQrk8Ck4xOD5d5XeBOOjGrmVZZ/AHB1S0CgG4N5r1G9N3E2Q== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + get-intrinsic "^1.1.1" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.3.1" + side-channel "^1.0.4" + +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + dependencies: + has-flag "^3.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -777,6 +2643,18 @@ supports-color@^8.0.0: dependencies: has-flag "^4.0.0" +table@^6.0.9: + version "6.7.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" + integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== + dependencies: + ajv "^8.0.1" + lodash.clonedeep "^4.5.0" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.0" + strip-ansi "^6.0.0" + tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" @@ -802,6 +2680,16 @@ terser@^5.7.2: source-map "~0.7.2" source-map-support "~0.5.20" +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -819,10 +2707,54 @@ ts-loader@^9.2.6: micromatch "^4.0.0" semver "^7.3.4" -typescript@4.3.5: - version "4.3.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" - integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== +tsconfig-paths@^3.11.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" + integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +typescript@4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" + integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== + +unbox-primitive@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" uri-js@^4.2.2: version "4.4.1" @@ -831,6 +2763,40 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +v8-compile-cache@^2.0.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +vscode-test@^0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/vscode-test/-/vscode-test-0.4.3.tgz#461ebf25fc4bc93d77d982aed556658a2e2b90b8" + integrity sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w== + dependencies: + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + +vscode@1.1.37: + version "1.1.37" + resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.37.tgz#c2a770bee4bb3fff765e2b72c7bcc813b8a6bb0a" + integrity sha512-vJNj6IlN7IJPdMavlQa1KoFB3Ihn06q1AiN3ZFI/HfzPNzbKZWPPuiU+XkpNOfGU5k15m4r80nxNPlM7wcc0wg== + dependencies: + glob "^7.1.2" + http-proxy-agent "^4.0.1" + https-proxy-agent "^5.0.0" + mocha "^5.2.0" + semver "^5.4.1" + source-map-support "^0.5.0" + vscode-test "^0.4.1" + watchpack@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.0.tgz#a41bca3da6afaff31e92a433f4c856a0c25ea0c4" @@ -900,6 +2866,17 @@ webpack@^5.64.4: watchpack "^2.3.0" webpack-sources "^3.2.2" +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -912,6 +2889,16 @@ wildcard@^2.0.0: resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" From 3c74f239e138d4365bc3854d9d311ae3a4ea0b6a Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 9 Oct 2021 18:24:06 +0200 Subject: [PATCH 078/110] feat: add initial settings for extension --- .github/workflows/typescript_and_lint.yml | 27 + .vscodeignore | 1 + package.json | 92 +- src/helpers.ts | 30 + src/index.ts | 54 +- src/snippetSearch.ts | 52 + src/snippets/ts-snippets.json | 2 +- src/sourceSnippets/typescript.ts | 323 ++++ src/types.ts | 36 + tsconfig.json | 4 +- webpack.config.js | 57 - yarn.lock | 1952 ++++++++------------- 12 files changed, 1239 insertions(+), 1391 deletions(-) create mode 100644 .github/workflows/typescript_and_lint.yml create mode 100644 src/helpers.ts create mode 100644 src/snippetSearch.ts create mode 100644 src/sourceSnippets/typescript.ts create mode 100644 src/types.ts delete mode 100644 webpack.config.js diff --git a/.github/workflows/typescript_and_lint.yml b/.github/workflows/typescript_and_lint.yml new file mode 100644 index 0000000..738c935 --- /dev/null +++ b/.github/workflows/typescript_and_lint.yml @@ -0,0 +1,27 @@ +name: Typescript & lint + +on: :push + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: "16" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: "**/node_modules" + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install + run: yarn install --frozen-lockfile + + - name: Lint + run: yarn lint + + - name: Typescript + run: yarn typescript diff --git a/.vscodeignore b/.vscodeignore index 8fb7f19..e77db6a 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -3,3 +3,4 @@ src/** .gitignore **/tsconfig.json *.ts +webpack.config.js diff --git a/package.json b/package.json index 1d009c7..384b8c7 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,21 @@ { "name": "es7-react-js-snippets", - "displayName": "ES7+ React/Redux/GraphQL/React-Native snippets", - "description": "Simple extensions for React, Redux and Graphql in JS/TS with ES7+ syntax", + "displayName": "ES7+ React/Redux/React-Native snippets", + "description": "Extensions for React (React-Native), Redux and GraphQL snippets in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", "version": "3.2.0", "publisher": "dsznajder", "icon": "images/logo.png", + "browser": "./lib/index.js", + "main": "./lib/index.js", "keywords": [ "snippets", "react", "redux", "react-native", + "customizable", "javascript", - "typescript" + "typescript", + "prettier" ], "license": "MIT", "repository": { @@ -19,7 +23,7 @@ "url": "https://github.com/dsznajder/vscode-es7-javascript-react-snippets" }, "engines": { - "vscode": "^1.45.0" + "vscode": "^1.60.0" }, "categories": [ "Snippets" @@ -28,8 +32,6 @@ "ui", "workspace" ], - "browser": "./out/extension.js", - "main": "./lib/index.js", "capabilities": { "virtualWorkspaces": true, "untrustedWorkspaces": { @@ -37,23 +39,67 @@ } }, "activationEvents": [ - "onCommand:extension.snippetSearch" + "onCommand:esReactSnippets.search" ], "contributes": { "commands": [ { - "command": "extension.snippetSearch", - "title": "ES7 snippet search" + "command": "esReactSnippets.search", + "title": "Snippet search" } ], "keybindings": [ { - "command": "extension.snippetSearch", + "command": "esReactSnippets.search", "key": "ctrl+alt+r", "mac": "shift+cmd+r", "when": "editorTextFocus" } ], + "configuration": { + "title": "ES React/React-Native/Redux snippets", + "properties": { + "esReactSnippets.settings.prettierEnabled": { + "type": "boolean", + "markdownDescription": "Integrate prettier settings with code generated from snippets.", + "default": true + }, + "esReactSnippets.settings.importReactOnTop": { + "type": "boolean", + "markdownDescription": "Controls if snippets should add `import React from 'react';` at the top of components.\nPreviously components like that were used with `_` prefix.", + "default": true + }, + "esReactSnippets.settings.typescript": { + "type": "boolean", + "markdownDescription": "Controls if React components have typescript Props typing.", + "default": false + }, + "esReactSnippets.settings.semiColons": { + "type": "boolean", + "markdownDescription": "Controls if snippets should use semi colons.\nOnly applies when `#esReactSnippets.settings.prettierEnabled#` is disabled", + "default": true + }, + "esReactSnippets.settings.singleQuote": { + "type": "boolean", + "markdownDescription": "Controls if snippets should use single quotes.\nOnly applies when `#esReactSnippets.settings.prettierEnabled#` is disabled", + "default": true + }, + "esReactSnippets.settings.tabWidth": { + "type": "number", + "markdownDescription": "Controls how many spaces snippets will have.\nOnly applies when `#esReactSnippets.settings.prettierEnabled#` is disabled", + "default": 2 + }, + "esReactSnippets.settings.componentPropsPrefix": { + "type": "string", + "markdownDescription": "Controls which prefix snippets should use for component props.\nOnly applies when `#esReactSnippets.settings.typescript#` is enabled.", + "default": "type", + "enum": [ + "type", + "interface" + ] + } + } + }, "snippets": [ { "language": "javascript", @@ -82,28 +128,28 @@ ] }, "scripts": { - "vscode:prepublish": "yarn run package", - "compile": "tsc -p ./ --noEmit false --outDir lib/", - "compile:web": "webpack --mode production --devtool hidden-source-map", + "vscode:prepublish": "yarn compile", + "compile": "rm -rf lib; tsc -p ./ --noEmit false --module commonjs --outDir lib", + "lint": "eslint --ext .js,.ts,.tsx ./src/", "watch": "tsc -watch -p ./", - "watch:web": "webpack --watch", - "package": "yarn compile && webpack --mode production --devtool hidden-source-map", "typescript": "tsc --noEmit" }, "dependencies": { + "prettier": "2.5.1", "vscode": "1.1.37" }, "devDependencies": { - "@types/node": "16.9.6", - "@types/vscode": "1.60.0", - "eslint": "7.32.0", + "@babel/cli": "7.16.0", + "@babel/preset-typescript": "7.16.5", + "@types/node": "17.0.4", + "@types/prettier": "2.4.2", + "@types/vscode": "1.63.1", + "esbuild": "0.14.8", + "eslint": "8.5.0", "eslint-config-satya164": "3.1.10", "eslint-plugin-simple-import-sort": "7.0.0", - "prettier": "2.4.1", - "ts-loader": "^9.2.6", - "typescript": "4.4.3", - "webpack": "^5.64.4", - "webpack-cli": "^4.9.1" + "prettier": "2.5.1", + "typescript": "4.5.4" }, "prettier": { "bracketSameLine": false, diff --git a/src/helpers.ts b/src/helpers.ts new file mode 100644 index 0000000..fea2cd2 --- /dev/null +++ b/src/helpers.ts @@ -0,0 +1,30 @@ +import prettier, { Options } from "prettier"; +import { workspace } from "vscode"; + +export type ExtensionSettings = { + prettierEnabled: boolean; + semiColons: boolean; + importReactOnTop: boolean; + quotes: boolean; + typescript: boolean; + tabWidth: number; + componentPropsPrefix: "type" | "interface"; +}; + +export const convertSnippetArrayToString = (snippetArray: Array) => snippetArray.join("\n"); + +export const getPrettierConfig = async (): Promise => { + const settings = workspace.getConfiguration( + "esReactSnippets.settings", + ) as unknown as ExtensionSettings; + + const prettierConfig = await prettier.resolveConfig(""); + + return { + semi: settings.semiColons, + singleQuote: settings.quotes, + tabWidth: 2, + parser: "typescript", + ...(settings.prettierEnabled && prettierConfig), + }; +}; diff --git a/src/index.ts b/src/index.ts index 9fe6fa2..30c1884 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,55 +1,11 @@ -import * as vscode from "vscode"; +import { commands, ExtensionContext } from "vscode"; -import jsSnippets from "./snippets/snippets.json"; -import tsSnippets from "./snippets/ts-snippets.json"; +import snippetSearch from "./snippetSearch"; -const convertSnippetArrayToString = (snippetArray: Array) => snippetArray.join("\n"); +export function activate(context: ExtensionContext) { + const snippetSearchCommand = commands.registerCommand("esReactSnippets.search", snippetSearch); -export function activate(context: vscode.ExtensionContext) { - const { - commands: { registerCommand }, - window: { showQuickPick, activeTextEditor }, - } = vscode; - - const disposable = registerCommand("extension.snippetSearch", async () => { - const javascriptSnippets = Object.entries(jsSnippets); - const typescriptSnippets = Object.entries(tsSnippets); - const snippetsArray = javascriptSnippets.concat(typescriptSnippets); - - const items = snippetsArray.map( - // @ts-expect-error - ([shortDescription, { prefix, body, description }], index) => { - const value = typeof prefix === "string" ? prefix : prefix[0]; - - return { - id: index, - description: description || shortDescription, - label: value, - value, - body, - }; - }, - ); - - const options = { - matchOnDescription: true, - matchOnDetail: true, - placeHolder: "Search snippet", - }; - - const snippet = (await showQuickPick(items, options)) || { - body: "", - }; - - const body = - typeof snippet.body === "string" ? snippet.body : convertSnippetArrayToString(snippet.body); - - if (activeTextEditor) { - activeTextEditor.insertSnippet(new vscode.SnippetString(body)); - } - }); - - context.subscriptions.push(disposable); + context.subscriptions.push(snippetSearchCommand); } export function deactivate() {} diff --git a/src/snippetSearch.ts b/src/snippetSearch.ts new file mode 100644 index 0000000..972f270 --- /dev/null +++ b/src/snippetSearch.ts @@ -0,0 +1,52 @@ +import { SnippetString, window } from "vscode"; +import prettier from "prettier"; + +import { convertSnippetArrayToString, getPrettierConfig } from "./helpers"; +import jsSnippets from "./snippets/snippets.json"; +import tsSnippets from "./snippets/ts-snippets.json"; + +const snippetSearch = async () => { + const { showQuickPick, activeTextEditor } = window; + + const javascriptSnippets = Object.entries(jsSnippets); + const typescriptSnippets = Object.entries(tsSnippets); + const snippetsArray = javascriptSnippets.concat(typescriptSnippets); + + const items = snippetsArray.map( + // @ts-expect-error + ([shortDescription, { prefix, body, description }], index) => { + const value = typeof prefix === "string" ? prefix : prefix[0]; + + return { + id: index, + description: description || shortDescription, + label: value, + value, + body, + }; + }, + ); + + const options = { + matchOnDescription: true, + matchOnDetail: true, + placeHolder: "Search snippet", + }; + + const snippet = (await showQuickPick(items, options)) || { + body: "", + }; + + const body = + typeof snippet.body === "string" ? snippet.body : convertSnippetArrayToString(snippet.body); + + if (activeTextEditor) { + const config = await getPrettierConfig(); + const parsedBody = prettier.format(body, config); + console.log(JSON.stringify(parsedBody), JSON.stringify(body)); + + activeTextEditor.insertSnippet(new SnippetString(body)); + } +}; + +export default snippetSearch; diff --git a/src/snippets/ts-snippets.json b/src/snippets/ts-snippets.json index a02539f..7fc4b9d 100644 --- a/src/snippets/ts-snippets.json +++ b/src/snippets/ts-snippets.json @@ -314,7 +314,7 @@ ], "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet" }, - "Export interface": { + "exportInterface": { "prefix": "expint", "body": ["export interface ${1:${TM_FILENAME_BASE}} {$0}"] }, diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts new file mode 100644 index 0000000..7a0c3bd --- /dev/null +++ b/src/sourceSnippets/typescript.ts @@ -0,0 +1,323 @@ +// import { SnippetPlaceholders, TypescriptSnippets } from "../types"; + +// const props = [`${SnippetPlaceholders.TypeInterface} Props {}`, ""]; + +// export const propsInterface = [...props, `${SnippetPlaceholders.TypeInterface} State {}`, ""]; + +// export const typescriptReactClassComponent: TypescriptSnippets = { +// key: "typescriptReactClassComponent", +// prefix: "tsrcc", +// description: "Creates a React component class with ES7 module system and TypeScript interfaces", +// body: [ +// "import React, { Component } from 'react'", +// "", +// ...propsInterface, +// `export default class ${SnippetPlaceholders.FileName} extends Component {`, +// " state = {}", +// "", +// " render() {", +// " return (", +// "
", +// ` ${SnippetPlaceholders.LastTab}`, +// "
", +// " )", +// " }", +// "}", +// "", +// ], +// }; + +// export const typescriptReactClassExportComponent = { +// prefix: "tsrce", +// body: [ +// "import React, { Component } from 'react'", +// "", +// ...propsInterface, +// `class ${SnippetPlaceholders.FileName} extends Component {`, +// " state = {}", +// "", +// " render() {", +// " return (", +// "
", +// " ${SnippetPlaceholders.LastTab}", +// "
", +// " )", +// " }",w +// "}", +// "", +// "export default ${SnippetPlaceholders.FileName}", +// "",q +// ], +// description: "Creates a React component class with ES7 module system and TypeScript interfaces", +// }; +// // "typescriptReactFunctionalExportComponent": { +// // "prefix": "tsrfce", +// // "body": [ d +// // "import React, { ReactElement } from 'react'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "function ${SnippetPlaceholders.FileName}({}: Props): ReactElement {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // "}", +// // "", +// // "export default ${SnippetPlaceholders.FileName}", +// // "" +// // ], +// // "description": "Creates a React Functional Component with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactFunctionalComponent": { +// // "prefix": "tsrfc", +// // "body": [ +// // "import React, { ReactElement } from 'react'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "export default function ${SnippetPlaceholders.FileName}({}: Props): ReactElement {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // "}", +// // "" +// // ], +// // "description": "Creates a React Functional Component with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactArrowFunctionExportComponent": { +// // "prefix": "tsrafce", +// // "body": [ +// // "import React from 'react'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "const ${SnippetPlaceholders.FileName} = (props: Props) => {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // "}", +// // "", +// // "export default ${SnippetPlaceholders.FileName}", +// // "" +// // ], +// // "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactArrowFunctionComponent": { +// // "prefix": "tsrafc", +// // "body": [ +// // "import React from 'react'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "export const ${SnippetPlaceholders.FileName} = (props: Props) => {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // "}", +// // "" +// // ], +// // "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactClassPureComponent": { +// // "prefix": "tsrpc", +// // "body": [ +// // "import React, { PureComponent } from 'react'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "export default class ${SnippetPlaceholders.FileName} extends PureComponent {", +// // " render() {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // " }", +// // "}", +// // "" +// // ], +// // "description": "Creates a React pure component class with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactClassExportPureComponent": { +// // "prefix": "tsrpce", +// // "body": [ +// // "import React, { PureComponent } from 'react'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "class ${SnippetPlaceholders.FileName} extends PureComponent {", +// // " render() {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // " }", +// // "}", +// // "", +// // "export default ${SnippetPlaceholders.FileName}", +// // "" +// // ], +// // "description": "Creates a React pure component class with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactFunctionMemoComponent": { +// // "prefix": "tsrmc", +// // "body": [ +// // "import React, { memo } from 'react'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "export default memo(function ${SnippetPlaceholders.FileName}({}: Props) {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // "})", +// // "" +// // ], +// // "description": "Creates a React Memo Function Component with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactClassCompomentRedux": { +// // "prefix": "tsrcredux", +// // "body": [ +// // "import React, { Component } from 'react'", +// // "import { connect } from 'react-redux'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "interface State {", +// // " ", +// // "}", +// // "", +// // "export class ${SnippetPlaceholders.FileName} extends Component {", +// // " state = {}", +// // "", +// // " render() {", +// // " return (", +// // "
", +// // " ${SnippetPlaceholders.LastTab}", +// // "
", +// // " )", +// // " }", +// // "}", +// // "", +// // "const mapStateToProps = (state) => ({", +// // " ", +// // "})", +// // "", +// // "const mapDispatchToProps = {", +// // " ", +// // "}", +// // "", +// // "export default connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FileName})", +// // "" +// // ], +// // "description": "Creates a React component class with PropTypes with connected redux and ES7 module system and TypeScript interfaces" +// // }, +// // "typescriptReactNativeArrowFunctionComponent": { +// // "prefix": "tsrnf", +// // "body": [ +// // "import React from 'react'", +// // "import { View, Text } from 'react-native'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "const ${SnippetPlaceholders.FileName} = (props: Props) => {", +// // " return (", +// // " ", +// // " ${SnippetPlaceholders.LastTab}", +// // " ", +// // " )", +// // "}", +// // "", +// // "export default ${SnippetPlaceholders.FileName}", +// // "" +// // ], +// // "description": "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface" +// // }, +// // "typescriptReactNativeArrowFunctionComponentNamedProps": { +// // "prefix": "tsrnfi", +// // "body": [ +// // "import React from 'react'", +// // "import { View } from 'react-native'", +// // "", +// // "interface ${SnippetPlaceholders.FileName}Props {", +// // " ", +// // "}", +// // "", +// // "const ${SnippetPlaceholders.FileName}: React.FC<${SnippetPlaceholders.FileName}Props> = (props) => {", +// // " return (", +// // " ", +// // " ${SnippetPlaceholders.LastTab}", +// // " ", +// // " )", +// // "}", +// // "", +// // "export default ${SnippetPlaceholders.FileName}", +// // "" +// // ], +// // "description": "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface" +// // }, +// // "typescriptReactNativeArrowFunctionComponentWithStyles": { +// // "prefix": "tsrnfs", +// // "body": [ +// // "import React from 'react'", +// // "import { StyleSheet, Text, View } from 'react-native'", +// // "", +// // "interface Props {", +// // " ", +// // "}", +// // "", +// // "const ${SnippetPlaceholders.FileName} = (props: Props) => {", +// // " return (", +// // " ", +// // " ${SnippetPlaceholders.LastTab}", +// // " ", +// // " )", +// // "}", +// // "", +// // "export default ${SnippetPlaceholders.FileName}", +// // "", +// // "const styles = StyleSheet.create({})", +// // "" +// // ], +// // "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet" +// // }, + +// export const exportType = { +// prefix: "exptp", +// body: [`export type ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`], +// }; + +// export const exportInterface = { +// prefix: "expint", +// body: [ +// `export exportInterface ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, +// ], +// }; diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..54ec500 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,36 @@ +export enum SnippetPlaceholders { + FileName = "FILE_NAME", + FirstTab = "FIRST_TAB", + LastTab = "LAST_TAB", + TypeInterface = "TYPE_INTERFACE", +} + +export type SnippetMapping = { + key: T; + prefix: K; + body: Array; + description: string; +}; + +export type TypescriptMappings = { + typescriptReactArrowFunctionComponent: "tsrafc"; + typescriptReactArrowFunctionExportComponent: "tsrafce"; + typescriptReactClassComponent: "tsrcc"; + typescriptReactClassComponentRedux: "tsrcredux"; + typescriptReactClassExportComponent: "tsrce"; + typescriptReactClassExportPureComponent: "tsrpce"; + typescriptReactClassPureComponent: "tsrpc"; + typescriptReactFunctionMemoComponent: "tsrmc"; + typescriptReactFunctionalComponent: "tsrfc"; + typescriptReactFunctionalExportComponent: "tsrfce"; + typescriptReactNativeArrowFunctionComponent: "tsrnf"; + typescriptReactNativeArrowFunctionComponentNamedProps: "tsrnfi"; + typescriptReactNativeArrowFunctionComponentWithStyles: "tsrnfs"; + exportInterface: "expint"; + exportType: "exptp"; +}; + +export type TypescriptSnippets = SnippetMapping< + keyof TypescriptMappings, + TypescriptMappings[keyof TypescriptMappings] +>; diff --git a/tsconfig.json b/tsconfig.json index 79e9c2c..298c2d4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "allowSyntheticDefaultImports": true, "baseUrl": "./", "esModuleInterop": true, - "module": "ESNext", + "module": "amd", "moduleResolution": "Node", "noEmit": true, "noImplicitAny": true, @@ -18,6 +18,6 @@ "strictNullChecks": true, "target": "ESNext" }, - "exclude": ["node_modules", "jest", "**/__tests__/*"], + "exclude": ["node_modules", "jest", "webpack.config.js", "**/__tests__/*"], "compileOnSave": false } diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 12c7e40..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,57 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); - -/** @typedef {import('webpack').Configuration} WebpackConfig **/ -/** @type WebpackConfig */ -const webExtensionConfig = { - mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') - target: 'webworker', // extensions run in a webworker context - entry: { - extension: './extension/index.ts', // source of the web extension main file - }, - externals: { - vscode: 'commonjs vscode' // ignored because it doesn't exist - }, - performance: { - hints: false - }, - devtool: 'nosources-source-map', // create a source map that points to the original source file - resolve: { - mainFields: ['browser', 'module', 'main'], // look for `browser` entry point in imported node modules - extensions: ['.ts', '.js'], // support ts-files and js-files - alias: { - // provides alternate implementation for node module and source files - }, - fallback: { - // Webpack 5 no longer polyfills Node.js core modules automatically. - // see https://webpack.js.org/configuration/resolve/#resolvefallback - // for the list of Node.js core module polyfills. - } - }, - plugins: [ - new webpack.ProvidePlugin({ - process: 'process/browser' // provide a shim for the global `process` variable - }) - ], - module: { - rules: [ - { - test: /\.ts$/, - exclude: /node_modules/, - use: [ - { - loader: 'ts-loader' - } - ] - } - ] - }, - output: { - filename: '[name].js', - path: path.join(__dirname, './out'), - libraryTarget: 'commonjs', - devtoolModuleFilenameTemplate: '../../[resource-path]' - }, -}; - -module.exports = webExtensionConfig; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 01f9c82..596d5a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,39 +2,48 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" +"@babel/cli@7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.16.0.tgz#a729b7a48eb80b49f48a339529fc4129fd7bcef3" + integrity sha512-WLrM42vKX/4atIoQB+eb0ovUof53UUvecb4qGjU2PDDWRiZr50ZpiV8NpcLo7iSxeGYrRG0Mqembsa+UrTAV6Q== + dependencies: + commander "^4.0.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.1.0" + glob "^7.0.0" + make-dir "^2.1.0" + slash "^2.0.0" + source-map "^0.5.0" + optionalDependencies: + "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" + chokidar "^3.4.0" -"@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== +"@babel/code-frame@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" + integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== dependencies: - "@babel/highlight" "^7.14.5" + "@babel/highlight" "^7.16.0" -"@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== +"@babel/compat-data@^7.16.0": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" + integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== "@babel/core@^7.13.10": - version "7.15.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" - integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.5" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.5.tgz#924aa9e1ae56e1e55f7184c8bf073a50d8677f5c" + integrity sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.5" + "@babel/helper-compilation-targets" "^7.16.3" + "@babel/helper-module-transforms" "^7.16.5" + "@babel/helpers" "^7.16.5" + "@babel/parser" "^7.16.5" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.5" + "@babel/types" "^7.16.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -43,116 +52,149 @@ source-map "^0.5.0" "@babel/eslint-parser@^7.13.10": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.15.7.tgz#2dc3d0ff0ea22bb1e08d93b4eeb1149bf1c75f2d" - integrity sha512-yJkHyomClm6A2Xzb8pdAo4HzYMSXFn1O5zrCYvbFP0yQFvHueLedV8WiEno8yJOKStjUXzBZzJFeWQ7b3YMsqQ== + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.16.5.tgz#48d3485091d6e36915358e4c0d0b2ebe6da90462" + integrity sha512-mUqYa46lgWqHKQ33Q6LNCGp/wPR3eqOYTUixHFsfrSQqRxH0+WOzca75iEjFr5RDGH1dDz622LaHhLOzOuQRUA== dependencies: eslint-scope "^5.1.1" eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" - integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== +"@babel/generator@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.5.tgz#26e1192eb8f78e0a3acaf3eede3c6fc96d22bedf" + integrity sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== +"@babel/helper-annotate-as-pure@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz#9a1f0ebcda53d9a2d00108c4ceace6a5d5f1f08d" + integrity sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-compilation-targets@^7.16.3": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" + integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== dependencies: - "@babel/compat-data" "^7.15.0" + "@babel/compat-data" "^7.16.0" "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-function-name@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" - integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== +"@babel/helper-create-class-features-plugin@^7.16.0": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz#5d1bcd096792c1ebec6249eebc6358eec55d0cad" + integrity sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg== dependencies: - "@babel/helper-get-function-arity" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-environment-visitor" "^7.16.5" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-member-expression-to-functions" "^7.16.5" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.5" + "@babel/helper-split-export-declaration" "^7.16.0" -"@babel/helper-get-function-arity@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" - integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== +"@babel/helper-environment-visitor@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz#f6a7f38b3c6d8b07c88faea083c46c09ef5451b8" + integrity sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-hoist-variables@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" - integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== +"@babel/helper-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" + integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== dependencies: - "@babel/types" "^7.15.4" + "@babel/helper-get-function-arity" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== +"@babel/helper-get-function-arity@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" + integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== +"@babel/helper-hoist-variables@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" + integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-module-transforms@^7.15.4": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" - integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== +"@babel/helper-member-expression-to-functions@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz#1bc9f7e87354e86f8879c67b316cb03d3dc2caab" + integrity sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw== dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/types" "^7.16.0" + +"@babel/helper-module-imports@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" + integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-module-transforms@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz#530ebf6ea87b500f60840578515adda2af470a29" + integrity sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ== + dependencies: + "@babel/helper-environment-visitor" "^7.16.5" + "@babel/helper-module-imports" "^7.16.0" + "@babel/helper-simple-access" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.5" + "@babel/types" "^7.16.0" -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== +"@babel/helper-optimise-call-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" + integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" + +"@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz#afe37a45f39fce44a3d50a7958129ea5b1a5c074" + integrity sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ== -"@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== +"@babel/helper-replace-supers@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz#96d3988bd0ab0a2d22c88c6198c3d3234ca25326" + integrity sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ== dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-environment-visitor" "^7.16.5" + "@babel/helper-member-expression-to-functions" "^7.16.5" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/traverse" "^7.16.5" + "@babel/types" "^7.16.0" -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== +"@babel/helper-simple-access@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" + integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== +"@babel/helper-split-export-declaration@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" + integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": +"@babel/helper-validator-identifier@^7.15.7": version "7.15.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== @@ -162,94 +204,120 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== -"@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== +"@babel/helpers@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.5.tgz#29a052d4b827846dd76ece16f565b9634c554ebd" + integrity sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw== dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.5" + "@babel/types" "^7.16.0" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== +"@babel/highlight@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" + integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" + "@babel/helper-validator-identifier" "^7.15.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.15.4", "@babel/parser@^7.15.5": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" - integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== - -"@babel/template@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/traverse@^7.15.4", "@babel/traverse@^7.7.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" +"@babel/parser@^7.16.0", "@babel/parser@^7.16.5": + version "7.16.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.6.tgz#8f194828193e8fa79166f34a4b4e52f3e769a314" + integrity sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ== + +"@babel/plugin-syntax-typescript@^7.16.0": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.5.tgz#f47a33e4eee38554f00fb6b2f894fa1f5649b0b3" + integrity sha512-/d4//lZ1Vqb4mZ5xTep3dDK888j7BGM/iKqBmndBaoYAFPlPKrGU608VVBz5JeyAb6YQDjRu1UKqj86UhwWVgw== + dependencies: + "@babel/helper-plugin-utils" "^7.16.5" + +"@babel/plugin-transform-typescript@^7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz#cc0670b2822b0338355bc1b3d2246a42b8166409" + integrity sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.16.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-typescript" "^7.16.0" + +"@babel/preset-typescript@7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.5.tgz#b86a5b0ae739ba741347d2f58c52f52e63cf1ba1" + integrity sha512-lmAWRoJ9iOSvs3DqOndQpj8XqXkzaiQs50VG/zESiI9D3eoZhGriU675xNCr0UwvsuXrhMAGvyk1w+EVWF3u8Q== + dependencies: + "@babel/helper-plugin-utils" "^7.16.5" + "@babel/helper-validator-option" "^7.14.5" + "@babel/plugin-transform-typescript" "^7.16.1" + +"@babel/template@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" + integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/traverse@^7.16.5", "@babel/traverse@^7.7.4": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.5.tgz#d7d400a8229c714a59b87624fc67b0f1fbd4b2b3" + integrity sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.5" + "@babel/helper-environment-visitor" "^7.16.5" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/parser" "^7.16.5" + "@babel/types" "^7.16.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.15.4", "@babel/types@^7.15.6": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== +"@babel/types@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" + integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== dependencies: - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" -"@discoveryjs/json-ext@^0.5.0": - version "0.5.5" - resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz#9283c9ce5b289a3c4f61c12757469e59377f81f3" - integrity sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA== - -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint/eslintrc@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" + integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" + debug "^4.3.2" + espree "^9.2.0" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" - js-yaml "^3.13.1" + js-yaml "^4.1.0" minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== +"@humanwhocodes/config-array@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" + integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== dependencies: - "@humanwhocodes/object-schema" "^1.2.0" + "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": + version "2.1.8-no-fsevents.3" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" + integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -277,28 +345,7 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@types/eslint-scope@^3.7.0": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.1.tgz#8dc390a7b4f9dd9f1284629efce982e41612116e" - integrity sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g== - dependencies: - "@types/eslint" "*" - "@types/estree" "*" - -"@types/eslint@*": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.2.0.tgz#afd0519223c29c347087542cbaee2fedc0873b16" - integrity sha512-74hbvsnc+7TEDa1z5YLSe4/q8hGYB3USNvCuzHUJrjPV6hXaq8IXcngCrHkuvFt0+8rFz7xYXrHgNayIX0UZvQ== - dependencies: - "@types/estree" "*" - "@types/json-schema" "*" - -"@types/estree@*", "@types/estree@^0.0.50": - version "0.0.50" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" - integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== - -"@types/json-schema@*", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8": +"@types/json-schema@^7.0.7": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== @@ -308,254 +355,97 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/node@*": - version "16.11.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" - integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== +"@types/node@17.0.4": + version "17.0.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.4.tgz#fec0ce0526abb6062fd206d72a642811b887a111" + integrity sha512-6xwbrW4JJiJLgF+zNypN5wr2ykM9/jHcL7rQ8fZe2vuftggjzZeRSM4OwRc6Xk8qWjwJ99qVHo/JgOGmomWRog== -"@types/node@16.9.6": - version "16.9.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.6.tgz#040a64d7faf9e5d9e940357125f0963012e66f04" - integrity sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ== +"@types/prettier@2.4.2": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" + integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== -"@types/vscode@1.60.0": - version "1.60.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.60.0.tgz#9330c317691b4f53441a18b598768faeeb71618a" - integrity sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow== +"@types/vscode@1.63.1": + version "1.63.1" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.63.1.tgz#b40f9f18055e2c9498ae543d18c59fbd6ef2e8a3" + integrity sha512-Z+ZqjRcnGfHP86dvx/BtSwWyZPKQ/LBdmAVImY82TphyjOw2KgTKcp7Nx92oNwCTsHzlshwexAG/WiY2JuUm3g== "@typescript-eslint/eslint-plugin@^4.19.0": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz#9f41efaee32cdab7ace94b15bd19b756dd099b0a" - integrity sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA== + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" + integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== dependencies: - "@typescript-eslint/experimental-utils" "4.31.2" - "@typescript-eslint/scope-manager" "4.31.2" + "@typescript-eslint/experimental-utils" "4.33.0" + "@typescript-eslint/scope-manager" "4.33.0" debug "^4.3.1" functional-red-black-tree "^1.0.1" + ignore "^5.1.8" regexpp "^3.1.0" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.31.2", "@typescript-eslint/experimental-utils@^4.0.1": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz#98727a9c1e977dd5d20c8705e69cd3c2a86553fa" - integrity sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q== +"@typescript-eslint/experimental-utils@4.33.0", "@typescript-eslint/experimental-utils@^4.0.1": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" + integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" "@typescript-eslint/parser@^4.19.0": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" - integrity sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw== + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" + integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== dependencies: - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz#1d528cb3ed3bcd88019c20a57c18b897b073923a" - integrity sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w== +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/types@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" - integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/typescript-estree@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" - integrity sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA== +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" debug "^4.3.1" globby "^11.0.3" is-glob "^4.0.1" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" - integrity sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug== +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== dependencies: - "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== - dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== - -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== - -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== - -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== - dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@xtuc/long" "4.2.2" - -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== - -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== - dependencies: - "@xtuc/ieee754" "^1.2.0" - -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== - dependencies: - "@xtuc/long" "4.2.2" - -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@xtuc/long" "4.2.2" - -"@webpack-cli/configtest@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.0.tgz#8342bef0badfb7dfd3b576f2574ab80c725be043" - integrity sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg== - -"@webpack-cli/info@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.0.tgz#b9179c3227ab09cbbb149aa733475fcf99430223" - integrity sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw== - dependencies: - envinfo "^7.7.3" - -"@webpack-cli/serve@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.0.tgz#2c275aa05c895eccebbfc34cfb223c6e8bd591a2" - integrity sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA== - -"@xtuc/ieee754@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" - integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== - -"@xtuc/long@4.2.2": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" - integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== - -acorn-import-assertions@^1.7.6: - version "1.8.0" - resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" - integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== - acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -acorn@^8.4.1: +acorn@^8.6.0: version "8.6.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== @@ -574,12 +464,7 @@ agent-base@6: dependencies: debug "4" -ajv-keywords@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" - integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== - -ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -589,16 +474,6 @@ ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: - version "8.6.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -616,65 +491,70 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: - sprintf-js "~1.0.2" + normalize-path "^3.0.0" + picomatch "^2.0.4" -array-includes@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" - integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-includes@^3.1.3, array-includes@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" + integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + es-abstract "^1.19.1" get-intrinsic "^1.1.1" - is-string "^1.0.5" + is-string "^1.0.7" array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array.prototype.flat@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" - integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== +array.prototype.flat@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" + integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" + es-abstract "^1.19.0" -array.prototype.flatmap@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" - integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== +array.prototype.flatmap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446" + integrity sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA== dependencies: call-bind "^1.0.0" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - function-bind "^1.1.1" - -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + es-abstract "^1.19.0" balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -683,7 +563,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.1: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -695,28 +575,17 @@ browser-stdout@1.3.1: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.14.5: - version "4.18.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" - integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ== +browserslist@^4.17.5: + version "4.19.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3" + integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== dependencies: - caniuse-lite "^1.0.30001280" - electron-to-chromium "^1.3.896" + caniuse-lite "^1.0.30001286" + electron-to-chromium "^1.4.17" escalade "^3.1.1" node-releases "^2.0.1" picocolors "^1.0.0" -browserslist@^4.16.6: - version "4.17.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.1.tgz#a98d104f54af441290b7d592626dd541fa642eb9" - integrity sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ== - dependencies: - caniuse-lite "^1.0.30001259" - electron-to-chromium "^1.3.846" - escalade "^3.1.1" - nanocolors "^0.1.5" - node-releases "^1.1.76" - buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" @@ -735,17 +604,10 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -caniuse-lite@^1.0.30001259: - version "1.0.30001260" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz#e3be3f34ddad735ca4a2736fa9e768ef34316270" - integrity sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg== - dependencies: - nanocolors "^0.1.0" - -caniuse-lite@^1.0.30001280: - version "1.0.30001283" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001283.tgz#8573685bdae4d733ef18f78d44ba0ca5fe9e896b" - integrity sha512-9RoKo841j1GQFSJz/nCXOj0sD7tHBtlowjYlrqIUS812x9/emfBLBt6IyMz1zIaYc/eRL8Cs6HPUVi2Hzq4sIg== +caniuse-lite@^1.0.30001286: + version "1.0.30001292" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz#4a55f61c06abc9595965cfd77897dc7bc1cdc456" + integrity sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw== chalk@^2.0.0: version "2.4.2" @@ -756,7 +618,7 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -764,19 +626,20 @@ chalk@^4.0.0, chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chrome-trace-event@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" - integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== - -clone-deep@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" - integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== - dependencies: - is-plain-object "^2.0.4" - kind-of "^6.0.2" - shallow-clone "^3.0.0" +chokidar@^3.4.0: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" color-convert@^1.9.0: version "1.9.3" @@ -802,39 +665,29 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^2.0.14: - version "2.0.16" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" - integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== - commander@2.15.1: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^7.0.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commander@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -convert-source-map@^1.7.0: +convert-source-map@^1.1.0, convert-source-map@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== dependencies: safe-buffer "~5.1.1" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -850,10 +703,10 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" @@ -909,28 +762,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.3.846: - version "1.3.849" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.849.tgz#45a65a392565abc5b864624b9753393336426f4b" - integrity sha512-RweyW60HPOqIcxoKTGr38Yvtf2aliSUqX8dB3e9geJ0Bno0YLjcOX5F7/DPVloBkJWaPZ7xOM1A0Yme2T1A34w== - -electron-to-chromium@^1.3.896: - version "1.4.4" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.4.tgz#57311918524c1a26878c330537f967804d43788a" - integrity sha512-teHtgwcmVcL46jlFvAaqjyiTLWuMrUQO1JqV303JKB4ysXG6m8fXSFhbjal9st0r9mNskI22AraJZorb1VcLVg== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.3: - version "5.8.3" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" - integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" +electron-to-chromium@^1.4.17: + version "1.4.27" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.27.tgz#bfc6e798d8a56a17d658312f4b7ae1a7ca87724f" + integrity sha512-uZ95szi3zUbzRDx1zx/xnsCG+2xgZyy57pDOeaeO4r8zx5Dqe8Jv1ti8cunvBwJHVI5LzPuw8umKwZb3WKYxSQ== enquirer@^2.3.5: version "2.3.6" @@ -939,22 +774,10 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -envinfo@^7.7.3: - version "7.8.1" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.1, es-abstract@^1.18.2: - version "1.18.6" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.6.tgz#2c44e3ea7a6255039164d26559777a6d978cb456" - integrity sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ== +es-abstract@^1.19.0, es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" @@ -967,7 +790,9 @@ es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.1, es- is-callable "^1.2.4" is-negative-zero "^2.0.1" is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" is-string "^1.0.7" + is-weakref "^1.0.1" object-inspect "^1.11.0" object-keys "^1.1.1" object.assign "^4.1.2" @@ -975,11 +800,6 @@ es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.1, es- string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.1" -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== - es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -1001,6 +821,120 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" +esbuild-android-arm64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.8.tgz#69324e08ba68c7d9a541e7b825d7235b83e17bd6" + integrity sha512-tAEoSHnPBSH0cCAFa/aYs3LPsoTY4SwsP6wDKi4PaelbQYNJjqNpAeweyJ8l98g1D6ZkLyqsHbkYj+209sezkA== + +esbuild-darwin-64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.8.tgz#7176b692b9de746ba2f9dd4dd81dc4f1b7670786" + integrity sha512-t7p7WzTb+ybiD/irkMt5j/NzB+jY+8yPTsrXk5zCOH1O7DdthRnAUJ7pJPwImdL7jAGRbLtYRxUPgCHs/0qUPw== + +esbuild-darwin-arm64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.8.tgz#59167584e58428877e48e05c4cca58755f843327" + integrity sha512-5FeaT2zMUajKnBwUMSsjZev5iA38YHrDmXhkOCwZQIFUvhqojinqCrvv/X7dyxb1987bcY9KGwJ+EwDwd922HQ== + +esbuild-freebsd-64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.8.tgz#00b7d6e00abba9c2eccc9acd576c796333671e9c" + integrity sha512-pGHBLSf7ynfyDZXUtbq/GsA2VIwQlWXrUj1AMcE0id47mRdEUM8/1ZuqMGZx63hRnNgtK9zNJ8OIu2c7qq76Qw== + +esbuild-freebsd-arm64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.8.tgz#57f0cd5a1cb37fa2c0e84e780677fe62f1e8c894" + integrity sha512-g4GgAnrx6Gh1BjKJjJWgPnOR4tW2FcAx9wFvyUjRsIjB35gT+aAFR+P/zStu5OG9LnbS8Pvjd4wS68QIXk+2dA== + +esbuild-linux-32@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.8.tgz#bbf3e5d3fb30f949030d0c2241ac93a172917d56" + integrity sha512-wPfQJadF5vTzriw/B8Ide74PeAJlZW7czNx3NIUHkHlXb+En1SeIqNzl6jG9DuJUl57xD9Ucl9YJFEkFeX8eLg== + +esbuild-linux-64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.8.tgz#08631e9e0da613603bcec782f29fecbc6f4596de" + integrity sha512-+RNuLk9RhRDL2kG+KTEYl5cIgF6AGLkRnKKWEu9DpCZaickONEqrKyQSVn410Hj105DLdW6qvIXQQHPycJhExg== + +esbuild-linux-arm64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.8.tgz#206d39c8dfbb7c72aa2f5fc52f7402b5b8a77366" + integrity sha512-BtWoKNYul9UoxUvQUSdSrvSmJyFL1sGnNPTSqWCg1wMe4kmc8UY2yVsXSSkKO8N2jtHxlgFyz/XhvNBzEwGVcw== + +esbuild-linux-arm@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.8.tgz#e28e70420d187f5e403bfa4a72df676d53d707fd" + integrity sha512-HIct38SvUAIJbiTwV/PVQroimQo96TGtzRDAEZxTorB4vsAj1r8bd0keXExPU4RH7G0zIqC4loQQpWYL+nH4Vg== + +esbuild-linux-mips64le@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.8.tgz#04997ac1a0df794a4d5e04d78015863d48490590" + integrity sha512-0DxnCl9XTvaQtsX6Qa+Phr5i9b04INwwSv2RbQ2UWRLoQ/037iaFzbmuhgrcmaGOcRwPkCa+4Qo5EgI01MUgsQ== + +esbuild-linux-ppc64le@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.8.tgz#1827378feff9702c156047ba118c1f3bd74da67e" + integrity sha512-Uzr/OMj97Q0qoWLXCvXCKUY/z1SNI4iSZEuYylM5Nd71HGStL32XWq/MReJ0PYMvUMKKJicKSKw2jWM1uBQ84Q== + +esbuild-linux-s390x@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.8.tgz#200ac44cda59b81135b325c3a29d016969650876" + integrity sha512-vURka7aCA5DrRoOqOn6pXYwFlDSoQ4qnqam8AC0Ikn6tibutuhgar6M3Ek2DCuz9yqd396mngdYr5A8x2TPkww== + +esbuild-netbsd-64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.8.tgz#8159d8eae111f80ea6e4cbfa5d4cf658388a72d4" + integrity sha512-tjyDak2/pp0VUAhBW6/ueuReMd5qLHNlisXl5pq0Xn0z+kH9urA/t1igm0JassWbdMz123td5ZEQWoD9KbtOAw== + +esbuild-openbsd-64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.8.tgz#2a9498d881a3ab94927c724f34dd1160eef1f3b8" + integrity sha512-zAKKV15fIyAuDDga5rQv0lW2ufBWj/OCjqjDBb3dJf5SfoAi/DMIHuzmkKQeDQ+oxt9Rp1D7ZOlOBVflutFTqQ== + +esbuild-sunos-64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.8.tgz#2447de7d79848ad528c7d44caab4938eb8f5a0cc" + integrity sha512-xV41Wa8imziM/2dbWZjLKQbIETRgo5dE0oc/uPsgaecJhsrdA0VkGa/V432LJSUYv967xHDQdoRRl5tr80+NnQ== + +esbuild-windows-32@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.8.tgz#3287281552d7e4c851b3106940ff5826f518043e" + integrity sha512-AxpdeLKQSyCZo7MzdOyV4OgEbEJcjnrS/2niAjbHESbjuS5P1DN/5vZoJ/JSWDVa/40OkBuHBhAXMx1HK3UDsg== + +esbuild-windows-64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.8.tgz#b4052868438b4f17b5c2a908cf344ed2bd267c38" + integrity sha512-/3pllNoy8mrz/E1rYalwiwwhzJBrYQhEapwAteHZbFVhGzYuB8F80e8x5eA8dhFHxDiZh1VzK+hREwwSt8UTQA== + +esbuild-windows-arm64@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.8.tgz#512d06097cb4b848526a37c48a47223f1c6cc667" + integrity sha512-lTm5naoNgaUvzIiax3XYIEebqwr3bIIEEtqUhzQ2UQ+JMBmvhr02w3sJIJqF3axTX6TgWrC1OtM7DYNvFG+aXA== + +esbuild@0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.8.tgz#f60a07ca9400d61d09a98f96d666c50613972550" + integrity sha512-stMsCBmxwaMpeK8GC/49L/cRGIwsHwoEN7Twk5zDTHlm/63c0KXFKzDC8iM2Mi3fyCKwS002TAH6IlAvqR6t3g== + optionalDependencies: + esbuild-android-arm64 "0.14.8" + esbuild-darwin-64 "0.14.8" + esbuild-darwin-arm64 "0.14.8" + esbuild-freebsd-64 "0.14.8" + esbuild-freebsd-arm64 "0.14.8" + esbuild-linux-32 "0.14.8" + esbuild-linux-64 "0.14.8" + esbuild-linux-arm "0.14.8" + esbuild-linux-arm64 "0.14.8" + esbuild-linux-mips64le "0.14.8" + esbuild-linux-ppc64le "0.14.8" + esbuild-linux-s390x "0.14.8" + esbuild-netbsd-64 "0.14.8" + esbuild-openbsd-64 "0.14.8" + esbuild-sunos-64 "0.14.8" + esbuild-windows-32 "0.14.8" + esbuild-windows-64 "0.14.8" + esbuild-windows-arm64 "0.14.8" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1049,12 +983,13 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-module-utils@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz#94e5540dd15fe1522e8ffa3ec8db3b7fa7e7a534" - integrity sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q== +eslint-module-utils@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" + integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== dependencies: debug "^3.2.7" + find-up "^2.1.0" pkg-dir "^2.0.0" eslint-plugin-babel@^5.3.1: @@ -1081,30 +1016,28 @@ eslint-plugin-flowtype@^5.4.0: string-natural-compare "^3.0.1" eslint-plugin-import@^2.22.1: - version "2.24.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz#2c8cd2e341f3885918ee27d18479910ade7bb4da" - integrity sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q== + version "2.25.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766" + integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg== dependencies: - array-includes "^3.1.3" - array.prototype.flat "^1.2.4" + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" debug "^2.6.9" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.6.2" - find-up "^2.0.0" + eslint-module-utils "^2.7.1" has "^1.0.3" - is-core-module "^2.6.0" + is-core-module "^2.8.0" + is-glob "^4.0.3" minimatch "^3.0.4" - object.values "^1.1.4" - pkg-up "^2.0.0" - read-pkg-up "^3.0.0" + object.values "^1.1.5" resolve "^1.20.0" tsconfig-paths "^3.11.0" eslint-plugin-jest@^24.3.2: - version "24.4.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.4.2.tgz#9e8cf05ee6a0e3025e6149df2f36950abfa8d5bf" - integrity sha512-jNMnqwX75z0RXRMXkxwb/+9ylKJYJLJ8nT8nBT0XFM5qx4IQGxP4edMawa0qGkSbHae0BDPBmi8I2QF0/F04XQ== + version "24.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.7.0.tgz#206ac0833841e59e375170b15f8d0955219c4889" + integrity sha512-wUxdF2bAZiYSKBclsUMrYHH6WxiBreNjyDxbRv345TIvPeoCEgPNEn3Sa+ZrSqsf1Dl9SqqSREXMHExlMMu1DA== dependencies: "@typescript-eslint/experimental-utils" "^4.0.1" @@ -1116,9 +1049,9 @@ eslint-plugin-prettier@^3.3.1: prettier-linter-helpers "^1.0.0" eslint-plugin-react-hooks@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556" - integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ== + version "4.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz#318dbf312e06fab1c835a4abef00121751ac1172" + integrity sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA== eslint-plugin-react-native-globals@^0.1.1: version "0.1.2" @@ -1134,24 +1067,24 @@ eslint-plugin-react-native@^3.10.0: eslint-plugin-react-native-globals "^0.1.1" eslint-plugin-react@^7.23.0: - version "7.26.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.0.tgz#3ae019a35d542b98e5af9e2f96b89c232c74b55b" - integrity sha512-dceliS5itjk4EZdQYtLMz6GulcsasguIs+VTXuiC7Q5IPIdGTkyfXVdmsQOqEhlD9MciofH4cMcT1bw1WWNxCQ== + version "7.28.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf" + integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw== dependencies: - array-includes "^3.1.3" - array.prototype.flatmap "^1.2.4" + array-includes "^3.1.4" + array.prototype.flatmap "^1.2.5" doctrine "^2.1.0" - estraverse "^5.2.0" + estraverse "^5.3.0" jsx-ast-utils "^2.4.1 || ^3.0.0" minimatch "^3.0.4" - object.entries "^1.1.4" - object.fromentries "^2.0.4" - object.hasown "^1.0.0" - object.values "^1.1.4" + object.entries "^1.1.5" + object.fromentries "^2.0.5" + object.hasown "^1.1.0" + object.values "^1.1.5" prop-types "^15.7.2" resolve "^2.0.0-next.3" semver "^6.3.0" - string.prototype.matchall "^4.0.5" + string.prototype.matchall "^4.0.6" eslint-plugin-simple-import-sort@7.0.0: version "7.0.0" @@ -1163,7 +1096,7 @@ eslint-rule-composer@^0.3.0: resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== -eslint-scope@5.1.1, eslint-scope@^5.1.1: +eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -1171,12 +1104,13 @@ eslint-scope@5.1.1, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-scope@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== dependencies: - eslint-visitor-keys "^1.1.0" + esrecurse "^4.3.0" + estraverse "^5.2.0" eslint-utils@^3.0.0: version "3.0.0" @@ -1185,47 +1119,46 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint@7.32.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== +eslint-visitor-keys@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" + integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== + +eslint@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f" + integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg== dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" + "@eslint/eslintrc" "^1.0.5" + "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" + eslint-scope "^7.1.0" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.1.0" + espree "^9.2.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" + glob-parent "^6.0.1" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" @@ -1233,27 +1166,21 @@ eslint@7.32.0: natural-compare "^1.4.0" optionator "^0.9.1" progress "^2.0.0" - regexpp "^3.1.0" + regexpp "^3.2.0" semver "^7.2.1" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" strip-json-comments "^3.1.0" - table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" + integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== dependencies: - acorn "^7.4.0" + acorn "^8.6.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + eslint-visitor-keys "^3.1.0" esquery@^1.4.0: version "1.4.0" @@ -1274,36 +1201,16 @@ estraverse@^4.1.1: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -events@^3.2.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" - integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -1335,11 +1242,6 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fastest-levenshtein@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" - integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== - fastq@^1.6.0: version "1.13.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" @@ -1361,21 +1263,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-up@^2.0.0, find-up@^2.1.0: +find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -1385,15 +1279,25 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" - integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== + version "3.2.4" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" + integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== + +fs-readdir-recursive@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -1418,11 +1322,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.1" -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - get-symbol-description@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" @@ -1431,17 +1330,19 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" -glob-parent@^5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob-to-regexp@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" - integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" glob@7.1.2: version "7.1.2" @@ -1455,7 +1356,7 @@ glob@7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.2, glob@^7.1.3: +glob@^7.0.0, glob@^7.1.2, glob@^7.1.3: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -1473,9 +1374,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" - integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== + version "13.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e" + integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg== dependencies: type-fest "^0.20.2" @@ -1491,11 +1392,6 @@ globby@^11.0.3: merge2 "^1.3.0" slash "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.2.4: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" @@ -1540,11 +1436,6 @@ he@1.1.1: resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - http-proxy-agent@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" @@ -1578,20 +1469,15 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.5, ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.0.5, ignore@^5.1.4, ignore@^5.1.8: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" @@ -1601,14 +1487,6 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-local@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" - integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -1636,16 +1514,6 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" @@ -1653,6 +1521,13 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" @@ -1666,10 +1541,10 @@ is-callable@^1.1.4, is-callable@^1.2.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== -is-core-module@^2.2.0, is-core-module@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== +is-core-module@^2.2.0, is-core-module@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== dependencies: has "^1.0.3" @@ -1685,22 +1560,17 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: version "1.0.6" @@ -1714,13 +1584,6 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -1729,10 +1592,10 @@ is-regex@^1.1.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" @@ -1748,58 +1611,40 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" +is-weakref@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jest-worker@^27.0.6: - version "27.4.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.0.tgz#fa10dddc611cbb47a4153543dd16a0c7e7fd745c" - integrity sha512-4WuKcUxtzxBoKOUFbt1MtTY9fJwPVD4aN/4Cgxee7OLetPZn5as2bjfZz98XSf2Zq1JFfhqPZpS+43BmWXKgCA== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^8.0.0" - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: - argparse "^1.0.7" - esprima "^4.0.0" + argparse "^2.0.1" jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" @@ -1827,11 +1672,6 @@ json5@^2.1.2: array-includes "^3.1.3" object.assign "^4.1.2" -kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -1840,21 +1680,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -loader-runner@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" - integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -1863,28 +1688,11 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - lodash@^4.17.15: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -1904,17 +1712,20 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" merge2@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.0, micromatch@^4.0.4: +micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -1922,23 +1733,6 @@ micromatch@^4.0.0, micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - -mime-types@^2.1.27: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.0" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -1995,47 +1789,20 @@ ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanocolors@^0.1.0, nanocolors@^0.1.5: - version "0.1.12" - resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6" - integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -neo-async@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -node-releases@^1.1.76: - version "1.1.76" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e" - integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== - node-releases@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== object-assign@^4.1.1: version "4.1.1" @@ -2043,9 +1810,9 @@ object-assign@^4.1.1: integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" @@ -2062,41 +1829,40 @@ object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd" - integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== +object.entries@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" + integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" -object.fromentries@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" - integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== +object.fromentries@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" + integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - has "^1.0.3" + es-abstract "^1.19.1" -object.hasown@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.0.0.tgz#bdbade33cfacfb25d7f26ae2b6cb870bf99905c2" - integrity sha512-qYMF2CLIjxxLGleeM0jrcB4kiv3loGVAjKQKvH8pSU/i2VcRRvUNmxbD+nEMmrXRfORhuVJuH8OtSYCZoue3zA== +object.hasown@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.0.tgz#7232ed266f34d197d15cac5880232f7a4790afe5" + integrity sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg== dependencies: define-properties "^1.1.3" - es-abstract "^1.18.1" + es-abstract "^1.19.1" -object.values@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" - integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== +object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" once@^1.3.0: version "1.4.0" @@ -2105,13 +1871,6 @@ once@^1.3.0: dependencies: wrappy "1" -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -2131,13 +1890,6 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" @@ -2145,23 +1897,11 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -2169,30 +1909,17 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-key@^3.0.0, path-key@^3.1.0: +path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== @@ -2202,13 +1929,6 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -2219,15 +1939,15 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.2.3: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== pkg-dir@^2.0.0: version "2.0.0" @@ -2236,20 +1956,6 @@ pkg-dir@^2.0.0: dependencies: find-up "^2.1.0" -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -2262,10 +1968,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" - integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== +prettier@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" + integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== progress@^2.0.0: version "2.0.3" @@ -2273,13 +1979,13 @@ progress@^2.0.0: integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== prop-types@^15.7.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + version "15.8.0" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.0.tgz#d237e624c45a9846e469f5f31117f970017ff588" + integrity sha512-fDGekdaHh65eI3lMi5OnErU6a8Ighg2KjcjQxO7m8VHyWjcPyj5kiOgV1LQDOOOgVy3+5FgjXvdSSX7B8/5/4g== dependencies: loose-envify "^1.4.0" object-assign "^4.1.1" - react-is "^16.8.1" + react-is "^16.13.1" punycode@^2.1.0: version "2.1.1" @@ -2291,41 +1997,17 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -react-is@^16.8.1: +react-is@^16.13.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -rechoir@^0.7.0: - version "0.7.1" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.1.tgz#9478a96a1ca135b5e88fc027f03ee92d6c645686" - integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg== - dependencies: - resolve "^1.9.0" + picomatch "^2.2.1" regexp.prototype.flags@^1.3.1: version "1.3.1" @@ -2335,34 +2017,17 @@ regexp.prototype.flags@^1.3.1: call-bind "^1.0.2" define-properties "^1.1.3" -regexpp@^3.1.0: +regexpp@^3.1.0, regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve@^1.10.0, resolve@^1.20.0, resolve@^1.9.0: +resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -2397,26 +2062,12 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -schema-utils@^3.1.0, schema-utils@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" - integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== - dependencies: - "@types/json-schema" "^7.0.8" - ajv "^6.12.5" - ajv-keywords "^3.5.2" - -"semver@2 || 3 || 4 || 5", semver@^5.4.1: +semver@^5.4.1, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -2426,27 +2077,13 @@ semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.4, semver@^7.3.5: +semver@^7.2.1, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" -serialize-javascript@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - -shallow-clone@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" - integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== - dependencies: - kind-of "^6.0.2" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -2468,34 +2105,17 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.3: - version "3.0.6" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" - integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - source-map-support@^0.5.0: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -2508,69 +2128,24 @@ source-map@^0.5.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.10" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" - integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - string-natural-compare@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string.prototype.matchall@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.5.tgz#59370644e1db7e4c0c045277690cf7b01203c4da" - integrity sha512-Z5ZaXO0svs0M2xd/6By3qpeKpLKd9mO4v4q3oMEQrk8Ck4xOD5d5XeBOOjGrmVZZ/AHB1S0CgG4N5r1G9N3E2Q== +string.prototype.matchall@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa" + integrity sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" get-intrinsic "^1.1.1" has-symbols "^1.0.2" internal-slot "^1.0.3" @@ -2593,7 +2168,7 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -2605,11 +2180,6 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -2636,50 +2206,6 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" - -tapable@^2.1.1, tapable@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" - integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== - -terser-webpack-plugin@^5.1.3: - version "5.2.5" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.2.5.tgz#ce65b9880a0c36872555c4874f45bbdb02ee32c9" - integrity sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g== - dependencies: - jest-worker "^27.0.6" - schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - source-map "^0.6.1" - terser "^5.7.2" - -terser@^5.7.2: - version "5.10.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc" - integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== - dependencies: - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.20" - text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -2697,20 +2223,10 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -ts-loader@^9.2.6: - version "9.2.6" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.6.tgz#9937c4dd0a1e3dbbb5e433f8102a6601c6615d74" - integrity sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw== - dependencies: - chalk "^4.1.0" - enhanced-resolve "^5.0.0" - micromatch "^4.0.0" - semver "^7.3.4" - tsconfig-paths@^3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" - integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== + version "3.12.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" + integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== dependencies: "@types/json5" "^0.0.29" json5 "^1.0.1" @@ -2741,10 +2257,10 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -typescript@4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== +typescript@4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" + integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== unbox-primitive@^1.0.1: version "1.0.1" @@ -2768,14 +2284,6 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - vscode-test@^0.4.1: version "0.4.3" resolved "https://registry.yarnpkg.com/vscode-test/-/vscode-test-0.4.3.tgz#461ebf25fc4bc93d77d982aed556658a2e2b90b8" @@ -2797,75 +2305,6 @@ vscode@1.1.37: source-map-support "^0.5.0" vscode-test "^0.4.1" -watchpack@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.0.tgz#a41bca3da6afaff31e92a433f4c856a0c25ea0c4" - integrity sha512-MnN0Q1OsvB/GGHETrFeZPQaOelWh/7O+EiFlj8sM9GPjtQkis7k01aAxrg/18kTfoIVcLL+haEVFlXDaSRwKRw== - dependencies: - glob-to-regexp "^0.4.1" - graceful-fs "^4.1.2" - -webpack-cli@^4.9.1: - version "4.9.1" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.1.tgz#b64be825e2d1b130f285c314caa3b1ba9a4632b3" - integrity sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ== - dependencies: - "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.0" - "@webpack-cli/info" "^1.4.0" - "@webpack-cli/serve" "^1.6.0" - colorette "^2.0.14" - commander "^7.0.0" - execa "^5.0.0" - fastest-levenshtein "^1.0.12" - import-local "^3.0.2" - interpret "^2.2.0" - rechoir "^0.7.0" - webpack-merge "^5.7.3" - -webpack-merge@^5.7.3: - version "5.8.0" - resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" - integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== - dependencies: - clone-deep "^4.0.1" - wildcard "^2.0.0" - -webpack-sources@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.2.tgz#d88e3741833efec57c4c789b6010db9977545260" - integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw== - -webpack@^5.64.4: - version "5.64.4" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.64.4.tgz#e1454b6a13009f57cc2c78e08416cd674622937b" - integrity sha512-LWhqfKjCLoYJLKJY8wk2C3h77i8VyHowG3qYNZiIqD6D0ZS40439S/KVuc/PY48jp2yQmy0mhMknq8cys4jFMw== - dependencies: - "@types/eslint-scope" "^3.7.0" - "@types/estree" "^0.0.50" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.4.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" - chrome-trace-event "^1.0.2" - enhanced-resolve "^5.8.3" - es-module-lexer "^0.9.0" - eslint-scope "5.1.1" - events "^3.2.0" - glob-to-regexp "^0.4.1" - graceful-fs "^4.2.4" - json-parse-better-errors "^1.0.2" - loader-runner "^4.2.0" - mime-types "^2.1.27" - neo-async "^2.6.2" - schema-utils "^3.1.0" - tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.3.0" - webpack-sources "^3.2.2" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -2884,11 +2323,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wildcard@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" - integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== - word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" From 3e7b9515fb769a51405b741e7cfb0df14e86aa93 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 30 Dec 2021 22:15:14 +0100 Subject: [PATCH 079/110] chore: split snippets to separate files --- .eslintrc.js | 12 +- README.md | 387 +++--- package.json | 18 +- src/generateSnippets.ts | 47 + src/helpers.ts | 19 +- src/index.ts | 8 +- src/snippetSearch.ts | 44 +- src/snippets/snippets.json | 1880 -------------------------- src/snippets/ts-snippets.json | 325 ----- src/sourceSnippets/components.ts | 348 +++++ src/sourceSnippets/console.ts | 157 +++ src/sourceSnippets/hooks.ts | 117 ++ src/sourceSnippets/imports.ts | 196 +++ src/sourceSnippets/others.ts | 509 +++++++ src/sourceSnippets/propTypes.ts | 291 ++++ src/sourceSnippets/reactNative.ts | 194 +++ src/sourceSnippets/redux.ts | 116 ++ src/sourceSnippets/sharedSnippets.ts | 75 + src/sourceSnippets/tests.ts | 178 +++ src/sourceSnippets/typescript.ts | 583 ++++---- src/types.ts | 46 +- tsconfig.json | 8 +- 22 files changed, 2742 insertions(+), 2816 deletions(-) create mode 100644 src/generateSnippets.ts delete mode 100644 src/snippets/snippets.json delete mode 100644 src/snippets/ts-snippets.json create mode 100644 src/sourceSnippets/components.ts create mode 100644 src/sourceSnippets/console.ts create mode 100644 src/sourceSnippets/hooks.ts create mode 100644 src/sourceSnippets/imports.ts create mode 100644 src/sourceSnippets/others.ts create mode 100644 src/sourceSnippets/propTypes.ts create mode 100644 src/sourceSnippets/reactNative.ts create mode 100644 src/sourceSnippets/redux.ts create mode 100644 src/sourceSnippets/sharedSnippets.ts create mode 100644 src/sourceSnippets/tests.ts diff --git a/.eslintrc.js b/.eslintrc.js index 45139aa..15a8151 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,14 +15,17 @@ module.exports = { "import/no-unresolved": "off", "jest/consistent-test-it": ["error", { fn: "test" }], "jest/no-truthy-falsy": "off", - "jest/expect-expect": ["error", { assertFunctionNames: ["expect", "element"] }], + "jest/expect-expect": [ + "error", + { assertFunctionNames: ["expect", "element"] }, + ], "prettier/prettier": [ "error", { bracketSameLine: false, bracketSpacing: true, - printWidth: 100, + printWidth: 80, semi: true, singleQuote: false, tabWidth: 2, @@ -46,7 +49,10 @@ module.exports = { }, ], - "@typescript-eslint/array-type": ["error", { default: "generic", readonly: "generic" }], + "@typescript-eslint/array-type": [ + "error", + { default: "generic", readonly: "generic" }, + ], }, globals: { __DEV__: true, diff --git a/README.md b/README.md index aaed7f6..e06f670 100644 --- a/README.md +++ b/README.md @@ -104,57 +104,48 @@ React 17 is currently supported by `_` prefix. ### React -| Prefix | Method | -| ----------: | ----------------------------------------------------------------------------------- | -| `imr→` | `import React from 'react'` | -| `imrd→` | `import ReactDOM from 'react-dom'` | -| `imrc→` | `import React, { Component } from 'react'` | -| `imrcp→` | `import React, { Component } from 'react' & import PropTypes from 'prop-types'` | -| `imrpc→` | `import React, { PureComponent } from 'react'` | -| `imrpcp→` | `import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'` | -| `imrm→` | `import React, { memo } from 'react'` | -| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` | -| `impt→` | `import PropTypes from 'prop-types'` | -| `imrr→` | `import { BrowserRouter as Router, Route, NavLink} from 'react-router-dom'` | -| `imbr→` | `import { BrowserRouter as Router} from 'react-router-dom'` | -| `imbrc→` | `import { Route, Switch, NavLink, Link } from react-router-dom'` | -| `imbrr→` | `import { Route } from 'react-router-dom'` | -| `imbrs→` | `import { Switch } from 'react-router-dom'` | -| `imbrl→` | `import { Link } from 'react-router-dom'` | -| `imbrnl→` | `import { NavLink } from 'react-router-dom'` | -| `imrs→` | `import React, { useState } from 'react'` | -| `imrse→` | `import React, { useState, useEffect } from 'react'` | -| `redux→` | `import { connect } from 'react-redux'` | -| `rconst→` | `constructor(props) with this.state` | -| `rconc→` | `constructor(props, context) with this.state` | -| `est→` | `this.state = { }` | -| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | -| `cdm→` | `componentDidMount = () => { }` | -| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | -| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | -| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | -| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | -| `cwun→` | `componentWillUnmount = () => { }` | -| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | -| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | -| `ren→` | `render() { return( ) }` | -| `sst→` | `this.setState({ })` | -| `ssf→` | `this.setState((state, props) => return { })` | -| `props→` | `this.props.propName` | -| `state→` | `this.state.stateName` | -| `rcontext→` | `const ${1:contextName} = React.createContext()` | -| `cref→` | `this.${1:refName}Ref = React.createRef()` | -| `fref→` | `const ref = React.createRef()` | -| `bnd→` | `this.methodName = this.methodName.bind(this)` | +| Prefix | Method | +| ----------: | --------------------------------------------------------------------------- | +| `imr→` | `import React from 'react'` | +| `imrd→` | `import ReactDOM from 'react-dom'` | +| `imrc→` | `import React, { Component } from 'react'` | +| `imrpc→` | `import React, { PureComponent } from 'react'` | +| `imrm→` | `import React, { memo } from 'react'` | +| `imrr→` | `import { BrowserRouter as Router, Route, NavLink} from 'react-router-dom'` | +| `imbr→` | `import { BrowserRouter as Router} from 'react-router-dom'` | +| `imbrc→` | `import { Route, Switch, NavLink, Link } from react-router-dom'` | +| `imbrr→` | `import { Route } from 'react-router-dom'` | +| `imbrs→` | `import { Switch } from 'react-router-dom'` | +| `imbrl→` | `import { Link } from 'react-router-dom'` | +| `imbrnl→` | `import { NavLink } from 'react-router-dom'` | +| `imrs→` | `import React, { useState } from 'react'` | +| `imrse→` | `import React, { useState, useEffect } from 'react'` | +| `redux→` | `import { connect } from 'react-redux'` | +| `rconst→` | `constructor(props) with this.state` | +| `rconc→` | `constructor(props, context) with this.state` | +| `est→` | `this.state = { }` | +| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | +| `cdm→` | `componentDidMount = () => { }` | +| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | +| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | +| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | +| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | +| `cwun→` | `componentWillUnmount = () => { }` | +| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | +| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | +| `sst→` | `this.setState({ })` | +| `ssf→` | `this.setState((state, props) => return { })` | +| `props→` | `this.props.propName` | +| `state→` | `this.state.stateName` | +| `rcontext→` | `const ${1:contextName} = React.createContext()` | +| `cref→` | `this.${1:refName}Ref = React.createRef()` | +| `fref→` | `const ref = React.createRef()` | +| `bnd→` | `this.methodName = this.methodName.bind(this)` | ### React Hooks - All hooks from [official docs](https://reactjs.org/docs/hooks-reference.html) are added with hook name prefix. -| Prefix | Method | -| -----: | ----------------------------------- | -| `rch→` | `import { $1 } from 'react-native'` | - ### React Native | Prefix | Method | @@ -207,17 +198,10 @@ React 17 is currently supported by `_` prefix. | `ptany→` | `PropTypes.any` | | `ptypes→` | `static propTypes = {}` | -### GraphQL - -| Prefix | Method | -| ---------: | ------------------------------------------------------- | -| `graphql→` | `import { compose, graphql } from 'react-apollo'` | -| `expgql->` | `export default compose(graphql($1, { name: $2 }))($3)` | - ### Console | Prefix | Method | -|--------|--------------------------------------------------------------| +| ------ | ------------------------------------------------------------ | | `clg→` | `console.log(object)` | | `clo→` | `` console.log(`object`, object) `` | | `clj→` | `` console.log(`object`, JSON.stringify(object, null, 2)) `` | @@ -241,11 +225,11 @@ React 17 is currently supported by `_` prefix. ### `rcc` ```javascript -import React, { Component } from 'react' +import React, { Component } from "react"; export default class FileName extends Component { render() { - return
$2
+ return
$2
; } } ``` @@ -253,42 +237,42 @@ export default class FileName extends Component { ### `rce` ```javascript -import React, { Component } from 'react' +import React, { Component } from "react"; export class FileName extends Component { render() { - return
$2
+ return
$2
; } } -export default $1 +export default $1; ``` ### `rcep` ```javascript -import React, { Component } from 'react' -import PropTypes from 'prop-types' +import React, { Component } from "react"; +import PropTypes from "prop-types"; export class FileName extends Component { - static propTypes = {} + static propTypes = {}; render() { - return
$2
+ return
$2
; } } -export default $1 +export default $1; ``` ### `rpc` ```javascript -import React, { PureComponent } from 'react' +import React, { PureComponent } from "react"; export default class FileName extends PureComponent { render() { - return
$2
+ return
$2
; } } ``` @@ -296,14 +280,14 @@ export default class FileName extends PureComponent { ### `rpcp` ```javascript -import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' +import React, { PureComponent } from "react"; +import PropTypes from "prop-types"; export default class FileName extends PureComponent { - static propTypes = {} + static propTypes = {}; render() { - return
$2
+ return
$2
; } } ``` @@ -311,33 +295,33 @@ export default class FileName extends PureComponent { ### `rpce` ```javascript -import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' +import React, { PureComponent } from "react"; +import PropTypes from "prop-types"; export class FileName extends PureComponent { - static propTypes = {} + static propTypes = {}; render() { - return
$2
+ return
$2
; } } -export default FileName +export default FileName; ``` ### `rccp` ```javascript -import React, { Component } from 'react' -import PropTypes from 'prop-types' +import React, { Component } from "react"; +import PropTypes from "prop-types"; export default class FileName extends Component { static propTypes = { $2: $3, - } + }; render() { - return
$4
+ return
$4
; } } ``` @@ -345,190 +329,190 @@ export default class FileName extends Component { ### `rfcp` ```javascript -import React from 'react' -import PropTypes from 'prop-types' +import React from "react"; +import PropTypes from "prop-types"; function $1(props) { - return
$0
+ return
$0
; } -$1.propTypes = {} +$1.propTypes = {}; -export default $1 +export default $1; ``` ### `rfc` ```javascript -import React from 'react' +import React from "react"; export default function $1() { - return
$0
+ return
$0
; } ``` ### `rfce` ```javascript -import React from 'react' +import React from "react"; function $1() { - return
$0
+ return
$0
; } -export default $1 +export default $1; ``` ### `rafcp` ```javascript -import React from 'react' -import PropTypes from 'prop-types' +import React from "react"; +import PropTypes from "prop-types"; const $1 = (props) => { - return
$0
-} + return
$0
; +}; -$1.propTypes = {} +$1.propTypes = {}; -export default $1 +export default $1; ``` ### `rafc` ```javascript -import React from 'react' +import React from "react"; export const $1 = () => { - return
$0
-} + return
$0
; +}; ``` ### `rafce` ```javascript -import React from 'react' +import React from "react"; const $1 = () => { - return
$0
-} + return
$0
; +}; -export default $1 +export default $1; ``` ### `rmc` ```javascript -import React, { memo } from 'react' +import React, { memo } from "react"; export default memo(function $1() { - return
$0
-}) + return
$0
; +}); ``` ### `rmcp` ```javascript -import React, { memo } from 'react' -import PropTypes from 'prop-types' +import React, { memo } from "react"; +import PropTypes from "prop-types"; const $1 = memo(function $1(props) { - return
$0
-}) + return
$0
; +}); -$1.propTypes = {} +$1.propTypes = {}; -export default $1 +export default $1; ``` ### `rcredux` ```javascript -import React, { Component } from 'react' -import { connect } from 'react-redux' +import React, { Component } from "react"; +import { connect } from "react-redux"; export class FileName extends Component { render() { - return
$4
+ return
$4
; } } -const mapStateToProps = (state) => ({}) +const mapStateToProps = (state) => ({}); -const mapDispatchToProps = {} +const mapDispatchToProps = {}; -export default connect(mapStateToProps, mapDispatchToProps)(FileName) +export default connect(mapStateToProps, mapDispatchToProps)(FileName); ``` ### `rcreduxp` ```javascript -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import { connect } from 'react-redux' +import React, { Component } from "react"; +import PropTypes from "prop-types"; +import { connect } from "react-redux"; export class FileName extends Component { static propTypes = { $2: $3, - } + }; render() { - return
$4
+ return
$4
; } } -const mapStateToProps = (state) => ({}) +const mapStateToProps = (state) => ({}); -const mapDispatchToProps = {} +const mapDispatchToProps = {}; -export default connect(mapStateToProps, mapDispatchToProps)(FileName) +export default connect(mapStateToProps, mapDispatchToProps)(FileName); ``` ### `rfcredux` ```javascript -import React, { Component } from 'react' -import { connect } from 'react-redux' +import React, { Component } from "react"; +import { connect } from "react-redux"; export const FileName = () => { - return
$4
-} + return
$4
; +}; -const mapStateToProps = (state) => ({}) +const mapStateToProps = (state) => ({}); -const mapDispatchToProps = {} +const mapDispatchToProps = {}; -export default connect(mapStateToProps, mapDispatchToProps)(FileName) +export default connect(mapStateToProps, mapDispatchToProps)(FileName); ``` ### `rfreduxp` ```javascript -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import { connect } from 'react-redux' +import React, { Component } from "react"; +import PropTypes from "prop-types"; +import { connect } from "react-redux"; export const FileName = () => { - return
$4
-} + return
$4
; +}; FileName.propTypes = { $2: $3, -} +}; -const mapStateToProps = (state) => ({}) +const mapStateToProps = (state) => ({}); -const mapDispatchToProps = {} +const mapDispatchToProps = {}; -export default connect(mapStateToProps, mapDispatchToProps)(FileName) +export default connect(mapStateToProps, mapDispatchToProps)(FileName); ``` ### `reduxmap` ```javascript -const mapStateToProps = (state) => ({}) +const mapStateToProps = (state) => ({}); -const mapDispatchToProps = {} +const mapDispatchToProps = {}; ``` ## React Native Components @@ -536,8 +520,8 @@ const mapDispatchToProps = {} ### `rnc` ```javascript -import React, { Component } from 'react' -import { Text, View } from 'react-native' +import React, { Component } from "react"; +import { Text, View } from "react-native"; export default class FileName extends Component { render() { @@ -545,7 +529,7 @@ export default class FileName extends Component { $2 - ) + ); } } ``` @@ -553,76 +537,76 @@ export default class FileName extends Component { ### `rnf` ```javascript -import React from 'react' -import { View, Text } from 'react-native' +import React from "react"; +import { View, Text } from "react-native"; export default function $1() { return ( $2 - ) + ); } ``` ### `rnfs` ```javascript -import React from 'react' -import { StyleSheet, View, Text } from 'react-native' +import React from "react"; +import { StyleSheet, View, Text } from "react-native"; export default function $1() { return ( $2 - ) + ); } -const styles = StyleSheet.create({}) +const styles = StyleSheet.create({}); ``` ### `rnfe` ```javascript -import React from 'react' -import { View, Text } from 'react-native' +import React from "react"; +import { View, Text } from "react-native"; const $1 = () => { return ( $2 - ) -} + ); +}; -export default $1 +export default $1; ``` ### `rnfes` ```javascript -import React from 'react' -import { StyleSheet, View, Text } from 'react-native' +import React from "react"; +import { StyleSheet, View, Text } from "react-native"; const $1 = () => { return ( $2 - ) -} + ); +}; -export default $1 +export default $1; -const styles = StyleSheet.create({}) +const styles = StyleSheet.create({}); ``` ### `rncs` ```javascript -import React, { Component } from 'react' -import { Text, StyleSheet, View } from 'react-native' +import React, { Component } from "react"; +import { Text, StyleSheet, View } from "react-native"; export default class FileName extends Component { render() { @@ -630,59 +614,30 @@ export default class FileName extends Component { $2 - ) + ); } } -const styles = StyleSheet.create({}) +const styles = StyleSheet.create({}); ``` ### `rnce` ```javascript -import React, { Component } from 'react' -import { Text, View } from 'react-native' - -export class FileName extends Component { - render() { - return ( - - $2 - - ) - } -} - -export default $1 -``` - -### `rncredux` - -```javascript -import React, { Component } from 'react' -import { View, Text } from 'react-native' -import PropTypes from 'prop-types' -import { connect } from 'react-redux' +import React, { Component } from "react"; +import { Text, View } from "react-native"; export class FileName extends Component { - static propTypes = { - $2: $3, - } - render() { return ( $2 - ) + ); } } -const mapStateToProps = (state) => ({}) - -const mapDispatchToProps = {} - -export default connect(mapStateToProps, mapDispatchToProps)(FileName) +export default $1; ``` ## Others @@ -700,25 +655,25 @@ export default connect(mapStateToProps, mapDispatchToProps)(FileName) ### `desc` ```javascript -describe('$1', () => { - $2 -}) +describe("$1", () => { + $2; +}); ``` ### `test` ```javascript -test('should $1', () => { - $2 -}) +test("should $1", () => { + $2; +}); ``` ### `tit` ```javascript -it('should $1', () => { - $2 -}) +it("should $1", () => { + $2; +}); ``` ### `stest` @@ -840,14 +795,14 @@ export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)( ### `hoc` ```javascript -import React from 'react' -import PropTypes from 'prop-types' +import React from "react"; +import PropTypes from "prop-types"; export default (WrappedComponent) => { - const hocComponent = ({ ...props }) => + const hocComponent = ({ ...props }) => ; - hocComponent.propTypes = {} + hocComponent.propTypes = {}; - return hocComponent -} + return hocComponent; +}; ``` diff --git a/package.json b/package.json index 384b8c7..3a7853b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", - "description": "Extensions for React (React-Native), Redux and GraphQL snippets in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", + "description": "Extensions for React (React-Native) and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", "version": "3.2.0", "publisher": "dsznajder", "icon": "images/logo.png", @@ -62,11 +62,11 @@ "esReactSnippets.settings.prettierEnabled": { "type": "boolean", "markdownDescription": "Integrate prettier settings with code generated from snippets.", - "default": true + "default": false }, "esReactSnippets.settings.importReactOnTop": { "type": "boolean", - "markdownDescription": "Controls if snippets should add `import React from 'react';` at the top of components.\nPreviously components like that were used with `_` prefix.", + "markdownDescription": "Controls if snippets should add `import React from 'react';` at the top of components.\nUse if you have React +17 and use jsx transform.", "default": true }, "esReactSnippets.settings.typescript": { @@ -89,9 +89,9 @@ "markdownDescription": "Controls how many spaces snippets will have.\nOnly applies when `#esReactSnippets.settings.prettierEnabled#` is disabled", "default": 2 }, - "esReactSnippets.settings.componentPropsPrefix": { + "esReactSnippets.settings.typescriptComponentPropsStatePrefix": { "type": "string", - "markdownDescription": "Controls which prefix snippets should use for component props.\nOnly applies when `#esReactSnippets.settings.typescript#` is enabled.", + "markdownDescription": "Controls which prefix for typescript snippets should use for props/state.", "default": "type", "enum": [ "type", @@ -103,14 +103,14 @@ "snippets": [ { "language": "javascript", - "path": "./lib/snippets/snippets.json" + "path": "./snippets/generated.json" }, { - "language": "javascriptreact", + "language": "typescript", "path": "./lib/snippets/snippets.json" }, { - "language": "typescript", + "language": "javascriptreact", "path": "./lib/snippets/snippets.json" }, { @@ -154,7 +154,7 @@ "prettier": { "bracketSameLine": false, "bracketSpacing": true, - "printWidth": 100, + "printWidth": 80, "semi": true, "singleQuote": false, "tabWidth": 2, diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts new file mode 100644 index 0000000..38a177b --- /dev/null +++ b/src/generateSnippets.ts @@ -0,0 +1,47 @@ +import { workspace } from "vscode"; +import { writeFileSync } from "fs"; + +import hooks, { HooksSnippet } from "./sourceSnippets/hooks"; +import imports, { ImportsSnippet } from "./sourceSnippets/imports"; +import reactNative, { ReactNativeSnippet } from "./sourceSnippets/reactNative"; +import typescript, { TypescriptSnippet } from "./sourceSnippets/typescript"; +import { ExtensionSettings } from "./helpers"; +import redux, { ReduxSnippet } from "./sourceSnippets/redux"; +import components, { ComponentsSnippet } from "./sourceSnippets/components"; +import console, { ConsoleSnippet } from "./sourceSnippets/console"; +import propTypes, { PropTypesSnippet } from "./sourceSnippets/propTypes"; +import tests, { TestsSnippet } from "./sourceSnippets/tests"; + +type SnippetsArray = Array< + | HooksSnippet + | ImportsSnippet + | ReactNativeSnippet + | TypescriptSnippet + | ReduxSnippet + | ComponentsSnippet + | ConsoleSnippet + | PropTypesSnippet + | TestsSnippet +>; + +const generateSnippets = () => { + const config = workspace.getConfiguration( + "esReactSnippets", + ) as unknown as ExtensionSettings; + + const snippets: SnippetsArray = [ + ...components, + ...console, + ...hooks, + ...imports, + ...propTypes, + ...reactNative, + ...redux, + ...tests, + ...(config.typescript ? typescript : []), + ]; + + writeFileSync("./snippets/generated.json", JSON.stringify(snippets, null, 2)); +}; + +export default generateSnippets; diff --git a/src/helpers.ts b/src/helpers.ts index fea2cd2..e784f21 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -11,20 +11,31 @@ export type ExtensionSettings = { componentPropsPrefix: "type" | "interface"; }; -export const convertSnippetArrayToString = (snippetArray: Array) => snippetArray.join("\n"); - export const getPrettierConfig = async (): Promise => { const settings = workspace.getConfiguration( "esReactSnippets.settings", ) as unknown as ExtensionSettings; - const prettierConfig = await prettier.resolveConfig(""); + const prettierConfig = await prettier.resolveConfig("", { + editorconfig: true, + }); return { semi: settings.semiColons, singleQuote: settings.quotes, tabWidth: 2, - parser: "typescript", ...(settings.prettierEnabled && prettierConfig), }; }; + +export const parseSnippet = (snippet: { + id: number; + description: any; + label: string; + value: string; + body: string | string[]; +}) => { + return typeof snippet.body === "string" + ? snippet.body + : snippet.body.join("\n"); +}; diff --git a/src/index.ts b/src/index.ts index 30c1884..dfbd723 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,15 @@ import { commands, ExtensionContext } from "vscode"; import snippetSearch from "./snippetSearch"; +import generateSnippets from "./generateSnippets"; export function activate(context: ExtensionContext) { - const snippetSearchCommand = commands.registerCommand("esReactSnippets.search", snippetSearch); + const snippetSearchCommand = commands.registerCommand( + "esReactSnippets.search", + snippetSearch, + ); + + generateSnippets(); context.subscriptions.push(snippetSearchCommand); } diff --git a/src/snippetSearch.ts b/src/snippetSearch.ts index 972f270..3390e7d 100644 --- a/src/snippetSearch.ts +++ b/src/snippetSearch.ts @@ -1,50 +1,32 @@ import { SnippetString, window } from "vscode"; -import prettier from "prettier"; -import { convertSnippetArrayToString, getPrettierConfig } from "./helpers"; -import jsSnippets from "./snippets/snippets.json"; -import tsSnippets from "./snippets/ts-snippets.json"; +import { parseSnippet } from "./helpers"; const snippetSearch = async () => { const { showQuickPick, activeTextEditor } = window; - const javascriptSnippets = Object.entries(jsSnippets); - const typescriptSnippets = Object.entries(tsSnippets); - const snippetsArray = javascriptSnippets.concat(typescriptSnippets); + const snippetsArray = [[]]; const items = snippetsArray.map( // @ts-expect-error - ([shortDescription, { prefix, body, description }], index) => { - const value = typeof prefix === "string" ? prefix : prefix[0]; - - return { - id: index, - description: description || shortDescription, - label: value, - value, - body, - }; - }, + ([shortDescription, { prefix: label, body, description }], id) => ({ + body, + description, + id, + label, + value: label, + }), ); - const options = { + const rawSnippet = await showQuickPick(items, { matchOnDescription: true, matchOnDetail: true, - placeHolder: "Search snippet", - }; + placeHolder: "Search snippet by prefix or description", + }); - const snippet = (await showQuickPick(items, options)) || { - body: "", - }; - - const body = - typeof snippet.body === "string" ? snippet.body : convertSnippetArrayToString(snippet.body); + const body = rawSnippet ? parseSnippet(rawSnippet) : ""; if (activeTextEditor) { - const config = await getPrettierConfig(); - const parsedBody = prettier.format(body, config); - console.log(JSON.stringify(parsedBody), JSON.stringify(body)); - activeTextEditor.insertSnippet(new SnippetString(body)); } }; diff --git a/src/snippets/snippets.json b/src/snippets/snippets.json deleted file mode 100644 index cabc6bb..0000000 --- a/src/snippets/snippets.json +++ /dev/null @@ -1,1880 +0,0 @@ -{ - "import": { - "prefix": "imp", - "body": "import ${2:moduleName} from '${1:module}'$0" - }, - "importNoModuleName": { - "prefix": "imn", - "body": "import '${1:module}'$0" - }, - "importDestructing": { - "prefix": "imd", - "body": "import { $2 } from '${1:module}'$0" - }, - "importEverything": { - "prefix": "ime", - "body": "import * as ${2:alias} from '${1:module}'$0" - }, - "importAs": { - "prefix": "ima", - "body": "import { ${2:originalName} as ${3:alias} } from '${1:module}'$0" - }, - "exportDefault": { - "prefix": "exp", - "body": "export default $1$0" - }, - "exportDestructing": { - "prefix": "exd", - "body": "export { $2 } from '${1:module}'$0" - }, - "exportAs": { - "prefix": "exa", - "body": "export { ${2:originalName} as ${3:alias} } from '${1:module}'$0" - }, - "exportNamedFunction": { - "prefix": "enf", - "body": [ - "export const ${1:functionName} = (${2:params}) => {", - "\t$0", - "}", - "" - ], - "description": "Export named function in ES7 syntax" - }, - "exportDefaultFunction": { - "prefix": "edf", - "body": ["export default (${1:params}) => {", "\t$0", "}", ""], - "description": "Export default function in ES7 syntax" - }, - "exportDefaultNamedFunction": { - "prefix": "ednf", - "body": [ - "export default function ${1:functionName}(${2:params}) {", - "\t$0", - "}", - "" - ], - "description": "Export default named function in ES7 syntax" - }, - "method": { - "prefix": "met", - "body": ["${1:methodName} = (${2:params}) => {", "\t${0}", "}", ""], - "description": "Creates a method inside a class in ES7 syntax" - }, - "propertyGet": { - "prefix": "pge", - "body": ["get ${1:propertyName}() {", "\treturn this.${0}", "}", ""], - "description": "Creates a getter property inside a class in ES7 syntax" - }, - "propertySet": { - "prefix": "pse", - "body": ["set ${1:propertyName}(${2:value}) {", "\t${0}", "}", ""], - "description": "Creates a setter property inside a class in ES7 syntax" - }, - "forEach": { - "prefix": "fre", - "body": ["${1:array}.forEach(${2:currentItem} => {", "\t${0}", "})", ""], - "description": "Creates a forEach statement in ES7 syntax" - }, - "forOf": { - "prefix": "fof", - "body": ["for(let ${1:item} of ${2:object}) {", "\t${0}", "}", ""], - "description": "Iterating over property names of iterable objects" - }, - "forIn": { - "prefix": "fin", - "body": ["for(let ${1:item} in ${2:object}) {", "\t${0}", "}", ""], - "description": "Iterating over property values of iterable objects" - }, - "anonymousFunction": { - "prefix": "anfn", - "body": ["(${1:params}) => {", "\t${2}", "}"], - "description": "Creates an anonymous function in ES7 syntax" - }, - "namedFunction": { - "prefix": "nfn", - "body": ["const ${1:name} = (${2:params}) => {", "\t${3}", "}", ""], - "description": "Creates a named function in ES7 syntax" - }, - "destructingObject": { - "prefix": "dob", - "body": "const {${2:propertyName}} = ${1:objectToDestruct}", - "description": "Creates and assigns a local variable using object destructing" - }, - "destructingArray": { - "prefix": "dar", - "body": "const [${2:propertyName}] = ${1:arrayToDestruct}", - "description": "Creates and assigns a local variable using array destructing" - }, - "setInterval": { - "prefix": "sti", - "body": ["setInterval(() => {", "\t${2}", "}, ${0:intervalInms})", ""], - "description": "Executes the given function at specified intervals in ES7 syntax" - }, - "setTimeOut": { - "prefix": "sto", - "body": ["setTimeout(() => {", "\t${2}", "}, ${1:delayInms})", ""], - "description": "Executes the given function after the specified delay in ES7 syntax" - }, - "promise": { - "prefix": "prom", - "body": ["return new Promise((resolve, reject) => {", "\t${1}", "})", ""], - "description": "Creates and returns a new Promise in the standard ES7 syntax" - }, - "consoleAssert": { - "prefix": "cas", - "body": "console.assert(${1:expression}, ${2:object})", - "description": "If the specified expression is false, the message is written to the console along with a stack trace" - }, - "consoleClear": { - "prefix": "ccl", - "body": "console.clear()", - "description": "Clears the console" - }, - "consoleCount": { - "prefix": "cco", - "body": "console.count(${1:label})", - "description": "Writes the the number of times that count() has been invoked at the same line and with the same label" - }, - "consoleDir": { - "prefix": "cdi", - "body": "console.dir(${1:object})", - "description": "Prints a JavaScript representation of the specified object" - }, - "consoleError": { - "prefix": "cer", - "body": "console.error(${1:object})", - "description": "Displays a message in the console and also includes a stack trace from where the method was called" - }, - "consoleGroup": { - "prefix": "cgr", - "body": "console.group(\"${1:label}\")", - "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called." - }, - "consoleGroupEnd": { - "prefix": "cge", - "body": "console.groupEnd()", - "description": "Closes out the corresponding console.group()." - }, - "consoleLog": { - "prefix": "clg", - "body": "console.log(${1:object})", - "description": "Displays a message in the console" - }, - "consoleTrace": { - "prefix": "ctr", - "body": "console.trace(${1:object})", - "description": "Prints a stack trace from the point where the method was called" - }, - "consoleLogObject": { - "prefix": "clo", - "body": "console.log(`${1:object}`, ${1:object})", - "description": "Logs property with name." - }, - "consoleLogJson": { - "prefix": "clj", - "body": "console.log(`${1:object}`, JSON.stringify(${1:object}, null, 2))", - "description": "Logs stringified JSON property with name." - }, - "consoleTime": { - "prefix": "ctm", - "body": "console.time(`${1:object}`)", - "description": "Console time wrapper" - }, - "consoleTimeEnd": { - "prefix": "cte", - "body": "console.timeEnd(`${1:object}`)", - "description": "Console time end wrapper" - }, - "consoleWarn": { - "prefix": "cwa", - "body": "console.warn(${1:object})", - "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message" - }, - "consoleInfo": { - "prefix": "cin", - "body": "console.info(${1:object})", - "description": "Displays a message in the console but also displays a blue information icon along with the logged message" - }, - "destructProps": { - "prefix": "cp", - "body": ["const { $1 } = this.props"], - "description": "Creates and assigns a local variable using props destructing" - }, - "destructState": { - "prefix": "cs", - "body": ["const { $1 } = this.state"], - "description": "Creates and assigns a local variable using state destructing" - }, - "import React": { - "prefix": "imr", - "body": ["import React from 'react'", ""] - }, - "import ReactDOM": { - "prefix": "imrd", - "body": ["import ReactDOM from 'react-dom'", ""] - }, - "import React, { Component }": { - "prefix": "imrc", - "body": ["import React, { Component } from 'react'", ""] - }, - "import React, { Component } & PropTypes": { - "prefix": "imrcp", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "" - ] - }, - "import React, { PureComponent }": { - "prefix": "imrpc", - "body": ["import React, { PureComponent } from 'react'", ""] - }, - "import React, { PureComponent } & PropTypes": { - "prefix": "imrpcp", - "body": [ - "import React, { PureComponent } from 'react'", - "import PropTypes from 'prop-types'", - "" - ] - }, - "import React, { memo }": { - "prefix": "imrm", - "body": ["import React, { memo } from 'react'", ""] - }, - "import React, { memo } & PropTypes": { - "prefix": "imrmp", - "body": [ - "import React, { memo } from 'react'", - "import PropTypes from 'prop-types'", - "" - ] - }, - "import React, {useState}": { - "prefix": "imrs", - "body": ["import React, { useState } from 'react'", ""] - }, - "import React, {useEffect}": { - "prefix": "imre", - "body": ["import React, { useEffect } from 'react'", ""] - }, - "import React, {useRef}": { - "prefix": "imrr", - "body": ["import React, { useRef } from 'react'", ""] - }, - "import React, {useState, useEffect}": { - "prefix": "imrse", - "body": ["import React, { useState, useEffect } from 'react'", ""] - }, - "import PropTypes": { - "prefix": "impt", - "body": ["import PropTypes from 'prop-types'", ""] - }, - "import React Router": { - "prefix": "imrr", - "body": [ - "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", - "" - ] - }, - "import React Browser Router": { - "prefix": "imbr", - "body": ["import { BrowserRouter as Router } from 'react-router-dom'", ""] - }, - "import React Browser Router - Route": { - "prefix": "imbrr", - "body": ["import { Route } from 'react-router-dom'", ""] - }, - "import React Browser Router - Route Combo": { - "prefix": "imbrc", - "body": [ - "import { Route, Switch, NavLink, Link } from 'react-router-dom'", - "" - ] - }, - "import React Browser Router - Switch": { - "prefix": "imbrs", - "body": ["import { Switch } from 'react-router-dom'", ""] - }, - "import React Browser Router - Link": { - "prefix": "imbrl", - "body": ["import { Link } from 'react-router-dom'", ""] - }, - "import React Browser Router - NavLink": { - "prefix": "imbrnl", - "body": ["import { NavLink } from 'react-router-dom'", ""] - }, - "import redux statement": { - "prefix": "redux", - "body": ["import { connect } from 'react-redux'", ""] - }, - "reactClassComponent": { - "prefix": "rcc", - "body": [ - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactClassExportComponent": { - "prefix": "rce", - "body": [ - "import React, { Component } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactFunctionalExportComponent": { - "prefix": "rfce", - "body": [ - "import React from 'react'", - "", - "function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system" - }, - "reactFunctionalComponent": { - "prefix": "rfc", - "body": [ - "import React from 'react'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system" - }, - "reactFunctionalComponentWithPropTypes": { - "prefix": "rfcp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "function ${1:${TM_FILENAME_BASE}}(props) {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - "", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "" - ], - "description": "Creates a React Functional Component with ES7 module system with PropTypes" - }, - "reactArrowFunctionExportComponent": { - "prefix": "rafce", - "body": [ - "import React from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system" - }, - "reactArrowFunctionComponent": { - "prefix": "rafc", - "body": [ - "import React from 'react'", - "", - "export const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system" - }, - "reactArrowFunctionComponentWithPropTypes": { - "prefix": "rafcp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "const ${1:${TM_FILENAME_BASE}} = props => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - "", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes" - }, - "reactClassExportComponentWithPropTypes": { - "prefix": "rcep", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - "\tstatic propTypes = {", - "", - "\t}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactClassPureComponent": { - "prefix": "rpc", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "" - ], - "description": "Creates a React pure component class with ES7 module system" - }, - "reactClassExportPureComponent": { - "prefix": "rpce", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "export default ${1:$TM_FILENAME_BASE}", - "" - ], - "description": "Creates a React pure component class with ES7 module system export" - }, - "reactClassPureComponentWithPropTypes": { - "prefix": "rpcp", - "body": [ - "import React, { PureComponent } from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - "\tstatic propTypes = {", - "", - "\t}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactFunctionMemoComponent": { - "prefix": "rmc", - "body": [ - "import React, { memo } from 'react'", - "", - "export default memo(function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "})", - "" - ], - "description": "Creates a React Memo Function Component with ES7 module system" - }, - "reactFunctionMemoComponentWithPropTypes": { - "prefix": "rmcp", - "body": [ - "import React, { memo } from 'react'", - "import PropTypes from 'prop-types'", - "", - "const ${1:${TM_FILENAME_BASE}} = memo(function ${1:${TM_FILENAME_BASE}}(props) {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "})", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - "", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Memo Function Component with ES7 module system with PropTypes" - }, - "reactClassCompomentPropTypes": { - "prefix": "rccp", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - "\tstatic propTypes = {", - "\t\t${2:prop}: ${3:PropTypes}", - "\t}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "" - ], - "description": "Creates a React component class with PropTypes and ES7 module system" - }, - "reactClassCompomentRedux": { - "prefix": "rcredux", - "body": [ - "import React, { Component } from 'react'", - "import { connect } from 'react-redux'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "const mapStateToProps = (state) => ({", - "\t", - "})", - "", - "const mapDispatchToProps = {", - "\t", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", - "" - ], - "description": "Creates a React component class with connected redux and ES7 module system" - }, - "reactClassCompomentReduxPropTypes": { - "prefix": "rcreduxp", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "import { connect } from 'react-redux'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - "\tstatic propTypes = {", - "\t\t${2:prop}: ${3:PropTypes}", - "\t}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "const mapStateToProps = (state) => ({", - "\t", - "})", - "", - "const mapDispatchToProps = {", - "\t", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", - "" - ], - "description": "Creates a React component class with PropTypes with connected redux and ES7 module system" - }, - "reactFunctionalCompomentRedux": { - "prefix": "rfcredux", - "body": [ - "import React from 'react'", - "import { connect } from 'react-redux'", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "const mapStateToProps = (state) => ({", - "\t", - "})", - "", - "const mapDispatchToProps = {", - "\t", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", - "" - ], - "description": "Creates a React functional component with connected redux and ES7 module system" - }, - "reactFunctionalCompomentReduxPropTypes": { - "prefix": "rfcreduxp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "import { connect } from 'react-redux'", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - "\t${2:props}: ${3:PropTypes}", - "}", - "", - "const mapStateToProps = (state) => ({", - "\t", - "})", - "", - "const mapDispatchToProps = {", - "\t", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", - "" - ], - "description": "Creates a React functional component with PropTypes with connected redux and ES7 module system" - }, - "mappingToProps": { - "prefix": "reduxmap", - "body": [ - "const mapStateToProps = (state) => ({", - "\t${1}", - "})", - "", - "const mapDispatchToProps = {", - "\t", - "}", - "" - ] - }, - "classConstructor": { - "prefix": "rconst", - "body": [ - "constructor(props) {", - "\tsuper(props)", - "", - "\tthis.state = {", - "\t\t $0", - "\t}", - "}", - "" - ], - "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments" - }, - "emptyState": { - "prefix": "est", - "body": ["state = {", "\t$1", "}", ""], - "description": "Creates empty state object. To be used in a constructor." - }, - "componentWillMount": { - "prefix": "cwm", - "body": ["componentWillMount() {", "\t$0", "}", ""], - "description": "DEPRECATED!!!. Invoked once, both on the client and server, immediately before the initial rendering occurs" - }, - "componentDidMount": { - "prefix": "cdm", - "body": ["componentDidMount() {", "\t$0", "}", ""], - "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs." - }, - "componentWillReceiveProps": { - "prefix": "cwr", - "body": ["componentWillReceiveProps(nextProps) {", "\t$0", "}", ""], - "description": "DEPRECATED!!!. Invoked when a component is receiving new props. This method is not called for the initial render." - }, - "shouldComponentUpdate": { - "prefix": "scu", - "body": ["shouldComponentUpdate(nextProps, nextState) {", "\t$0", "}", ""], - "description": "Invoked before rendering when new props or state are being received. " - }, - "componentWillUpdate": { - "prefix": "cwup", - "body": ["componentWillUpdate(nextProps, nextState) {", "\t$0", "}", ""], - "description": "DEPRECATED!!!. Invoked immediately before rendering when new props or state are being received." - }, - "componentDidUpdate": { - "prefix": "cdup", - "body": ["componentDidUpdate(prevProps, prevState) {", "\t$0", "}", ""], - "description": "Invoked immediately after the component's updates are flushed to the DOM." - }, - "componentWillUnmount": { - "prefix": "cwun", - "body": ["componentWillUnmount() {", "\t$0", "}", ""], - "description": "Invoked immediately before a component is unmounted from the DOM." - }, - "getDerivedStateFromProps": { - "prefix": "gdsfp", - "body": ["static getDerivedStateFromProps(props, state) {", "\t${1}", "}"], - "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates." - }, - "getSnapshotBeforeUpdate": { - "prefix": "gsbu", - "body": [ - "getSnapshotBeforeUpdate = (prevProps, prevState) => {", - "\t$0", - "}", - "" - ], - "description": "Called right before mutations are made (e.g. before the DOM is updated)" - }, - "componentRender": { - "prefix": "ren", - "body": [ - "render() {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}" - ], - "description": "Basic render." - }, - "createContext": { - "prefix": "rcontext", - "body": ["const ${1:contextName} = React.createContext()", ""], - "description": "Create React context" - }, - "createRef": { - "prefix": "cref", - "body": ["this.${1:refName}Ref = React.createRef()", ""], - "description": "Create ref statement used inside constructor" - }, - "forwardRef": { - "prefix": "fref", - "body": ["const ref = React.createRef()", ""], - "description": "Forward ref statement used inside component" - }, - "componentSetStateObject": { - "prefix": "sst", - "body": "this.setState({$0})", - "description": "Performs a shallow merge of nextState into current state" - }, - "componentSetStateFunc": { - "prefix": "ssf", - "body": ["this.setState((state, props) => { return { $0 }})", ""], - "description": "Performs a shallow merge of nextState into current state" - }, - "componentProps": { - "prefix": "props", - "body": "this.props.$0", - "description": "Access component's props" - }, - "componentState": { - "prefix": "state", - "body": "this.state.$0" - }, - "bindThis": { - "prefix": "bnd", - "body": "this.${1:methodName} = this.${1:methodName}.bind(this)$0", - "description": "Binds this to a method" - }, - "reduxAction": { - "prefix": "rxaction", - "body": [ - "export const ${1:actionName} = (payload) => ({", - "\ttype: ${3:type},", - "\tpayload", - "})", - "" - ] - }, - "reduxConst": { - "prefix": "rxconst", - "body": "export const ${1:constantName} = '${1:constantName}'" - }, - "reduxReducer": { - "prefix": "rxreducer", - "body": [ - "const initialState = {", - "", - "}", - "", - "export default (state = initialState, { type, payload }) => {", - "\tswitch (type) {", - "", - "\tcase ${1:typeName}:", - "\t\treturn { ...state, ...payload }", - "", - "\tdefault:", - "\t\treturn state", - "\t}", - "}", - "" - ] - }, - "reduxSelector": { - "prefix": "rxselect", - "body": [ - "import { createSelector } from 'reselect'", - "", - "export const ${1:selectorName} = state => state.${2:selector}", - "" - ] - }, - "reduxSlice": { - "prefix": "rxslice", - "body": [ - "import { createSlice } from '@reduxjs/toolkit'", - "", - "const initialState = {", - "", - "}", - "", - "const ${1:${TM_FILENAME_BASE}} = createSlice({", - "\tname: ${2:sliceName},", - "\tinitialState,", - "\treducers: {", - "\t", - "\t}", - "});", - "", - "export const {", - "", - "} = ${1:${TM_FILENAME_BASE}}.actions", - "export default ${1:${TM_FILENAME_BASE}}.reducer" - ] - }, - "reactNativeComponent": { - "prefix": "rnc", - "body": [ - "import React, { Component } from 'react'", - "import { Text, View } from 'react-native'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - "\trender() {", - "\t\treturn (", - "\t\t\t", - "\t\t\t\t ${2:textInComponent} ", - "\t\t\t", - "\t\t)", - "\t}", - "}", - "" - ] - }, - "reactNativeComponentWithStyles": { - "prefix": "rncs", - "body": [ - "import React, { Component } from 'react'", - "import { Text, StyleSheet, View } from 'react-native'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - "\trender() {", - "\t\treturn (", - "\t\t\t", - "\t\t\t\t ${2:textInComponent} ", - "\t\t\t", - "\t\t)", - "\t}", - "}", - "", - "const styles = StyleSheet.create({})", - "" - ] - }, - "reactNativeComponentExport": { - "prefix": "rnce", - "body": [ - "import React, { Component } from 'react'", - "import { Text, View } from 'react-native'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - "\trender() {", - "\t\treturn (", - "\t\t\t", - "\t\t\t\t ${2:textInComponent} ", - "\t\t\t", - "\t\t)", - "\t}", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ] - }, - "reactNativePureComponent": { - "prefix": "rnpc", - "body": [ - "import React, { PureComponent } from 'react'", - "import { Text, View } from 'react-native'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - "\trender() {", - "\t\treturn (", - "\t\t\t", - "\t\t\t\t ${2:textInComponent} ", - "\t\t\t", - "\t\t)", - "\t}", - "}", - "" - ] - }, - "reactNativePureComponentExport": { - "prefix": "rnpce", - "body": [ - "import React, { PureComponent } from 'react'", - "import { Text, View } from 'react-native'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - "\trender() {", - "\t\treturn (", - "\t\t\t", - "\t\t\t\t ${2:textInComponent} ", - "\t\t\t", - "\t\t)", - "\t}", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ] - }, - "reactNativeClassComponentRedux": { - "prefix": "rncredux", - "body": [ - "import React, { Component } from 'react'", - "import { View, Text } from 'react-native'", - "import PropTypes from 'prop-types'", - "import { connect } from 'react-redux'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - "\tstatic propTypes = {", - "\t\t${2:prop}: ${3:PropTypes}", - "\t}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t", - "\t\t\t\t ${2:textInComponent} ", - "\t\t\t", - "\t\t)", - "\t}", - "}", - "", - "const mapStateToProps = (state) => ({", - "\t", - "})", - "", - "const mapDispatchToProps = {", - "\t", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", - "" - ], - "description": "Creates a React Native component class with PropTypes with connected redux and ES7 module system" - }, - "reactNativeFunctionalExportComponent": { - "prefix": "rnfe", - "body": [ - "import React from 'react'", - "import { View, Text } from 'react-native'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ] - }, - "reactNativeFunctionalExportComponentWithStyles": { - "prefix": "rnfes", - "body": [ - "import React from 'react'", - "import { StyleSheet, Text, View } from 'react-native'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "const styles = StyleSheet.create({})", - "" - ] - }, - "reactNativeFunctionalComponent": { - "prefix": "rnf", - "body": [ - "import React from 'react'", - "import { View, Text } from 'react-native'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "" - ] - }, - "reactNativeFunctionalComponentWithStyles": { - "prefix": "rnfs", - "body": [ - "import React from 'react'", - "import { StyleSheet, Text, View } from 'react-native'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "const styles = StyleSheet.create({})", - "" - ] - }, - "reactNativeImport": { - "prefix": "imrn", - "body": "import { ${1:moduleName} } from 'react-native'" - }, - "reactNativeStyles": { - "prefix": "rnstyle", - "body": ["const styles = StyleSheet.create({", "\t${1:style}", "})", ""] - }, - "propTypeArray": { - "prefix": "pta", - "body": "PropTypes.array,", - "description": "Array prop type" - }, - "propTypeArrayRequired": { - "prefix": "ptar", - "body": "PropTypes.array.isRequired,", - "description": "Array prop type required" - }, - "propTypeBool": { - "prefix": "ptb", - "body": "PropTypes.bool,", - "description": "Bool prop type" - }, - "propTypeBoolRequired": { - "prefix": "ptbr", - "body": "PropTypes.bool.isRequired,", - "description": "Bool prop type required" - }, - "propTypeFunc": { - "prefix": "ptf", - "body": "PropTypes.func,", - "description": "Func prop type" - }, - "propTypeFuncRequired": { - "prefix": "ptfr", - "body": "PropTypes.func.isRequired,", - "description": "Func prop type required" - }, - "propTypeNumber": { - "prefix": "ptn", - "body": "PropTypes.number,", - "description": "Number prop type" - }, - "propTypeNumberRequired": { - "prefix": "ptnr", - "body": "PropTypes.number.isRequired,", - "description": "Number prop type required" - }, - "propTypeObject": { - "prefix": "pto", - "body": "PropTypes.object,", - "description": "Object prop type" - }, - "propTypeObjectRequired": { - "prefix": "ptor", - "body": "PropTypes.object.isRequired,", - "description": "Object prop type required" - }, - "propTypeString": { - "prefix": "pts", - "body": "PropTypes.string,", - "description": "String prop type" - }, - "propTypeStringRequired": { - "prefix": "ptsr", - "body": "PropTypes.string.isRequired,", - "description": "String prop type required" - }, - "propTypeNode": { - "prefix": "ptnd", - "body": "PropTypes.node,", - "description": "Anything that can be rendered: numbers, strings, elements or an array" - }, - "propTypeNodeRequired": { - "prefix": "ptndr", - "body": "PropTypes.node.isRequired,", - "description": "Anything that can be rendered: numbers, strings, elements or an array required" - }, - "propTypeElement": { - "prefix": "ptel", - "body": "PropTypes.element,", - "description": "React element prop type" - }, - "propTypeElementRequired": { - "prefix": "ptelr", - "body": "PropTypes.element.isRequired,", - "description": "React element prop type required" - }, - "propTypeInstanceOf": { - "prefix": "pti", - "body": "PropTypes.instanceOf($0),", - "description": "Is an instance of a class prop type" - }, - "propTypeInstanceOfRequired": { - "prefix": "ptir", - "body": "PropTypes.instanceOf($0).isRequired,", - "description": "Is an instance of a class prop type required" - }, - "propTypeEnum": { - "prefix": "pte", - "body": "PropTypes.oneOf(['$0']),", - "description": "Prop type limited to specific values by treating it as an enum" - }, - "propTypeEnumRequired": { - "prefix": "pter", - "body": "PropTypes.oneOf(['$0']).isRequired,", - "description": "Prop type limited to specific values by treating it as an enum required" - }, - "propTypeOneOfType": { - "prefix": "ptet", - "body": ["PropTypes.oneOfType([", "\t$0", "]),"], - "description": "An object that could be one of many types" - }, - "propTypeOneOfTypeRequired": { - "prefix": "ptetr", - "body": ["PropTypes.oneOfType([", "\t$0", "]).isRequired,"], - "description": "An object that could be one of many types required" - }, - "propTypeArrayOf": { - "prefix": "ptao", - "body": "PropTypes.arrayOf($0),", - "description": "An array of a certain type" - }, - "propTypeArrayOfRequired": { - "prefix": "ptaor", - "body": "PropTypes.arrayOf($0).isRequired,", - "description": "An array of a certain type required" - }, - "propTypeObjectOf": { - "prefix": "ptoo", - "body": "PropTypes.objectOf($0),", - "description": "An object with property values of a certain type" - }, - "propTypeObjectOfRequired": { - "prefix": "ptoor", - "body": "PropTypes.objectOf($0).isRequired,", - "description": "An object with property values of a certain type required" - }, - "propTypeShape": { - "prefix": "ptsh", - "body": ["PropTypes.shape({", "\t$0", "}),"], - "description": "An object taking on a particular shape" - }, - "propTypeShapeRequired": { - "prefix": "ptshr", - "body": ["PropTypes.shape({", "\t$0", "}).isRequired,"], - "description": "An object taking on a particular shape required" - }, - "propTypeExact": { - "prefix": "ptex", - "body": ["PropTypes.exact({", "\t$0", "}),"], - "description": "An object with warnings on extra properties" - }, - "propTypeExactRequired": { - "prefix": "ptexr", - "body": ["PropTypes.exact({", "\t$0", "}).isRequired,"], - "description": "An object with warnings on extra properties required" - }, - "staticPropTpyes": { - "prefix": "ptypes", - "body": ["static propTypes = {", "$0", "}", ""] - }, - "propTypeAny": { - "prefix": "ptany", - "body": "PropTypes.any,", - "description": "Any prop type" - }, - "Comment Big Block": { - "prefix": "cmmb", - "body": ["/**", " * ${0}", " */"] - }, - "describeBlock": { - "prefix": "desc", - "body": ["describe('$1', () => {", "\t$0", "})", ""], - "description": "Testing `describe` block" - }, - "testBlock": { - "prefix": "test", - "body": ["test('should $1', () => {", "\t$0", "})", ""], - "description": "Testing `test` block" - }, - "testAsyncBlock": { - "prefix": "testa", - "body": ["test('should $1', async () => {", "\t$0", "})", ""], - "description": "Testing `asynchronous test` block" - }, - "itBlock": { - "prefix": "tit", - "body": ["it('should $1', () => {", "\t$0", "})", ""], - "description": "Testing `it` block" - }, - "itAsyncBlock": { - "prefix": "tita", - "body": ["it('should $1', async () => {", "\t$0", "})", ""], - "description": "Testing asynchronous `it` block" - }, - "setupReactTest": { - "prefix": "stest", - "body": [ - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ] - }, - "setupReactNativeTest": { - "prefix": "sntest", - "body": [ - "import 'react-native'", - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ] - }, - "setupReactComponentTestWithRedux": { - "prefix": "srtest", - "body": [ - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from 'src/store'", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(", - "\t\t", - "\t\t <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - "\t\t,", - "\t)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ], - "description": "Create test component" - }, - "setupReactNativeTestWithRedux": { - "prefix": "snrtest", - "body": [ - "import 'react-native'", - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from 'src/store'", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(", - "\t\t", - "\t\t\t<${1:${TM_FILENAME_BASE}} {...defaultProps} />", - "\t\t,", - "\t)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ] - }, - "graphQLForComponent": { - "prefix": "graphql", - "body": ["import { compose, graphql } from 'react-apollo'", ""] - }, - "exportGraphQL": { - "prefix": "expgql", - "body": [ - "export default compose(", - "\tgraphql(${1:queryOrMutation}, { name: ${2:name} }),", - ")(${1:${TM_FILENAME_BASE}})" - ] - }, - "hocComponentWithRedux": { - "prefix": "hocredux", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "import { connect } from 'react-redux'", - "", - "export const mapStateToProps = state => ({", - "", - "})", - "", - "export const mapDispatchToProps = {", - " ", - "}", - "", - "export const ${1:hocComponentName} = (WrappedComponent) => {", - "\tconst hocComponent = ({ ...props }) => ", - "", - "\thocComponent.propTypes = {", - "\t}", - "", - "\treturn hocComponent", - "}", - "", - "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent))", - "" - ] - }, - "hocComponent": { - "prefix": "hoc", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default (WrappedComponent) => {", - "\tconst hocComponent = ({ ...props }) => ", - "", - "\thocComponent.propTypes = {", - "\t}", - "", - "\treturn hocComponent", - "}", - "" - ] - }, - "useState": { - "prefix": "useState", - "body": [ - "const [${1:state}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:initialState})" - ] - }, - "useEffect": { - "prefix": "useEffect", - "body": [ - "useEffect(() => {", - "\t${1:effect}", - "\treturn () => {", - "\t\t${2:cleanup}", - "\t}", - "}, [${3:input}])" - ] - }, - "useContext": { - "prefix": "useContext", - "body": ["const ${1:context} = useContext(${2:contextValue})"] - }, - "useReducer": { - "prefix": "useReducer", - "body": [ - "const [state, dispatch] = useReducer(${1:reducer}, ${2:initialState}, ${3:init})" - ] - }, - "useCallback": { - "prefix": "useCallback", - "body": [ - "useCallback(", - "\t() => {", - "\t\t${1:callback}", - "\t},", - "\t[${2:input}],", - ")" - ] - }, - "useMemo": { - "prefix": "useMemo", - "body": ["useMemo(() => ${1:function}, ${2:input})"] - }, - "useRef": { - "prefix": "useRef", - "body": ["const ${1:ref} = useRef(${2:initialValue})"] - }, - "useImperativeHandle": { - "prefix": "useImperativeHandle", - "body": [ - "useImperativeHandle(", - "\t${1:ref},", - "\t() => {", - "\t\t${2:handler}", - "\t},", - "\t[${3:input}],", - ")" - ] - }, - "useDebugValue": { - "prefix": "useDebugValue", - "body": ["useDebugValue(${1:value})"] - }, - "useLayoutEffect": { - "prefix": "useLayoutEffect", - "body": [ - "useLayoutEffect(() => {", - "\t${1:effect}", - "\treturn () => {", - "\t\t${2:cleanup}", - "\t};", - "}, [${3:input}])" - ] - }, - "useSelector": { - "prefix": "useSelector", - "body": ["const ${1:state} = useSelector(state => state.${1:state})"] - }, - "useDispatch": { - "prefix": "useDispatch", - "body": ["const dispatch = useDispatch()"] - }, - "typeof": { - "prefix": "tpf", - "body": ["typeof ${0}"] - }, - "_reactFunctionalExportComponent": { - "prefix": "_rfce", - "body": [ - "function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React 17 Functional Component with ES7 module system" - }, - "_reactFunctionalComponent": { - "prefix": "_rfc", - "body": [ - "export default function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "" - ], - "description": "Creates a React 17 Functional Component with ES7 module system" - }, - "_reactFunctionalComponentWithPropTypes": { - "prefix": "_rfcp", - "body": [ - "import PropTypes from 'prop-types'", - "", - "function ${1:${TM_FILENAME_BASE}}(props) {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - "", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "" - ], - "description": "Creates a React 17 Functional Component with ES7 module system with PropTypes" - }, - "_reactArrowFunctionExportComponent": { - "prefix": "_rafce", - "body": [ - "const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React 17 Arrow Function Component with ES7 module system" - }, - "_reactArrowFunctionComponent": { - "prefix": "_rafc", - "body": [ - "export const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "" - ], - "description": "Creates a React 17 Arrow Function Component with ES7 module system" - }, - "_reactArrowFunctionComponentWithPropTypes": { - "prefix": "_rafcp", - "body": [ - "import PropTypes from 'prop-types'", - "", - "const ${1:${TM_FILENAME_BASE}} = props => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - "", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React 17 Arrow Function Component with ES7 module system with PropTypes" - }, - "_reactNativeFunctionalExportComponent": { - "prefix": "_rnfe", - "body": [ - "import { View, Text } from 'react-native'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ] - }, - "_reactNativeFunctionalExportComponentWithStyles": { - "prefix": "_rnfes", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "const styles = StyleSheet.create({})", - "" - ] - }, - "_reactNativeFunctionalComponent": { - "prefix": "_rnf", - "body": [ - "import { View, Text } from 'react-native'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "" - ] - }, - "_reactNativeFunctionalComponentWithStyles": { - "prefix": "_rnfs", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "const styles = StyleSheet.create({})", - "" - ] - }, - "_setupReactTest": { - "prefix": "_stest", - "body": [ - "import renderer from 'react-test-renderer'", - "", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ] - }, - "_setupReactNativeTest": { - "prefix": "_sntest", - "body": [ - "import 'react-native'", - "import renderer from 'react-test-renderer'", - "", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ] - }, - "_setupReactComponentTestWithRedux": { - "prefix": "_srtest", - "body": [ - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from 'src/store'", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(", - "\t\t", - "\t\t <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - "\t\t,", - "\t)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ], - "description": "Create test component" - }, - "_setupReactNativeTestWithRedux": { - "prefix": "_snrtest", - "body": [ - "import 'react-native'", - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from 'src/store'", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - "\tconst defaultProps = {}", - "\tconst wrapper = renderer.create(", - "\t\t", - "\t\t\t<${1:${TM_FILENAME_BASE}} {...defaultProps} />", - "\t\t,", - "\t)", - "", - "\ttest('render', () => {", - "\t\texpect(wrapper).toMatchSnapshot()", - "\t})", - "})", - "" - ] - }, - "_hocComponentWithRedux": { - "prefix": "_hocredux", - "body": [ - "import PropTypes from 'prop-types'", - "import { connect } from 'react-redux'", - "", - "export const mapStateToProps = state => ({", - "", - "})", - "", - "export const mapDispatchToProps = {", - " ", - "}", - "", - "export const ${1:hocComponentName} = (WrappedComponent) => {", - "\tconst hocComponent = ({ ...props }) => ", - "", - "\thocComponent.propTypes = {", - "\t}", - "", - "\treturn hocComponent", - "}", - "", - "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent))", - "" - ] - }, - "_hocComponent": { - "prefix": "_hoc", - "body": [ - "import PropTypes from 'prop-types'", - "", - "export default (WrappedComponent) => {", - "\tconst hocComponent = ({ ...props }) => ", - "", - "\thocComponent.propTypes = {", - "\t}", - "", - "\treturn hocComponent", - "}", - "" - ] - }, - "reactCustomHook": { - "prefix": "rch", - "body": [ - "const ${1:${TM_FILENAME_BASE}} = () => {", - "\t$2", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Custom Hook with ES7 module system" - } -} diff --git a/src/snippets/ts-snippets.json b/src/snippets/ts-snippets.json deleted file mode 100644 index 7fc4b9d..0000000 --- a/src/snippets/ts-snippets.json +++ /dev/null @@ -1,325 +0,0 @@ -{ - "typeScriptReactClassComponent": { - "prefix": "tsrcc", - "body": [ - "import React, { Component } from 'react'", - "", - "interface Props {", - "\t", - "}", - "interface State {", - "\t", - "}", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - "\tstate = {}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system and TypeScript interfaces" - }, - "typeScriptReactClassExportComponent": { - "prefix": "tsrce", - "body": [ - "import React, { Component } from 'react'", - "", - "interface Props {", - "\t", - "}", - "interface State {", - "\t", - "}", - "", - "class ${1:${TM_FILENAME_BASE}} extends Component {", - "\tstate = {}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React component class with ES7 module system and TypeScript interfaces" - }, - "typeScriptReactFunctionalExportComponent": { - "prefix": "tsrfce", - "body": [ - "import React, { ReactElement } from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "function ${1:${TM_FILENAME_BASE}}({}: Props): ReactElement {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface" - }, - "typeScriptReactFunctionalComponent": { - "prefix": "tsrfc", - "body": [ - "import React, { ReactElement } from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "export default function ${1:${TM_FILENAME_BASE}}({}: Props): ReactElement {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface" - }, - "typeScriptReactArrowFunctionExportComponent": { - "prefix": "tsrafce", - "body": [ - "import React from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" - }, - "typeScriptReactArrowFunctionComponent": { - "prefix": "tsrafc", - "body": [ - "import React from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" - }, - "typeScriptReactClassPureComponent": { - "prefix": "tsrpc", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface" - }, - "typeScriptReactClassExportPureComponent": { - "prefix": "tsrpce", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface" - }, - "typeScriptReactFunctionMemoComponent": { - "prefix": "tsrmc", - "body": [ - "import React, { memo } from 'react'", - "", - "interface Props {", - "\t", - "}", - "", - "export default memo(function ${1:${TM_FILENAME_BASE}}({}: Props) {", - "\treturn (", - "\t\t
", - "\t\t\t$0", - "\t\t
", - "\t)", - "})", - "" - ], - "description": "Creates a React Memo Function Component with ES7 module system and TypeScript interface" - }, - "typeScriptReactClassCompomentRedux": { - "prefix": "tsrcredux", - "body": [ - "import React, { Component } from 'react'", - "import { connect } from 'react-redux'", - "", - "interface Props {", - "\t", - "}", - "interface State {", - "\t", - "}", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - "\tstate = {}", - "", - "\trender() {", - "\t\treturn (", - "\t\t\t
", - "\t\t\t\t$0", - "\t\t\t
", - "\t\t)", - "\t}", - "}", - "", - "const mapStateToProps = (state) => ({", - "\t", - "})", - "", - "const mapDispatchToProps = {", - "\t", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})", - "" - ], - "description": "Creates a React component class with PropTypes with connected redux and ES7 module system and TypeScript interfaces" - }, - "typescriptReactNativeArrowFunctionComponent": { - "prefix": "tsrnf", - "body": [ - "import React from 'react'", - "import { View, Text } from 'react-native'", - "", - "interface Props {", - "\t", - "}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface" - }, - "typescriptReactNativeArrowFunctionComponentNamedProps": { - "prefix": "tsrnfi", - "body": [ - "import React from 'react'", - "import { View } from 'react-native'", - "", - "interface ${1:${TM_FILENAME_BASE}}Props {", - "\t", - "}", - "", - "const ${1:${TM_FILENAME_BASE}}: React.FC<${1:${TM_FILENAME_BASE}}Props> = (props) => {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface" - }, - "typescriptReactNativeArrowFunctionComponentWithStyles": { - "prefix": "tsrnfs", - "body": [ - "import React from 'react'", - "import { StyleSheet, Text, View } from 'react-native'", - "", - "interface Props {", - "\t", - "}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - "\treturn (", - "\t\t", - "\t\t\t$0", - "\t\t", - "\t)", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "const styles = StyleSheet.create({})", - "" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet" - }, - "exportInterface": { - "prefix": "expint", - "body": ["export interface ${1:${TM_FILENAME_BASE}} {$0}"] - }, - "Export type": { - "prefix": "exptp", - "body": ["export type ${1:${TM_FILENAME_BASE}} = {$0}"] - } -} diff --git a/src/sourceSnippets/components.ts b/src/sourceSnippets/components.ts new file mode 100644 index 0000000..eecde14 --- /dev/null +++ b/src/sourceSnippets/components.ts @@ -0,0 +1,348 @@ +import { + innerComponent, + innerComponentReturn, + react, + reactComponent, + reactComponentWithReduxConnect, + reactPropTypes, + reactPureComponent, + reactWithMemo, + reactWithReduxConnect, + reduxComponentExport, + exportDefault, +} from "./sharedSnippets"; +import { SnippetPlaceholders, SnippetMapping } from "../types"; + +type ComponentMappings = { + reactArrowFunctionComponent: "rafc"; + reactArrowFunctionComponentWithPropTypes: "rafcp"; + reactArrowFunctionExportComponent: "rafce"; + reactClassComponentPropTypes: "rccp"; + reactClassComponentRedux: "rcredux"; + reactClassComponentReduxPropTypes: "rcreduxp"; + reactClassComponent: "rcc"; + reactClassExportComponent: "rce"; + reactClassExportComponentWithPropTypes: "rcep"; + reactClassExportPureComponent: "rpce"; + reactClassPureComponent: "rpc"; + reactClassPureComponentWithPropTypes: "rpcp"; + reactFunctionMemoComponent: "rmc"; + reactFunctionMemoComponentWithPropTypes: "rmcp"; + reactFunctionalComponentRedux: "rfcredux"; + reactFunctionalComponentReduxPropTypes: "rfcreduxp"; + reactFunctionalComponent: "rfc"; + reactFunctionalComponentWithPropTypes: "rfcp"; + reactFunctionalExportComponent: "rfce"; +}; + +export type ComponentsSnippet = SnippetMapping; + +const reactClassComponent: ComponentsSnippet = { + key: "reactClassComponent", + prefix: "rcc", + body: [ + ...reactComponent, + `export default class ${SnippetPlaceholders.FileName} extends Component {`, + ...innerComponentReturn, + "}", + "", + ], + description: "Creates a React component class with ES7 module system", +}; + +const reactClassExportComponent: ComponentsSnippet = { + key: "reactClassExportComponent", + prefix: "rce", + body: [ + ...reactComponent, + `export class ${SnippetPlaceholders.FileName} extends Component {`, + ...innerComponentReturn, + "}", + ...exportDefault, + ], + description: "Creates a React component class with ES7 module system", +}; + +const reactFunctionalExportComponent: ComponentsSnippet = { + key: "reactFunctionalExportComponent", + prefix: "rfce", + body: [ + ...react, + `function ${SnippetPlaceholders.FileName}() {`, + ...innerComponent, + "}", + ...exportDefault, + ], + description: "Creates a React Functional Component with ES7 module system", +}; + +const reactFunctionalComponent: ComponentsSnippet = { + key: "reactFunctionalComponent", + prefix: "rfc", + body: [ + ...react, + `export default function ${SnippetPlaceholders.FileName}() {`, + ...innerComponent, + "}", + "", + ], + description: "Creates a React Functional Component with ES7 module system", +}; + +const reactFunctionalComponentWithPropTypes: ComponentsSnippet = { + key: "reactFunctionalComponentWithPropTypes", + prefix: "rfcp", + body: [ + ...reactPropTypes, + `function ${SnippetPlaceholders.FileName}(props) {`, + ...innerComponent, + "}", + "", + `${SnippetPlaceholders.FileName}.propTypes = {}`, + ...exportDefault, + "", + ], + description: + "Creates a React Functional Component with ES7 module system with PropTypes", +}; + +const reactArrowFunctionExportComponent: ComponentsSnippet = { + key: "reactArrowFunctionExportComponent", + prefix: "rafce", + body: [ + ...react, + `const ${SnippetPlaceholders.FileName} = () => {`, + ...innerComponent, + "}", + ...exportDefault, + ], + description: + "Creates a React Arrow Function Component with ES7 module system", +}; + +const reactArrowFunctionComponent: ComponentsSnippet = { + key: "reactArrowFunctionComponent", + prefix: "rafc", + body: [ + ...react, + `export const ${SnippetPlaceholders.FileName} = () => {`, + ...innerComponent, + "}", + "", + ], + description: + "Creates a React Arrow Function Component with ES7 module system", +}; + +const reactArrowFunctionComponentWithPropTypes: ComponentsSnippet = { + key: "reactArrowFunctionComponentWithPropTypes", + prefix: "rafcp", + body: [ + ...reactPropTypes, + `const ${SnippetPlaceholders.FileName} = props => {`, + ...innerComponent, + "}", + "", + `${SnippetPlaceholders.FileName}.propTypes = {}`, + ...exportDefault, + ], + description: + "Creates a React Arrow Function Component with ES7 module system with PropTypes", +}; + +const reactClassExportComponentWithPropTypes: ComponentsSnippet = { + key: "reactClassExportComponentWithPropTypes", + prefix: "rcep", + body: [ + "import PropTypes from 'prop-types'", + ...reactComponent, + `export class ${SnippetPlaceholders.FileName} extends Component {`, + " static propTypes = {}", + "", + ...innerComponentReturn, + "}", + ...exportDefault, + ], + description: "Creates a React component class with ES7 module system", +}; + +const reactClassPureComponent: ComponentsSnippet = { + key: "reactClassPureComponent", + prefix: "rpc", + body: [ + ...reactPureComponent, + `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + ...innerComponentReturn, + "}", + "", + ], + description: "Creates a React pure component class with ES7 module system", +}; + +const reactClassExportPureComponent: ComponentsSnippet = { + key: "reactClassExportPureComponent", + prefix: "rpce", + body: [ + ...reactPureComponent, + `export class ${SnippetPlaceholders.FileName} extends PureComponent {`, + ...innerComponentReturn, + "}", + ...exportDefault, + ], + description: + "Creates a React pure component class with ES7 module system export", +}; + +const reactClassPureComponentWithPropTypes: ComponentsSnippet = { + key: "reactClassPureComponentWithPropTypes", + prefix: "rpcp", + body: [ + "import PropTypes from 'prop-types'", + ...reactPureComponent, + `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + " static propTypes = {}", + "", + ...innerComponentReturn, + "}", + "", + ], + description: "Creates a React component class with ES7 module system", +}; + +const reactFunctionMemoComponent: ComponentsSnippet = { + key: "reactFunctionMemoComponent", + prefix: "rmc", + body: [ + "import React, { memo } from 'react'", + "", + `export default memo(function ${SnippetPlaceholders.FileName}() {`, + ...innerComponent, + "})", + "", + ], + description: "Creates a React Memo Function Component with ES7 module system", +}; + +const reactFunctionMemoComponentWithPropTypes: ComponentsSnippet = { + key: "reactFunctionMemoComponentWithPropTypes", + prefix: "rmcp", + body: [ + "import PropTypes from 'prop-types'", + ...reactWithMemo, + `const ${SnippetPlaceholders.FileName} = memo(function ${SnippetPlaceholders.FileName}(props) {`, + ...innerComponent, + "})", + "", + `${SnippetPlaceholders.FileName}.propTypes = {}`, + ...exportDefault, + ], + description: + "Creates a React Memo Function Component with ES7 module system with PropTypes", +}; + +const reactClassComponentPropTypes: ComponentsSnippet = { + key: "reactClassComponentPropTypes", + prefix: "rccp", + body: [ + "import PropTypes from 'prop-types'", + ...reactComponent, + `export default class ${SnippetPlaceholders.FileName} extends Component {`, + " static propTypes = {", + ` ${SnippetPlaceholders.SecondTab}: ${SnippetPlaceholders.ThirdTab}`, + " }", + "", + ...innerComponentReturn, + "}", + "", + ], + description: + "Creates a React component class with PropTypes and ES7 module system", +}; + +const reactClassComponentRedux: ComponentsSnippet = { + key: "reactClassComponentRedux", + prefix: "rcredux", + body: [ + ...reactComponentWithReduxConnect, + `export class ${SnippetPlaceholders.FileName} extends Component {`, + ...innerComponentReturn, + "}", + ...reduxComponentExport, + ], + description: + "Creates a React component class with connected redux and ES7 module system", +}; + +const reactClassComponentReduxPropTypes: ComponentsSnippet = { + key: "reactClassComponentReduxPropTypes", + prefix: "rcreduxp", + body: [ + "import PropTypes from 'prop-types'", + ...reactComponentWithReduxConnect, + `export class ${SnippetPlaceholders.FileName} extends Component {`, + " static propTypes = {", + ` ${SnippetPlaceholders.SecondTab}: ${SnippetPlaceholders.ThirdTab}`, + " }", + "", + ...innerComponentReturn, + "}", + ...reduxComponentExport, + ], + description: + "Creates a React component class with PropTypes with connected redux and ES7 module system", +}; + +const reactFunctionalComponentRedux: ComponentsSnippet = { + key: "reactFunctionalComponentRedux", + prefix: "rfcredux", + body: [ + ...reactWithReduxConnect, + `export const ${SnippetPlaceholders.FileName} = (props) => {`, + ...innerComponent, + "}", + ...reduxComponentExport, + ], + description: + "Creates a React functional component with connected redux and ES7 module system", +}; + +const reactFunctionalComponentReduxPropTypes: ComponentsSnippet = { + key: "reactFunctionalComponentReduxPropTypes", + prefix: "rfcreduxp", + body: [ + "import PropTypes from 'prop-types'", + ...reactWithReduxConnect, + `export const ${SnippetPlaceholders.FileName} = (props) => {`, + ...innerComponent, + "}", + "", + `${SnippetPlaceholders.FileName}.propTypes = {`, + ` ${SnippetPlaceholders.SecondTab}: PropTypes.${SnippetPlaceholders.ThirdTab}`, + "}", + ...reduxComponentExport, + ], + description: + "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", +}; + +export default [ + reactArrowFunctionComponent, + reactArrowFunctionComponentWithPropTypes, + reactArrowFunctionExportComponent, + reactClassComponent, + reactClassComponentPropTypes, + reactClassComponentRedux, + reactClassComponentReduxPropTypes, + reactClassExportComponent, + reactClassExportComponentWithPropTypes, + reactClassExportPureComponent, + reactClassPureComponent, + reactClassPureComponentWithPropTypes, + reactFunctionMemoComponent, + reactFunctionMemoComponentWithPropTypes, + reactFunctionalComponent, + reactFunctionalComponentRedux, + reactFunctionalComponentReduxPropTypes, + reactFunctionalComponentWithPropTypes, + reactFunctionalExportComponent, +]; diff --git a/src/sourceSnippets/console.ts b/src/sourceSnippets/console.ts new file mode 100644 index 0000000..b258de7 --- /dev/null +++ b/src/sourceSnippets/console.ts @@ -0,0 +1,157 @@ +import { SnippetPlaceholders, SnippetMapping } from "../types"; + +type ConsoleMapping = { + consoleAssert: "cas"; + consoleClear: "ccl"; + consoleCount: "cco"; + consoleDir: "cdi"; + consoleError: "cer"; + consoleGroup: "cgr"; + consoleGroupEnd: "cge"; + consoleLog: "clg"; + consoleTrace: "ctr"; + consoleLogObject: "clo"; + consoleLogJson: "clj"; + consoleTime: "ctm"; + consoleTimeEnd: "cte"; + consoleWarn: "cwa"; + consoleInfo: "cin"; +}; + +export type ConsoleSnippet = SnippetMapping; + +const consoleAssert: ConsoleSnippet = { + key: "consoleAssert", + prefix: "cas", + body: [ + `console.assert(${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab})`, + ], + description: + "If the specified expression is false, the message is written to the console along with a stack trace", +}; + +const consoleClear: ConsoleSnippet = { + key: "consoleClear", + prefix: "ccl", + body: ["console.clear()"], + description: "Clears the console", +}; + +const consoleCount: ConsoleSnippet = { + key: "consoleCount", + prefix: "cco", + body: [`console.count(${SnippetPlaceholders.FirstTab})`], + description: + "Writes the the number of times that count() has been invoked at the same line and with the same label", +}; + +const consoleDir: ConsoleSnippet = { + key: "consoleDir", + prefix: "cdi", + body: [`console.dir(${SnippetPlaceholders.FirstTab})`], + description: "Prints a JavaScript representation of the specified object", +}; + +const consoleError: ConsoleSnippet = { + key: "consoleError", + prefix: "cer", + body: [`console.error(${SnippetPlaceholders.FirstTab})`], + description: + "Displays a message in the console and also includes a stack trace from where the method was called", +}; + +const consoleGroup: ConsoleSnippet = { + key: "consoleGroup", + prefix: "cgr", + body: [`console.group('${SnippetPlaceholders.FirstTab}')`], + description: + "Groups and indents all following output by an additional level, until console.groupEnd() is called.", +}; + +const consoleGroupEnd: ConsoleSnippet = { + key: "consoleGroupEnd", + prefix: "cge", + body: ["console.groupEnd()"], + description: "Closes out the corresponding console.group().", +}; + +const consoleLog: ConsoleSnippet = { + key: "consoleLog", + prefix: "clg", + body: [`console.log(${SnippetPlaceholders.FirstTab})`], + description: "Displays a message in the console", +}; + +const consoleTrace: ConsoleSnippet = { + key: "consoleTrace", + prefix: "ctr", + body: [`console.trace(${SnippetPlaceholders.FirstTab})`], + description: + "Prints a stack trace from the point where the method was called", +}; + +const consoleLogObject: ConsoleSnippet = { + key: "consoleLogObject", + prefix: "clo", + body: [ + `console.log('${SnippetPlaceholders.FirstTab}', ${SnippetPlaceholders.FirstTab})`, + ], + description: "Logs property with name.", +}; + +const consoleLogJson: ConsoleSnippet = { + key: "consoleLogJson", + prefix: "clj", + body: [ + `console.log('${SnippetPlaceholders.FirstTab}', JSON.stringify(${SnippetPlaceholders.FirstTab}, null, 2))`, + ], + description: "Logs stringified JSON property with name.", +}; + +const consoleTime: ConsoleSnippet = { + key: "consoleTime", + prefix: "ctm", + body: [`console.time('${SnippetPlaceholders.FirstTab}')`], + description: "Console time wrapper", +}; + +const consoleTimeEnd: ConsoleSnippet = { + key: "consoleTimeEnd", + prefix: "cte", + body: [`console.timeEnd('${SnippetPlaceholders.FirstTab}')`], + description: "Console time end wrapper", +}; + +const consoleWarn: ConsoleSnippet = { + key: "consoleWarn", + prefix: "cwa", + body: [`console.warn(${SnippetPlaceholders.FirstTab})`], + description: + "Displays a message in the console but also displays a yellow warning icon along with the logged message", +}; + +const consoleInfo: ConsoleSnippet = { + key: "consoleInfo", + prefix: "cin", + body: [`console.info(${SnippetPlaceholders.FirstTab})`], + description: + "Displays a message in the console but also displays a blue information icon along with the logged message", +}; + +export default [ + consoleAssert, + consoleClear, + consoleCount, + consoleDir, + consoleError, + consoleGroup, + consoleGroupEnd, + consoleLog, + consoleTrace, + consoleLogObject, + consoleLogJson, + consoleTime, + consoleTimeEnd, + consoleWarn, + consoleInfo, +]; diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts new file mode 100644 index 0000000..2a018b7 --- /dev/null +++ b/src/sourceSnippets/hooks.ts @@ -0,0 +1,117 @@ +import { SnippetMapping } from "../types"; + +type HookMappings = { + useCallback: "useCallbackSnippet"; + useContext: "useContextSnippet"; + useEffect: "useEffectSnippet"; + useImperativeHandle: "useImperativeHandleSnippet"; + useLayoutEffect: "useLayoutEffectSnippet"; + useMemo: "useMemoSnippet"; + useReducer: "useReducerSnippet"; + useRef: "useRefSnippet"; + useState: "useStateSnippet"; +}; + +export type HooksSnippet = SnippetMapping; + +const useState: HooksSnippet = { + key: "useState", + prefix: "useStateSnippet", + body: [ + "const [${1:state}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:initialState})", + ], +}; + +const useEffect: HooksSnippet = { + key: "useEffect", + prefix: "useEffectSnippet", + body: [ + "useEffect(() => {", + " ${1:effect}", + "", + " return () => {", + " ${2:cleanup}", + " }", + "}, [${3:input}])", + "", + ], +}; + +const useContext: HooksSnippet = { + key: "useContext", + prefix: "useContextSnippet", + body: ["const ${1:context} = useContext(${2:contextValue})"], +}; + +const useReducer: HooksSnippet = { + key: "useReducer", + prefix: "useReducerSnippet", + body: [ + "const [state, dispatch] = useReducer(${1:reducer}, ${2:initialState}, ${3:init})", + ], +}; + +const useCallback: HooksSnippet = { + key: "useCallback", + prefix: "useCallbackSnippet", + body: [ + "useCallback(", + " () => {", + " ${1:callback}", + " },", + " [${2:input}],", + ")", + "", + ], +}; + +const useMemo: HooksSnippet = { + key: "useMemo", + prefix: "useMemoSnippet", + body: ["useMemo(() => ${1:function}, ${2:input})"], +}; + +const useRef: HooksSnippet = { + key: "useRef", + prefix: "useRefSnippet", + body: ["const ${1:ref} = useRef(${2:initialValue})"], +}; + +const useImperativeHandle: HooksSnippet = { + key: "useImperativeHandle", + prefix: "useImperativeHandleSnippet", + body: [ + "useImperativeHandle(", + " ${1:ref},", + " () => {", + " ${2:handler}", + " },", + " [${3:input}],", + ")", + ], +}; + +const useLayoutEffect: HooksSnippet = { + key: "useLayoutEffect", + prefix: "useLayoutEffectSnippet", + body: [ + "useLayoutEffect(() => {", + " ${1:effect}", + " return () => {", + " ${2:cleanup}", + " };", + "}, [${3:input}])", + ], +}; + +export default [ + useState, + useEffect, + useContext, + useReducer, + useCallback, + useMemo, + useRef, + useImperativeHandle, + useLayoutEffect, +]; diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts new file mode 100644 index 0000000..194bb7f --- /dev/null +++ b/src/sourceSnippets/imports.ts @@ -0,0 +1,196 @@ +import { SnippetMapping } from "../types"; + +type ImportsMappings = { + import: "imp"; + importAs: "ima"; + importBrowserRouter: "imbr"; + importBrowserRouterWithRouteAndNavLink: "imrr"; + importDestructing: "imd"; + importEverything: "ime"; + importNoModuleName: "imn"; + importPropTypes: "impt"; + importReact: "imr"; + importReactDom: "imrd"; + importReactWithComponent: "imrc"; + importReactWithComponentAndPropTypes: "imrcp"; + importReactWithMemo: "imrm"; + importReactWithMemoAndPropTypes: "imrmp"; + importReactWithPureComponent: "imrpc"; + importReactWithPureComponentAndPropTypes: "imrpcp"; + importReduxConnect: "redux"; + importRouterLink: "imbrl"; + importRouterNavLink: "imbrnl"; + importRouterSetup: "imbrc"; + importRouterSwitch: "imbrs"; +}; + +export type ImportsSnippet = SnippetMapping; + +/** + * react, react-dom & prop-types + */ +const importReact: ImportsSnippet = { + key: "importReact", + prefix: "imr", + body: ["import React from 'react'", ""], +}; + +const importReactDom: ImportsSnippet = { + key: "importReactDom", + prefix: "imrd", + body: ["import ReactDOM from 'react-dom'", ""], +}; + +const importReactWithComponent: ImportsSnippet = { + key: "importReactWithComponent", + prefix: "imrc", + body: ["import React, { Component } from 'react'", ""], +}; + +const importReactWithComponentAndPropTypes: ImportsSnippet = { + key: "importReactWithComponentAndPropTypes", + prefix: "imrcp", + body: [ + "import React, { Component } from 'react'", + "import PropTypes from 'prop-types'", + "", + ], +}; + +const importReactWithPureComponent: ImportsSnippet = { + key: "importReactWithPureComponent", + prefix: "imrpc", + body: ["import React, { PureComponent } from 'react'", ""], +}; + +const importReactWithPureComponentAndPropTypes: ImportsSnippet = { + key: "importReactWithPureComponentAndPropTypes", + prefix: "imrpcp", + body: [ + "import React, { PureComponent } from 'react'", + "import PropTypes from 'prop-types'", + "", + ], +}; + +const importReactWithMemo: ImportsSnippet = { + key: "importReactWithMemo", + prefix: "imrm", + body: ["import React, { memo } from 'react'", ""], +}; + +const importReactWithMemoAndPropTypes: ImportsSnippet = { + key: "importReactWithMemoAndPropTypes", + prefix: "imrmp", + body: [ + "import React, { memo } from 'react'", + "import PropTypes from 'prop-types'", + "", + ], +}; + +const importPropTypes: ImportsSnippet = { + key: "importPropTypes", + prefix: "impt", + body: ["import PropTypes from 'prop-types'", ""], +}; + +/** + * react-router + */ + +const importBrowserRouter: ImportsSnippet = { + key: "importBrowserRouter", + prefix: "imbr", + body: ["import { BrowserRouter as Router } from 'react-router-dom'", ""], +}; + +const importBrowserRouterWithRouteAndNavLink: ImportsSnippet = { + key: "importBrowserRouterWithRouteAndNavLink", + prefix: "imrr", + body: [ + "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", + "", + ], +}; + +const importRouterSetup: ImportsSnippet = { + key: "importRouterSetup", + prefix: "imbrc", + body: ["import { Route, Switch, NavLink, Link } from 'react-router-dom'", ""], +}; + +const importRouterSwitch: ImportsSnippet = { + key: "importRouterSwitch", + prefix: "imbrs", + body: ["import { Switch } from 'react-router-dom'", ""], +}; + +const importRouterLink: ImportsSnippet = { + key: "importRouterLink", + prefix: "imbrl", + body: ["import { Link } from 'react-router-dom'", ""], +}; + +const importRouterNavLink: ImportsSnippet = { + key: "importRouterNavLink", + prefix: "imbrnl", + body: ["import { NavLink } from 'react-router-dom'", ""], +}; + +/** + * Others + */ + +const importSnippet: ImportsSnippet = { + key: "import", + prefix: "imp", + body: ["import ${2:moduleName} from '${1:module}'$0", ""], +}; + +const importNoModuleName: ImportsSnippet = { + key: "importNoModuleName", + prefix: "imn", + body: ["import '${1:module}'$0", ""], +}; + +const importDestructing: ImportsSnippet = { + key: "importDestructing", + prefix: "imd", + body: ["import { $2 } from '${1:module}'$0", ""], +}; + +const importEverything: ImportsSnippet = { + key: "importEverything", + prefix: "ime", + body: ["import * as ${2:alias} from '${1:module}'$0", ""], +}; + +const importAs: ImportsSnippet = { + key: "importAs", + prefix: "ima", + body: ["import { ${2:originalName} as ${3:alias} } from '${1:module}'$0", ""], +}; + +export default [ + importAs, + importBrowserRouter, + importBrowserRouterWithRouteAndNavLink, + importDestructing, + importEverything, + importNoModuleName, + importPropTypes, + importReact, + importReactDom, + importReactWithComponent, + importReactWithComponentAndPropTypes, + importReactWithMemo, + importReactWithMemoAndPropTypes, + importReactWithPureComponent, + importReactWithPureComponentAndPropTypes, + importRouterLink, + importRouterNavLink, + importRouterSetup, + importRouterSwitch, + importSnippet, +]; diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts new file mode 100644 index 0000000..4c3ed3d --- /dev/null +++ b/src/sourceSnippets/others.ts @@ -0,0 +1,509 @@ +import { SnippetPlaceholders, SnippetMapping } from "../types"; + +type OthersMapping = { + commentBigBlock: "cmmb"; + anonymousFunction: "anfn"; + bindThis: "bnd"; + classConstructor: "rconst"; + componentDidMount: "cdm"; + componentDidUpdate: "cdup"; + componentProps: "props"; + componentSetStateFunc: "ssf"; + componentSetStateObject: "sst"; + componentState: "state"; + componentWillUnmount: "cwun"; + createContext: "rcontext"; + createRef: "cref"; + destructProps: "cp"; + destructState: "cs"; + destructingArray: "dar"; + destructingObject: "dob"; + emptyState: "est"; + exportAs: "exa"; + exportDefault: "exp"; + exportDefaultFunction: "edf"; + exportDefaultNamedFunction: "ednf"; + exportDestructing: "exd"; + exportNamedFunction: "enf"; + forEach: "fre"; + forIn: "fin"; + forOf: "fof"; + getDerivedStateFromProps: "gdsfp"; + getSnapshotBeforeUpdate: "gsbu"; + hocComponent: "hoc"; + hocComponentWithRedux: "hocredux"; + method: "met"; + namedFunction: "nfn"; + promise: "prom"; + propertyGet: "pge"; + propertySet: "pse"; + setInterval: "sti"; + setTimeOut: "sto"; + shouldComponentUpdate: "scu"; + typeofSnippet: "tpf"; +}; + +export type OthersSnippet = SnippetMapping; + +const exportDefault: OthersSnippet = { + key: "exportDefault", + prefix: "exp", + body: [`export default ${SnippetPlaceholders.LastTab}`, ""], +}; + +const exportDestructing: OthersSnippet = { + key: "exportDestructing", + prefix: "exd", + body: [ + `export { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, + "", + ], +}; + +const exportAs: OthersSnippet = { + key: "exportAs", + prefix: "exa", + body: [ + `export { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, + "", + ], +}; + +const exportNamedFunction: OthersSnippet = { + key: "exportNamedFunction", + prefix: "enf", + body: [ + `export const ${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {${SnippetPlaceholders.LastTab}}`, + "", + ], + description: "Export named function", +}; + +const exportDefaultFunction: OthersSnippet = { + key: "exportDefaultFunction", + prefix: "edf", + body: [ + `export default (${SnippetPlaceholders.FirstTab}) => {${SnippetPlaceholders.LastTab}}`, + "", + ], + description: "Export default function", +}; + +const exportDefaultNamedFunction: OthersSnippet = { + key: "exportDefaultNamedFunction", + prefix: "ednf", + body: [ + `export default function ${SnippetPlaceholders.FirstTab}(${SnippetPlaceholders.SecondTab}) {${SnippetPlaceholders.LastTab}}`, + "", + ], + description: "Export default named function", +}; + +const method: OthersSnippet = { + key: "method", + prefix: "met", + body: [ + `${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {${SnippetPlaceholders.LastTab}}`, + "", + ], + description: "Creates a method inside a class", +}; + +const propertyGet: OthersSnippet = { + key: "propertyGet", + prefix: "pge", + body: [ + `get ${SnippetPlaceholders.FirstTab}() {`, + ` return this.${SnippetPlaceholders.LastTab}`, + "}", + "", + ], + description: "Creates a getter property inside a class", +}; + +const propertySet: OthersSnippet = { + key: "propertySet", + prefix: "pse", + body: [ + `set ${SnippetPlaceholders.FirstTab}(${SnippetPlaceholders.SecondTab}) {${SnippetPlaceholders.LastTab}}`, + "", + ], + description: "Creates a setter property inside a class", +}; + +const forEach: OthersSnippet = { + key: "forEach", + prefix: "fre", + body: [ + `${SnippetPlaceholders.FirstTab}.forEach(${SnippetPlaceholders.SecondTab} => {`, + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], + description: "Creates a forEach statement", +}; + +const forOf: OthersSnippet = { + key: "forOf", + prefix: "fof", + body: [ + `for(let ${SnippetPlaceholders.FirstTab} of ${SnippetPlaceholders.SecondTab}) {`, + ` ${SnippetPlaceholders.LastTab}`, + "}", + "", + ], + description: "Iterating over property names of iterable objects", +}; + +const forIn: OthersSnippet = { + key: "forIn", + prefix: "fin", + body: [ + `for(let ${SnippetPlaceholders.FirstTab} in ${SnippetPlaceholders.SecondTab}) {`, + ` ${SnippetPlaceholders.LastTab}`, + "}", + "", + ], + description: "Iterating over property values of iterable objects", +}; + +const anonymousFunction: OthersSnippet = { + key: "anonymousFunction", + prefix: "anfn", + body: [ + `(${SnippetPlaceholders.FirstTab}) => {`, + ` ${SnippetPlaceholders.SecondTab}`, + "}", + ], + description: "Creates an anonymous function", +}; + +const namedFunction: OthersSnippet = { + key: "namedFunction", + prefix: "nfn", + body: [ + `const ${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {`, + ` ${SnippetPlaceholders.ThirdTab}`, + "}", + "", + ], + description: "Creates a named function", +}; + +const destructingObject: OthersSnippet = { + key: "destructingObject", + prefix: "dob", + body: [ + `const {${SnippetPlaceholders.SecondTab}} = ${SnippetPlaceholders.FirstTab}`, + "", + ], + description: "Creates and assigns a local variable using object destructing", +}; + +const destructingArray: OthersSnippet = { + key: "destructingArray", + prefix: "dar", + body: [ + `const [${SnippetPlaceholders.SecondTab}] = ${SnippetPlaceholders.FirstTab}`, + "", + ], + description: "Creates and assigns a local variable using array destructing", +}; + +const setInterval: OthersSnippet = { + key: "setInterval", + prefix: "sti", + body: [ + "setInterval(() => {", + ` ${SnippetPlaceholders.SecondTab}`, + `}, ${SnippetPlaceholders.LastTab})`, + "", + ], + description: "Executes the given function at specified intervals", +}; + +const setTimeOut: OthersSnippet = { + key: "setTimeOut", + prefix: "sto", + body: [ + "setTimeout(() => {", + ` ${SnippetPlaceholders.SecondTab}`, + `}, ${SnippetPlaceholders.FirstTab})`, + "", + ], + description: "Executes the given function after the specified delay", +}; + +const promise: OthersSnippet = { + key: "promise", + prefix: "prom", + body: [ + "return new Promise((resolve, reject) => {", + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], + description: "Creates and returns a new Promise in the standard ES7 syntax", +}; + +const destructProps: OthersSnippet = { + key: "destructProps", + prefix: "cp", + body: [`const { ${SnippetPlaceholders.LastTab} } = this.props`, ""], + description: "Creates and assigns a local variable using props destructing", +}; + +const destructState: OthersSnippet = { + key: "destructState", + prefix: "cs", + body: [`const { ${SnippetPlaceholders.LastTab} } = this.state`, ""], + description: "Creates and assigns a local variable using state destructing", +}; + +const classConstructor: OthersSnippet = { + key: "classConstructor", + prefix: "rconst", + body: [ + "constructor(props) {", + " super(props)", + "", + " this.state = {", + ` ${SnippetPlaceholders.LastTab}`, + " }", + "}", + "", + ], + description: + "Adds a default constructor for it('', () => {})the class that contains props as arguments", +}; + +const emptyState: OthersSnippet = { + key: "emptyState", + prefix: "est", + body: ["state = {", ` ${SnippetPlaceholders.LastTab}`, "}", ""], + description: "Creates empty state object. To be used in a constructor.", +}; + +const componentDidMount: OthersSnippet = { + key: "componentDidMount", + prefix: "cdm", + body: ["componentDidMount() {", ` ${SnippetPlaceholders.LastTab}`, "}", ""], + description: + "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", +}; + +const shouldComponentUpdate: OthersSnippet = { + key: "shouldComponentUpdate", + prefix: "scu", + body: [ + "shouldComponentUpdate(nextProps, nextState) {", + ` ${SnippetPlaceholders.LastTab}`, + "}", + "", + ], + description: + "Invoked before rendering when new props or state are being received. ", +}; + +const componentDidUpdate: OthersSnippet = { + key: "componentDidUpdate", + prefix: "cdup", + body: [ + "componentDidUpdate(prevProps, prevState) {", + ` ${SnippetPlaceholders.LastTab}`, + "}", + "", + ], + description: + "Invoked immediately after the component's updates are flushed to the DOM.", +}; + +const componentWillUnmount: OthersSnippet = { + key: "componentWillUnmount", + prefix: "cwun", + body: [ + "componentWillUnmount() {", + ` ${SnippetPlaceholders.LastTab}`, + "}", + "", + ], + description: + "Invoked immediately before a component is unmounted from the DOM.", +}; + +const getDerivedStateFromProps: OthersSnippet = { + key: "getDerivedStateFromProps", + prefix: "gdsfp", + body: [ + "static getDerivedStateFromProps(props, state) {", + ` ${SnippetPlaceholders.LastTab}`, + "}", + ], + description: + "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", +}; + +const getSnapshotBeforeUpdate: OthersSnippet = { + key: "getSnapshotBeforeUpdate", + prefix: "gsbu", + body: [ + "getSnapshotBeforeUpdate = (prevProps, prevState) => {", + ` ${SnippetPlaceholders.LastTab}`, + "}", + "", + ], + description: + "Called right before mutations are made (e.g. before the DOM is updated)", +}; + +const createContext: OthersSnippet = { + key: "createContext", + prefix: "rcontext", + body: [`const ${SnippetPlaceholders.LastTab} = React.createContext()`, ""], + description: "Create React context", +}; + +const createRef: OthersSnippet = { + key: "createRef", + prefix: "cref", + body: [`this.${SnippetPlaceholders.LastTab}Ref = React.createRef()`, ""], + description: "Create ref statement used inside constructor", +}; + +const componentSetStateObject: OthersSnippet = { + key: "componentSetStateObject", + prefix: "sst", + body: [`this.setState({${SnippetPlaceholders.LastTab}})`, ""], + description: "Performs a shallow merge of nextState into current state", +}; + +const componentSetStateFunc: OthersSnippet = { + key: "componentSetStateFunc", + prefix: "ssf", + body: [ + `this.setState((state, props) => { return { ${SnippetPlaceholders.LastTab} }})`, + "", + ], + description: "Performs a shallow merge of nextState into current state", +}; + +const componentProps: OthersSnippet = { + key: "componentProps", + prefix: "props", + body: [`this.props.${SnippetPlaceholders.LastTab}`, ""], + description: "Access component's props", +}; + +const componentState: OthersSnippet = { + key: "componentState", + prefix: "state", + body: [`this.state.${SnippetPlaceholders.LastTab}`, ""], +}; + +const bindThis: OthersSnippet = { + key: "bindThis", + prefix: "bnd", + body: [ + `this.${SnippetPlaceholders.FirstTab} = this.${SnippetPlaceholders.FirstTab}.bind(this)${SnippetPlaceholders.LastTab}`, + "", + ], + description: "Binds this to a method", +}; + +const commentBigBlock: OthersSnippet = { + key: "commentBigBlock", + prefix: "cmmb", + body: ["/**", ` * ${SnippetPlaceholders.LastTab}`, " */"], +}; + +const hocComponentWithRedux: OthersSnippet = { + key: "hocComponentWithRedux", + prefix: "hocredux", + body: [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "import PropTypes from 'prop-types'", + "", + "export const mapStateToProps = state => ({})", + "", + "export const mapDispatchToProps = {}", + "", + `export const ${SnippetPlaceholders.FirstTab} = (WrappedComponent) => {`, + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "", + `export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FirstTab}(WrapperComponent))`, + "", + ], +}; + +const hocComponent: OthersSnippet = { + key: "hocComponent", + prefix: "hoc", + body: [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "export default (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "", + ], +}; + +const typeofSnippet: OthersSnippet = { + key: "typeofSnippet", + prefix: "tpf", + body: [`typeof ${SnippetPlaceholders.LastTab}`], +}; + +export default [ + exportDefault, + exportDestructing, + exportAs, + exportNamedFunction, + exportDefaultFunction, + exportDefaultNamedFunction, + method, + propertyGet, + propertySet, + forEach, + forOf, + forIn, + anonymousFunction, + namedFunction, + destructingObject, + destructingArray, + setInterval, + setTimeOut, + promise, + destructProps, + destructState, + classConstructor, + emptyState, + componentDidMount, + shouldComponentUpdate, + componentDidUpdate, + componentWillUnmount, + getDerivedStateFromProps, + getSnapshotBeforeUpdate, + createContext, + createRef, + componentSetStateObject, + componentSetStateFunc, + componentProps, + componentState, + bindThis, + commentBigBlock, + hocComponentWithRedux, + hocComponent, + typeofSnippet, +]; diff --git a/src/sourceSnippets/propTypes.ts b/src/sourceSnippets/propTypes.ts new file mode 100644 index 0000000..c6d0b03 --- /dev/null +++ b/src/sourceSnippets/propTypes.ts @@ -0,0 +1,291 @@ +import { SnippetMapping } from "../types"; + +type PropTypesMapping = { + propTypeAny: "ptany"; + propTypeArray: "pta"; + propTypeArrayOf: "ptao"; + propTypeArrayOfRequired: "ptaor"; + propTypeArrayRequired: "ptar"; + propTypeBool: "ptb"; + propTypeBoolRequired: "ptbr"; + propTypeElement: "ptel"; + propTypeElementRequired: "ptelr"; + propTypeEnum: "pte"; + propTypeEnumRequired: "pter"; + propTypeExact: "ptex"; + propTypeExactRequired: "ptexr"; + propTypeFunc: "ptf"; + propTypeFuncRequired: "ptfr"; + propTypeInstanceOf: "pti"; + propTypeInstanceOfRequired: "ptir"; + propTypeNode: "ptnd"; + propTypeNodeRequired: "ptndr"; + propTypeNumber: "ptn"; + propTypeNumberRequired: "ptnr"; + propTypeObject: "pto"; + propTypeObjectOf: "ptoo"; + propTypeObjectOfRequired: "ptoor"; + propTypeObjectRequired: "ptor"; + propTypeOneOfType: "ptet"; + propTypeOneOfTypeRequired: "ptetr"; + propTypeShape: "ptsh"; + propTypeShapeRequired: "ptshr"; + propTypeString: "pts"; + propTypeStringRequired: "ptsr"; +}; + +export type PropTypesSnippet = SnippetMapping; + +const propTypeArray: PropTypesSnippet = { + key: "propTypeArray", + prefix: "pta", + body: ["PropTypes.array,"], + description: "Array prop type", +}; + +const propTypeArrayRequired: PropTypesSnippet = { + key: "propTypeArrayRequired", + prefix: "ptar", + body: ["PropTypes.array.isRequired,"], + description: "Array prop type required", +}; + +const propTypeBool: PropTypesSnippet = { + key: "propTypeBool", + prefix: "ptb", + body: ["PropTypes.bool,"], + description: "Bool prop type", +}; + +const propTypeBoolRequired: PropTypesSnippet = { + key: "propTypeBoolRequired", + prefix: "ptbr", + body: ["PropTypes.bool.isRequired,"], + description: "Bool prop type required", +}; + +const propTypeFunc: PropTypesSnippet = { + key: "propTypeFunc", + prefix: "ptf", + body: ["PropTypes.func,"], + description: "Func prop type", +}; + +const propTypeFuncRequired: PropTypesSnippet = { + key: "propTypeFuncRequired", + prefix: "ptfr", + body: ["PropTypes.func.isRequired,"], + description: "Func prop type required", +}; + +const propTypeNumber: PropTypesSnippet = { + key: "propTypeNumber", + prefix: "ptn", + body: ["PropTypes.number,"], + description: "Number prop type", +}; + +const propTypeNumberRequired: PropTypesSnippet = { + key: "propTypeNumberRequired", + prefix: "ptnr", + body: ["PropTypes.number.isRequired,"], + description: "Number prop type required", +}; + +const propTypeObject: PropTypesSnippet = { + key: "propTypeObject", + prefix: "pto", + body: ["PropTypes.object,"], + description: "Object prop type", +}; + +const propTypeObjectRequired: PropTypesSnippet = { + key: "propTypeObjectRequired", + prefix: "ptor", + body: ["PropTypes.object.isRequired,"], + description: "Object prop type required", +}; + +const propTypeString: PropTypesSnippet = { + key: "propTypeString", + prefix: "pts", + body: ["PropTypes.string,"], + description: "String prop type", +}; + +const propTypeStringRequired: PropTypesSnippet = { + key: "propTypeStringRequired", + prefix: "ptsr", + body: ["PropTypes.string.isRequired,"], + description: "String prop type required", +}; + +const propTypeNode: PropTypesSnippet = { + key: "propTypeNode", + prefix: "ptnd", + body: ["PropTypes.node,"], + description: + "Anything that can be rendered: numbers, strings, elements or an array", +}; + +const propTypeNodeRequired: PropTypesSnippet = { + key: "propTypeNodeRequired", + prefix: "ptndr", + body: ["PropTypes.node.isRequired,"], + description: + "Anything that can be rendered: numbers, strings, elements or an array required", +}; + +const propTypeElement: PropTypesSnippet = { + key: "propTypeElement", + prefix: "ptel", + body: ["PropTypes.element,"], + description: "React element prop type", +}; + +const propTypeElementRequired: PropTypesSnippet = { + key: "propTypeElementRequired", + prefix: "ptelr", + body: ["PropTypes.element.isRequired,"], + description: "React element prop type required", +}; + +const propTypeInstanceOf: PropTypesSnippet = { + key: "propTypeInstanceOf", + prefix: "pti", + body: ["PropTypes.instanceOf($0),"], + description: "Is an instance of a class prop type", +}; + +const propTypeInstanceOfRequired: PropTypesSnippet = { + key: "propTypeInstanceOfRequired", + prefix: "ptir", + body: ["PropTypes.instanceOf($0).isRequired,"], + description: "Is an instance of a class prop type required", +}; + +const propTypeEnum: PropTypesSnippet = { + key: "propTypeEnum", + prefix: "pte", + body: ["PropTypes.oneOf(['$0']),"], + description: "Prop type limited to specific values by treating it as an enum", +}; + +const propTypeEnumRequired: PropTypesSnippet = { + key: "propTypeEnumRequired", + prefix: "pter", + body: ["PropTypes.oneOf(['$0']).isRequired,"], + description: + "Prop type limited to specific values by treating it as an enum required", +}; + +const propTypeOneOfType: PropTypesSnippet = { + key: "propTypeOneOfType", + prefix: "ptet", + body: ["PropTypes.oneOfType([", " $0", "]),"], + description: "An object that could be one of many types", +}; + +const propTypeOneOfTypeRequired: PropTypesSnippet = { + key: "propTypeOneOfTypeRequired", + prefix: "ptetr", + body: ["PropTypes.oneOfType([", " $0", "]).isRequired,"], + description: "An object that could be one of many types required", +}; + +const propTypeArrayOf: PropTypesSnippet = { + key: "propTypeArrayOf", + prefix: "ptao", + body: ["PropTypes.arrayOf($0),"], + description: "An array of a certain type", +}; + +const propTypeArrayOfRequired: PropTypesSnippet = { + key: "propTypeArrayOfRequired", + prefix: "ptaor", + body: ["PropTypes.arrayOf($0).isRequired,"], + description: "An array of a certain type required", +}; + +const propTypeObjectOf: PropTypesSnippet = { + key: "propTypeObjectOf", + prefix: "ptoo", + body: ["PropTypes.objectOf($0),"], + description: "An object with property values of a certain type", +}; + +const propTypeObjectOfRequired: PropTypesSnippet = { + key: "propTypeObjectOfRequired", + prefix: "ptoor", + body: ["PropTypes.objectOf($0).isRequired,"], + description: "An object with property values of a certain type required", +}; + +const propTypeShape: PropTypesSnippet = { + key: "propTypeShape", + prefix: "ptsh", + body: ["PropTypes.shape({", " $0", "}),"], + description: "An object taking on a particular shape", +}; + +const propTypeShapeRequired: PropTypesSnippet = { + key: "propTypeShapeRequired", + prefix: "ptshr", + body: ["PropTypes.shape({", " $0", "}).isRequired,"], + description: "An object taking on a particular shape required", +}; + +const propTypeExact: PropTypesSnippet = { + key: "propTypeExact", + prefix: "ptex", + body: ["PropTypes.exact({", " $0", "}),"], + description: "An object with warnings on extra properties", +}; + +const propTypeExactRequired: PropTypesSnippet = { + key: "propTypeExactRequired", + prefix: "ptexr", + body: ["PropTypes.exact({", " $0", "}).isRequired,"], + description: "An object with warnings on extra properties required", +}; + +const propTypeAny: PropTypesSnippet = { + key: "propTypeAny", + prefix: "ptany", + body: ["PropTypes.any,"], + description: "Any prop type", +}; + +export default [ + propTypeArray, + propTypeArrayRequired, + propTypeBool, + propTypeBoolRequired, + propTypeFunc, + propTypeFuncRequired, + propTypeNumber, + propTypeNumberRequired, + propTypeObject, + propTypeObjectRequired, + propTypeString, + propTypeStringRequired, + propTypeNode, + propTypeNodeRequired, + propTypeElement, + propTypeElementRequired, + propTypeInstanceOf, + propTypeInstanceOfRequired, + propTypeEnum, + propTypeEnumRequired, + propTypeOneOfType, + propTypeOneOfTypeRequired, + propTypeArrayOf, + propTypeArrayOfRequired, + propTypeObjectOf, + propTypeObjectOfRequired, + propTypeShape, + propTypeShapeRequired, + propTypeExact, + propTypeExactRequired, + propTypeAny, +]; diff --git a/src/sourceSnippets/reactNative.ts b/src/sourceSnippets/reactNative.ts new file mode 100644 index 0000000..3fdf52c --- /dev/null +++ b/src/sourceSnippets/reactNative.ts @@ -0,0 +1,194 @@ +import { + reactPureComponent, + reactComponent, + react, + exportDefault, +} from "./sharedSnippets"; +import { SnippetMapping, SnippetPlaceholders } from "../types"; + +type ReactNativeMapping = { + reactNativeImport: "imrn"; + reactNativeStyles: "rnstyle"; + reactNativeComponent: "rnc"; + reactNativeComponentWithStyles: "rncs"; + reactNativeComponentExport: "rnce"; + reactNativePureComponent: "rnpc"; + reactNativePureComponentExport: "rnpce"; + reactNativeFunctionalExportComponent: "rnfe"; + reactNativeFunctionalExportComponentWithStyles: "rnfes"; + reactNativeFunctionalComponent: "rnf"; + reactNativeFunctionalComponentWithStyles: "rnfs"; +}; + +export type ReactNativeSnippet = SnippetMapping; + +const reactNativeStylesSnippet = ["const styles = StyleSheet.create({})", ""]; +const reactNativeComponentReturn = [ + " render() {", + " return (", + " ", + ` ${SnippetPlaceholders.LastTab}`, + " ", + " )", + " }", +]; + +const reactNativeReturn = [ + " return (", + " ", + " $0", + " ", + " )", +]; + +const reactNativeImport: ReactNativeSnippet = { + key: "reactNativeImport", + prefix: "imrn", + body: [`import { ${SnippetPlaceholders.LastTab} } from 'react-native'`, ""], +}; + +const reactNativeStyles: ReactNativeSnippet = { + key: "reactNativeStyles", + prefix: "rnstyle", + body: [ + "const styles = StyleSheet.create({", + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], +}; + +const reactNativeComponent: ReactNativeSnippet = { + key: "reactNativeComponent", + prefix: "rnc", + body: [ + "import { Text, View } from 'react-native'", + ...reactComponent, + `export default class ${SnippetPlaceholders.FileName} extends Component {`, + ...reactNativeComponentReturn, + "}", + "", + ], +}; + +const reactNativeComponentWithStyles: ReactNativeSnippet = { + key: "reactNativeComponentWithStyles", + prefix: "rncs", + body: [ + "import { Text, StyleSheet, View } from 'react-native'", + ...reactComponent, + `export default class ${SnippetPlaceholders.FileName} extends Component {`, + ...reactNativeComponentReturn, + "}", + "", + ...reactNativeStylesSnippet, + ], +}; + +const reactNativeComponentExport: ReactNativeSnippet = { + key: "reactNativeComponentExport", + prefix: "rnce", + body: [ + "import { Text, View } from 'react-native'", + ...reactComponent, + `export class ${SnippetPlaceholders.FileName} extends Component {`, + ...reactNativeComponentReturn, + "}", + ...exportDefault, + ], +}; + +const reactNativePureComponent: ReactNativeSnippet = { + key: "reactNativePureComponent", + prefix: "rnpc", + body: [ + "import { Text, View } from 'react-native'", + ...reactPureComponent, + `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + ...reactNativeComponentReturn, + "}", + "", + ], +}; + +const reactNativePureComponentExport: ReactNativeSnippet = { + key: "reactNativePureComponentExport", + prefix: "rnpce", + body: [ + "import { Text, View } from 'react-native'", + ...reactPureComponent, + `export class ${SnippetPlaceholders.FileName} extends PureComponent {`, + ...reactNativeComponentReturn, + "}", + ...exportDefault, + ], +}; + +const reactNativeFunctionalExportComponent: ReactNativeSnippet = { + key: "reactNativeFunctionalExportComponent", + prefix: "rnfe", + body: [ + "import { View, Text } from 'react-native'", + ...react, + `const ${SnippetPlaceholders.FileName} = () => {`, + ...reactNativeReturn, + "}", + ...exportDefault, + ], +}; + +const reactNativeFunctionalExportComponentWithStyles: ReactNativeSnippet = { + key: "reactNativeFunctionalExportComponentWithStyles", + prefix: "rnfes", + body: [ + "import { StyleSheet, Text, View } from 'react-native'", + ...react, + `const ${SnippetPlaceholders.FileName} = () => {`, + ...reactNativeReturn, + "}", + ...exportDefault, + "", + ...reactNativeStylesSnippet, + ], +}; + +const reactNativeFunctionalComponent: ReactNativeSnippet = { + key: "reactNativeFunctionalComponent", + prefix: "rnf", + body: [ + "import { View, Text } from 'react-native'", + ...react, + `export default function ${SnippetPlaceholders.FileName}() {`, + ...reactNativeReturn, + "}", + "", + ], +}; + +const reactNativeFunctionalComponentWithStyles: ReactNativeSnippet = { + key: "reactNativeFunctionalComponentWithStyles", + prefix: "rnfs", + body: [ + "import { StyleSheet, Text, View } from 'react-native'", + ...react, + `export default function ${SnippetPlaceholders.FileName}() {`, + ...reactNativeReturn, + "}", + "", + ...reactNativeStylesSnippet, + ], +}; + +export default [ + reactNativeComponent, + reactNativeComponentExport, + reactNativeComponentWithStyles, + reactNativeFunctionalComponent, + reactNativeFunctionalComponentWithStyles, + reactNativeFunctionalExportComponent, + reactNativeFunctionalExportComponentWithStyles, + reactNativeImport, + reactNativePureComponent, + reactNativePureComponentExport, + reactNativeStyles, +]; diff --git a/src/sourceSnippets/redux.ts b/src/sourceSnippets/redux.ts new file mode 100644 index 0000000..21dd4e5 --- /dev/null +++ b/src/sourceSnippets/redux.ts @@ -0,0 +1,116 @@ +import { SnippetMapping } from "../types"; + +type HookMappings = { + importReduxConnect: "redux"; + reduxAction: "rxaction"; + reduxConst: "rxconst"; + reduxReducer: "rxreducer"; + reduxSelector: "rxselect"; + reduxSlice: "rxslice"; + mappingToProps: "reduxmap"; +}; + +export type ReduxSnippet = SnippetMapping; + +const importReduxConnect: ReduxSnippet = { + key: "importReduxConnect", + prefix: "redux", + body: ["import { connect } from 'react-redux'", ""], +}; + +const reduxAction: ReduxSnippet = { + key: "reduxAction", + prefix: "rxaction", + body: [ + "export const ${1:actionName} = (payload) => ({", + " type: ${3:type},", + " payload", + "})", + "", + ], +}; + +const reduxConst: ReduxSnippet = { + key: "reduxConst", + prefix: "rxconst", + body: ["export const ${1:constantName} = '${1:constantName}'"], +}; + +const reduxReducer: ReduxSnippet = { + key: "reduxReducer", + prefix: "rxreducer", + body: [ + "const initialState = {", + "", + "}", + "", + "export default (state = initialState, { type, payload }) => {", + " switch (type) {", + "", + " case ${1:typeName}:", + " return { ...state, ...payload }", + "", + " default:", + " return state", + " }", + "}", + "", + ], +}; + +const reduxSelector: ReduxSnippet = { + key: "reduxSelector", + prefix: "rxselect", + body: [ + "import { createSelector } from 'reselect'", + "", + "export const ${1:selectorName} = state => state.${2:selector}", + "", + ], +}; + +const reduxSlice: ReduxSnippet = { + key: "reduxSlice", + prefix: "rxslice", + body: [ + "import { createSlice } from '@reduxjs/toolkit'", + "", + "const initialState = {", + "", + "}", + "", + "const ${1:${TM_FILENAME_BASE}} = createSlice({", + " name: ${2:sliceName},", + " initialState,", + " reducers: {", + " ", + " }", + "});", + "", + "export const {", + "", + "} = ${1:${TM_FILENAME_BASE}}.actions", + "export default ${1:${TM_FILENAME_BASE}}.reducer", + ], +}; + +const mappingToProps: ReduxSnippet = { + key: "mappingToProps", + prefix: "reduxmap", + body: [ + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + ], +}; + +export default [ + importReduxConnect, + reduxAction, + reduxConst, + reduxReducer, + reduxSelector, + reduxSlice, + mappingToProps, +]; diff --git a/src/sourceSnippets/sharedSnippets.ts b/src/sourceSnippets/sharedSnippets.ts new file mode 100644 index 0000000..5c861bf --- /dev/null +++ b/src/sourceSnippets/sharedSnippets.ts @@ -0,0 +1,75 @@ +import { SnippetPlaceholders } from "../types"; + +export const reactComponent = ["import React, { Component } from 'react'", ""]; +export const react = ["import React from 'react'", ""]; +export const reactPureComponent = [ + "import React, { PureComponent } from 'react'", + "", +]; +export const reactPropTypes = [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", +]; + +export const reactWithReduxConnect = [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "", +]; + +export const reactComponentWithReduxConnect = [ + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", +]; + +export const reactWithMemo = ["import React, { memo } from 'react'", ""]; + +export const reduxComponentExport = [ + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + `export default connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FileName})`, + "", +]; + +export const innerComponent = [ + " return (", + "
", + ` ${SnippetPlaceholders.LastTab}`, + "
", + " )", +]; + +export const innerComponentReturn = [ + " render() {", + " return (", + "
", + ` ${SnippetPlaceholders.LastTab}`, + "
", + " )", + " }", +]; + +export const exportDefault = [ + "", + `export default ${SnippetPlaceholders.FileName}`, + "", +]; + +export const propsTypeInterface = [ + `${SnippetPlaceholders.TypeInterface} Props {}`, + "", +]; +export const stateTypeInterface = [ + `${SnippetPlaceholders.TypeInterface} State {}`, + "", +]; +export const propsStateInterface = [ + ...propsTypeInterface, + ...stateTypeInterface, + "", +]; diff --git a/src/sourceSnippets/tests.ts b/src/sourceSnippets/tests.ts new file mode 100644 index 0000000..76f5a01 --- /dev/null +++ b/src/sourceSnippets/tests.ts @@ -0,0 +1,178 @@ +import { SnippetMapping, SnippetPlaceholders } from "../types"; + +type TestMapping = { + describeBlock: "desc"; + itAsyncBlock: "tita"; + itBlock: "tit"; + setupReactComponentTestWithRedux: "srtest"; + setupReactNativeTest: "sntest"; + setupReactNativeTestWithRedux: "snrtest"; + setupReactTest: "stest"; + testAsyncBlock: "testa"; + testBlock: "test"; +}; + +export type TestsSnippet = SnippetMapping; + +const describeBlock: TestsSnippet = { + key: "describeBlock", + prefix: "desc", + body: [ + `describe('${SnippetPlaceholders.FirstTab}', () => {`, + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], + description: "Testing `describe` block", +}; +const testBlock: TestsSnippet = { + key: "testBlock", + prefix: "test", + body: [ + `test('should ${SnippetPlaceholders.FirstTab}', () => {`, + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], + description: "Testing `test` block", +}; +const testAsyncBlock: TestsSnippet = { + key: "testAsyncBlock", + prefix: "testa", + body: [ + `test('should ${SnippetPlaceholders.FirstTab}', async () => {`, + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], + description: "Testing `asynchronous test` block", +}; +const itBlock: TestsSnippet = { + key: "itBlock", + prefix: "tit", + body: [ + `it('should ${SnippetPlaceholders.FirstTab}', () => {`, + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], + description: "Testing `it` block", +}; +const itAsyncBlock: TestsSnippet = { + key: "itAsyncBlock", + prefix: "tita", + body: [ + `it('should ${SnippetPlaceholders.FirstTab}', async () => {`, + ` ${SnippetPlaceholders.LastTab}`, + "})", + "", + ], + description: "Testing asynchronous `it` block", +}; +const setupReactTest: TestsSnippet = { + key: "setupReactTest", + prefix: "stest", + body: [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + `import { ${SnippetPlaceholders.FileName} } from '../${SnippetPlaceholders.FileName}'`, + "", + `describe('<${SnippetPlaceholders.FileName} />', () => {`, + " const defaultProps = {}", + ` const wrapper = renderer.create(<${SnippetPlaceholders.FileName} {...defaultProps} />)`, + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})", + "", + ], +}; +const setupReactNativeTest: TestsSnippet = { + key: "setupReactNativeTest", + prefix: "sntest", + body: [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + `import ${SnippetPlaceholders.FileName} from '../${SnippetPlaceholders.FileName}'`, + "", + `describe('<${SnippetPlaceholders.FileName} />', () => {`, + " const defaultProps = {}", + ` const wrapper = renderer.create(<${SnippetPlaceholders.FileName} {...defaultProps} />)`, + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})", + "", + ], +}; +const setupReactComponentTestWithRedux: TestsSnippet = { + key: "setupReactComponentTestWithRedux", + prefix: "srtest", + body: [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + `import { ${SnippetPlaceholders.FileName} } from '../${SnippetPlaceholders.FileName}'`, + "", + `describe('<${SnippetPlaceholders.FileName} />', () => {`, + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + ` <${SnippetPlaceholders.FileName} {...defaultProps} />`, + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})", + "", + ], + description: "Create test component", +}; +const setupReactNativeTestWithRedux: TestsSnippet = { + key: "setupReactNativeTestWithRedux", + prefix: "snrtest", + body: [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + `import ${SnippetPlaceholders.FileName} from '../${SnippetPlaceholders.FileName}'`, + "", + `describe('<${SnippetPlaceholders.FileName} />', () => {`, + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + ` <${SnippetPlaceholders.FileName} {...defaultProps} />`, + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})", + "", + ], +}; + +export default [ + describeBlock, + itAsyncBlock, + itBlock, + setupReactComponentTestWithRedux, + setupReactNativeTest, + setupReactNativeTestWithRedux, + setupReactTest, + testAsyncBlock, + testBlock, +]; diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts index 7a0c3bd..fe85e2d 100644 --- a/src/sourceSnippets/typescript.ts +++ b/src/sourceSnippets/typescript.ts @@ -1,323 +1,272 @@ -// import { SnippetPlaceholders, TypescriptSnippets } from "../types"; +import { + exportDefault, + innerComponent, + innerComponentReturn, + propsStateInterface, + propsTypeInterface, + react, + reactComponent, + reactPureComponent, + reduxComponentExport, +} from "./sharedSnippets"; +import { SnippetPlaceholders, SnippetMapping } from "../types"; -// const props = [`${SnippetPlaceholders.TypeInterface} Props {}`, ""]; +type TypescriptMappings = { + exportInterface: "expint"; + exportType: "exptp"; + typescriptReactArrowFunctionComponent: "tsrafc"; + typescriptReactArrowFunctionExportComponent: "tsrafce"; + typescriptReactClassComponent: "tsrcc"; + typescriptReactClassComponentRedux: "tsrcredux"; + typescriptReactClassExportComponent: "tsrce"; + typescriptReactClassExportPureComponent: "tsrpce"; + typescriptReactClassPureComponent: "tsrpc"; + typescriptReactFunctionMemoComponent: "tsrmc"; + typescriptReactFunctionalComponent: "tsrfc"; + typescriptReactFunctionalExportComponent: "tsrfce"; + typescriptReactNativeArrowFunctionComponent: "tsrnf"; + typescriptReactNativeArrowFunctionComponentNamedProps: "tsrnfi"; + typescriptReactNativeArrowFunctionComponentWithStyles: "tsrnfs"; +}; -// export const propsInterface = [...props, `${SnippetPlaceholders.TypeInterface} State {}`, ""]; +export type TypescriptSnippet = SnippetMapping; -// export const typescriptReactClassComponent: TypescriptSnippets = { -// key: "typescriptReactClassComponent", -// prefix: "tsrcc", -// description: "Creates a React component class with ES7 module system and TypeScript interfaces", -// body: [ -// "import React, { Component } from 'react'", -// "", -// ...propsInterface, -// `export default class ${SnippetPlaceholders.FileName} extends Component {`, -// " state = {}", -// "", -// " render() {", -// " return (", -// "
", -// ` ${SnippetPlaceholders.LastTab}`, -// "
", -// " )", -// " }", -// "}", -// "", -// ], -// }; +const exportType: TypescriptSnippet = { + body: [ + `export type ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, + ], + key: "exportType", + prefix: "exptp", +}; -// export const typescriptReactClassExportComponent = { -// prefix: "tsrce", -// body: [ -// "import React, { Component } from 'react'", -// "", -// ...propsInterface, -// `class ${SnippetPlaceholders.FileName} extends Component {`, -// " state = {}", -// "", -// " render() {", -// " return (", -// "
", -// " ${SnippetPlaceholders.LastTab}", -// "
", -// " )", -// " }",w -// "}", -// "", -// "export default ${SnippetPlaceholders.FileName}", -// "",q -// ], -// description: "Creates a React component class with ES7 module system and TypeScript interfaces", -// }; -// // "typescriptReactFunctionalExportComponent": { -// // "prefix": "tsrfce", -// // "body": [ d -// // "import React, { ReactElement } from 'react'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "function ${SnippetPlaceholders.FileName}({}: Props): ReactElement {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // "}", -// // "", -// // "export default ${SnippetPlaceholders.FileName}", -// // "" -// // ], -// // "description": "Creates a React Functional Component with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactFunctionalComponent": { -// // "prefix": "tsrfc", -// // "body": [ -// // "import React, { ReactElement } from 'react'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "export default function ${SnippetPlaceholders.FileName}({}: Props): ReactElement {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // "}", -// // "" -// // ], -// // "description": "Creates a React Functional Component with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactArrowFunctionExportComponent": { -// // "prefix": "tsrafce", -// // "body": [ -// // "import React from 'react'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "const ${SnippetPlaceholders.FileName} = (props: Props) => {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // "}", -// // "", -// // "export default ${SnippetPlaceholders.FileName}", -// // "" -// // ], -// // "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactArrowFunctionComponent": { -// // "prefix": "tsrafc", -// // "body": [ -// // "import React from 'react'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "export const ${SnippetPlaceholders.FileName} = (props: Props) => {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // "}", -// // "" -// // ], -// // "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactClassPureComponent": { -// // "prefix": "tsrpc", -// // "body": [ -// // "import React, { PureComponent } from 'react'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "export default class ${SnippetPlaceholders.FileName} extends PureComponent {", -// // " render() {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // " }", -// // "}", -// // "" -// // ], -// // "description": "Creates a React pure component class with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactClassExportPureComponent": { -// // "prefix": "tsrpce", -// // "body": [ -// // "import React, { PureComponent } from 'react'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "class ${SnippetPlaceholders.FileName} extends PureComponent {", -// // " render() {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // " }", -// // "}", -// // "", -// // "export default ${SnippetPlaceholders.FileName}", -// // "" -// // ], -// // "description": "Creates a React pure component class with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactFunctionMemoComponent": { -// // "prefix": "tsrmc", -// // "body": [ -// // "import React, { memo } from 'react'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "export default memo(function ${SnippetPlaceholders.FileName}({}: Props) {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // "})", -// // "" -// // ], -// // "description": "Creates a React Memo Function Component with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactClassCompomentRedux": { -// // "prefix": "tsrcredux", -// // "body": [ -// // "import React, { Component } from 'react'", -// // "import { connect } from 'react-redux'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "interface State {", -// // " ", -// // "}", -// // "", -// // "export class ${SnippetPlaceholders.FileName} extends Component {", -// // " state = {}", -// // "", -// // " render() {", -// // " return (", -// // "
", -// // " ${SnippetPlaceholders.LastTab}", -// // "
", -// // " )", -// // " }", -// // "}", -// // "", -// // "const mapStateToProps = (state) => ({", -// // " ", -// // "})", -// // "", -// // "const mapDispatchToProps = {", -// // " ", -// // "}", -// // "", -// // "export default connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FileName})", -// // "" -// // ], -// // "description": "Creates a React component class with PropTypes with connected redux and ES7 module system and TypeScript interfaces" -// // }, -// // "typescriptReactNativeArrowFunctionComponent": { -// // "prefix": "tsrnf", -// // "body": [ -// // "import React from 'react'", -// // "import { View, Text } from 'react-native'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "const ${SnippetPlaceholders.FileName} = (props: Props) => {", -// // " return (", -// // " ", -// // " ${SnippetPlaceholders.LastTab}", -// // " ", -// // " )", -// // "}", -// // "", -// // "export default ${SnippetPlaceholders.FileName}", -// // "" -// // ], -// // "description": "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface" -// // }, -// // "typescriptReactNativeArrowFunctionComponentNamedProps": { -// // "prefix": "tsrnfi", -// // "body": [ -// // "import React from 'react'", -// // "import { View } from 'react-native'", -// // "", -// // "interface ${SnippetPlaceholders.FileName}Props {", -// // " ", -// // "}", -// // "", -// // "const ${SnippetPlaceholders.FileName}: React.FC<${SnippetPlaceholders.FileName}Props> = (props) => {", -// // " return (", -// // " ", -// // " ${SnippetPlaceholders.LastTab}", -// // " ", -// // " )", -// // "}", -// // "", -// // "export default ${SnippetPlaceholders.FileName}", -// // "" -// // ], -// // "description": "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface" -// // }, -// // "typescriptReactNativeArrowFunctionComponentWithStyles": { -// // "prefix": "tsrnfs", -// // "body": [ -// // "import React from 'react'", -// // "import { StyleSheet, Text, View } from 'react-native'", -// // "", -// // "interface Props {", -// // " ", -// // "}", -// // "", -// // "const ${SnippetPlaceholders.FileName} = (props: Props) => {", -// // " return (", -// // " ", -// // " ${SnippetPlaceholders.LastTab}", -// // " ", -// // " )", -// // "}", -// // "", -// // "export default ${SnippetPlaceholders.FileName}", -// // "", -// // "const styles = StyleSheet.create({})", -// // "" -// // ], -// // "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet" -// // }, +const exportInterface: TypescriptSnippet = { + key: "exportInterface", + prefix: "expint", + body: [ + `export exportInterface ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, + "", + ], +}; -// export const exportType = { -// prefix: "exptp", -// body: [`export type ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`], -// }; +const typescriptReactClassComponent: TypescriptSnippet = { + key: "typescriptReactClassComponent", + prefix: "tsrcc", + description: + "Creates a React component class with ES7 module system and TypeScript interfaces", + body: [ + ...reactComponent, + ...propsStateInterface, + `export default class ${SnippetPlaceholders.FileName} extends Component {`, + " state = {}", + "", + ...innerComponentReturn, + "}", + "", + ], +}; -// export const exportInterface = { -// prefix: "expint", -// body: [ -// `export exportInterface ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, -// ], -// }; +const typescriptReactClassExportComponent: TypescriptSnippet = { + key: "typescriptReactClassExportComponent", + prefix: "tsrce", + body: [ + ...reactComponent, + ...propsStateInterface, + `class ${SnippetPlaceholders.FileName} extends Component {`, + " state = {}", + "", + ...innerComponentReturn, + "}", + ...exportDefault, + ], + description: + "Creates a React component class with ES7 module system and TypeScript interfaces", +}; + +const typescriptReactFunctionalExportComponent: TypescriptSnippet = { + key: "typescriptReactFunctionalExportComponent", + prefix: "tsrfce", + body: [ + ...react, + ...propsTypeInterface, + `function ${SnippetPlaceholders.FileName}({}: Props) {`, + ...innerComponent, + "}", + ...exportDefault, + ], + description: + "Creates a React Functional Component with ES7 module system and TypeScript interface", +}; + +const typescriptReactFunctionalComponent: TypescriptSnippet = { + key: "typescriptReactFunctionalComponent", + prefix: "tsrfc", + body: [ + ...react, + ...propsTypeInterface, + `export default function ${SnippetPlaceholders.FileName}({}: Props) {`, + ...innerComponent, + "}", + "", + ], + description: + "Creates a React Functional Component with ES7 module system and TypeScript interface", +}; + +const typescriptReactArrowFunctionExportComponent: TypescriptSnippet = { + key: "typescriptReactArrowFunctionExportComponent", + prefix: "tsrafce", + body: [ + ...react, + ...propsTypeInterface, + `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + ...innerComponent, + "}", + ...exportDefault, + ], + description: + "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", +}; + +const typescriptReactArrowFunctionComponent: TypescriptSnippet = { + key: "typescriptReactArrowFunctionComponent", + prefix: "tsrafc", + body: [ + ...react, + ...propsTypeInterface, + `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + ...innerComponent, + "}", + "", + ], + description: + "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", +}; + +const typescriptReactClassPureComponent: TypescriptSnippet = { + key: "typescriptReactClassPureComponent", + prefix: "tsrpc", + body: [ + ...reactPureComponent, + ...propsTypeInterface, + `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + ...innerComponentReturn, + "}", + "", + ], + description: + "Creates a React pure component class with ES7 module system and TypeScript interface", +}; + +const typescriptReactClassExportPureComponent: TypescriptSnippet = { + key: "typescriptReactClassExportPureComponent", + prefix: "tsrpce", + body: [ + ...reactPureComponent, + ...propsTypeInterface, + `class ${SnippetPlaceholders.FileName} extends PureComponent {`, + ...innerComponentReturn, + "}", + ...exportDefault, + ], + description: + "Creates a React pure component class with ES7 module system and TypeScript interface", +}; + +const typescriptReactClassComponentRedux: TypescriptSnippet = { + key: "typescriptReactClassComponentRedux", + prefix: "tsrcredux", + body: [ + "import { connect } from 'react-redux'", + ...reactComponent, + ...propsStateInterface, + `export class ${SnippetPlaceholders.FileName} extends Component {`, + " state = {}", + "", + ...innerComponentReturn, + "}", + ...reduxComponentExport, + ], + description: + "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", +}; + +const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = { + key: "typescriptReactNativeArrowFunctionComponent", + prefix: "tsrnf", + body: [ + "import { View, Text } from 'react-native'", + ...react, + ...propsTypeInterface, + `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + " return (", + " ", + ` ${SnippetPlaceholders.LastTab}`, + " ", + " )", + "}", + ...exportDefault, + ], + description: + "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface", +}; + +const typescriptReactNativeArrowFunctionComponentNamedProps: TypescriptSnippet = + { + key: "typescriptReactNativeArrowFunctionComponentNamedProps", + prefix: "tsrnfi", + body: [ + "import { View } from 'react-native'", + ...react, + ...propsTypeInterface, + `const ${SnippetPlaceholders.FileName}: React.FC<${SnippetPlaceholders.FileName}Props> = (props) => {`, + " return (", + " ", + ` ${SnippetPlaceholders.LastTab}`, + " ", + " )", + "}", + ...exportDefault, + ], + description: + "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface", + }; + +const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = + { + key: "typescriptReactNativeArrowFunctionComponentWithStyles", + prefix: "tsrnfs", + body: [ + "import { StyleSheet, Text, View } from 'react-native'", + ...react, + ...propsTypeInterface, + `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + " return (", + " ", + ` ${SnippetPlaceholders.LastTab}`, + " ", + " )", + "}", + ...exportDefault, + "const styles = StyleSheet.create({})", + "", + ], + description: + "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", + }; + +export default [ + exportType, + exportInterface, + typescriptReactClassComponent, + typescriptReactClassExportComponent, + typescriptReactFunctionalExportComponent, + typescriptReactFunctionalComponent, + typescriptReactArrowFunctionExportComponent, + typescriptReactArrowFunctionComponent, + typescriptReactClassPureComponent, + typescriptReactClassExportPureComponent, + typescriptReactClassComponentRedux, + typescriptReactNativeArrowFunctionComponent, + typescriptReactNativeArrowFunctionComponentNamedProps, + typescriptReactNativeArrowFunctionComponentWithStyles, +]; diff --git a/src/types.ts b/src/types.ts index 54ec500..0d64711 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,36 +1,26 @@ +export type SnippetMapping = { + key: keyof T; + prefix: T[keyof T]; + body: Array; + description?: string; +}; + export enum SnippetPlaceholders { FileName = "FILE_NAME", FirstTab = "FIRST_TAB", + SecondTab = "SECOND_TAB", + ThirdTab = "THIRD_TAB", LastTab = "LAST_TAB", TypeInterface = "TYPE_INTERFACE", } -export type SnippetMapping = { - key: T; - prefix: K; - body: Array; - description: string; +export const SnippetPlaceholderMapping: { + [key in SnippetPlaceholders]: string; +} = { + [SnippetPlaceholders.FileName]: "TM_FILENAME_BASE", + [SnippetPlaceholders.FirstTab]: "$1", + [SnippetPlaceholders.SecondTab]: "$2", + [SnippetPlaceholders.ThirdTab]: "$3", + [SnippetPlaceholders.LastTab]: "$0", + [SnippetPlaceholders.TypeInterface]: "TYPE_INTERFACE", }; - -export type TypescriptMappings = { - typescriptReactArrowFunctionComponent: "tsrafc"; - typescriptReactArrowFunctionExportComponent: "tsrafce"; - typescriptReactClassComponent: "tsrcc"; - typescriptReactClassComponentRedux: "tsrcredux"; - typescriptReactClassExportComponent: "tsrce"; - typescriptReactClassExportPureComponent: "tsrpce"; - typescriptReactClassPureComponent: "tsrpc"; - typescriptReactFunctionMemoComponent: "tsrmc"; - typescriptReactFunctionalComponent: "tsrfc"; - typescriptReactFunctionalExportComponent: "tsrfce"; - typescriptReactNativeArrowFunctionComponent: "tsrnf"; - typescriptReactNativeArrowFunctionComponentNamedProps: "tsrnfi"; - typescriptReactNativeArrowFunctionComponentWithStyles: "tsrnfs"; - exportInterface: "expint"; - exportType: "exptp"; -}; - -export type TypescriptSnippets = SnippetMapping< - keyof TypescriptMappings, - TypescriptMappings[keyof TypescriptMappings] ->; diff --git a/tsconfig.json b/tsconfig.json index 298c2d4..c3b0b61 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,11 @@ "compilerOptions": { "allowJs": true, "allowSyntheticDefaultImports": true, - "baseUrl": "./", + "baseUrl": ".", + "paths": { + "./*": ["./src/*"], + "./src/*": ["./src/*"] + }, "esModuleInterop": true, "module": "amd", "moduleResolution": "Node", @@ -18,6 +22,6 @@ "strictNullChecks": true, "target": "ESNext" }, - "exclude": ["node_modules", "jest", "webpack.config.js", "**/__tests__/*"], + "exclude": ["node_modules", "jest", "**/__tests__/*"], "compileOnSave": false } From 1f0d717eb9c809b9a5b825df97e08f27b035a4af Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 30 Dec 2021 23:15:41 +0100 Subject: [PATCH 080/110] chore: generate snippets and replace placeholders --- .github/workflows/typescript_and_lint.yml | 5 +- README.md | 32 ++--- package.json | 31 +---- src/generateSnippets.ts | 136 ++++++++++++++++------ src/helpers.ts | 2 +- src/snippetSearch.ts | 3 +- src/snippets/generated.json | 1 + src/sourceSnippets/hooks.ts | 40 ++++--- src/sourceSnippets/imports.ts | 27 ++++- src/sourceSnippets/redux.ts | 31 +++-- src/types.ts | 2 +- yarn.lock | 122 +------------------ 12 files changed, 190 insertions(+), 242 deletions(-) create mode 100644 src/snippets/generated.json diff --git a/.github/workflows/typescript_and_lint.yml b/.github/workflows/typescript_and_lint.yml index 738c935..83ee80e 100644 --- a/.github/workflows/typescript_and_lint.yml +++ b/.github/workflows/typescript_and_lint.yml @@ -1,6 +1,9 @@ name: Typescript & lint -on: :push +on: + push: + branches: + - "*" jobs: lint: diff --git a/README.md b/README.md index e06f670..1c13c44 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,8 @@ React 17 is currently supported by `_` prefix. | `ssf→` | `this.setState((state, props) => return { })` | | `props→` | `this.props.propName` | | `state→` | `this.state.stateName` | -| `rcontext→` | `const ${1:contextName} = React.createContext()` | -| `cref→` | `this.${1:refName}Ref = React.createRef()` | +| `rcontext→` | `const $1 = React.createContext()` | +| `cref→` | `this.$1Ref = React.createRef()` | | `fref→` | `const ref = React.createRef()` | | `bnd→` | `this.methodName = this.methodName.bind(this)` | @@ -682,11 +682,11 @@ it("should $1", () => { import React from 'react' import renderer from 'react-test-renderer' -import { ${1:ComponentName} } from '../${1:ComponentName}' +import { $1 } from '../$1' -describe('<${1:ComponentName} />', () => { +describe('<$1 />', () => { const defaultProps = {} - const wrapper = renderer.create(<${1:ComponentName} {...defaultProps} />) + const wrapper = renderer.create(<$1 {...defaultProps} />) test('render', () => { expect(wrapper).toMatchSnapshot() @@ -702,13 +702,13 @@ import renderer from 'react-test-renderer' import { Provider } from 'react-redux' import store from 'src/store' -import { ${1:ComponentName} } from '../${1:ComponentName}' +import { $1 } from '../$1' -describe('<${1:ComponentName} />', () => { +describe('<$1 />', () => { const defaultProps = {} const wrapper = renderer.create( - <${1:${TM_FILENAME_BASE}} {...defaultProps} />) + <${1TM_FILENAME_BASE}} {...defaultProps} />) , ) @@ -725,14 +725,14 @@ import 'react-native' import React from 'react' import renderer from 'react-test-renderer' -import ${1:ComponentName} from '../${1:ComponentName}' +import $1 from '../$1' -describe('<${1:ComponentName} />', () => { +describe('<$1 />', () => { const defaultProps = { } - const wrapper = renderer.create(<${1:ComponentName} {...defaultProps} />) + const wrapper = renderer.create(<$1 {...defaultProps} />) test('render', () => { expect(wrapper).toMatchSnapshot() @@ -749,13 +749,13 @@ import renderer from 'react-test-renderer' import { Provider } from 'react-redux' import store from 'src/store/configureStore' -import ${1:ComponentName} from '../${1:ComponentName}' +import $1 from '../$1' -describe('<${1:ComponentName} />', () => { +describe('<$1 />', () => { const defaultProps = {} const wrapper = renderer.create( - <${1:ComponentName} {...defaultProps} /> + <$1 {...defaultProps} /> , ) @@ -780,7 +780,7 @@ export const mapDispatchToProps = { } -export const ${1:hocComponentName} = (WrappedComponent) => { +export const $1 = (WrappedComponent) => { const hocComponent = ({ ...props }) => hocComponent.propTypes = { @@ -789,7 +789,7 @@ export const ${1:hocComponentName} = (WrappedComponent) => { return hocComponent } -export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent)) +export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)($1(WrapperComponent)) ``` ### `hoc` diff --git a/package.json b/package.json index 3a7853b..586238e 100644 --- a/package.json +++ b/package.json @@ -99,33 +99,7 @@ ] } } - }, - "snippets": [ - { - "language": "javascript", - "path": "./snippets/generated.json" - }, - { - "language": "typescript", - "path": "./lib/snippets/snippets.json" - }, - { - "language": "javascriptreact", - "path": "./lib/snippets/snippets.json" - }, - { - "language": "typescriptreact", - "path": "./lib/snippets/snippets.json" - }, - { - "language": "typescript", - "path": "./lib/snippets/ts-snippets.json" - }, - { - "language": "typescriptreact", - "path": "./lib/snippets/ts-snippets.json" - } - ] + } }, "scripts": { "vscode:prepublish": "yarn compile", @@ -141,10 +115,9 @@ "devDependencies": { "@babel/cli": "7.16.0", "@babel/preset-typescript": "7.16.5", - "@types/node": "17.0.4", + "@types/node": "17.0.5", "@types/prettier": "2.4.2", "@types/vscode": "1.63.1", - "esbuild": "0.14.8", "eslint": "8.5.0", "eslint-config-satya164": "3.1.10", "eslint-plugin-simple-import-sort": "7.0.0", diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index 38a177b..cf7e152 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -1,47 +1,113 @@ import { workspace } from "vscode"; import { writeFileSync } from "fs"; -import hooks, { HooksSnippet } from "./sourceSnippets/hooks"; -import imports, { ImportsSnippet } from "./sourceSnippets/imports"; -import reactNative, { ReactNativeSnippet } from "./sourceSnippets/reactNative"; -import typescript, { TypescriptSnippet } from "./sourceSnippets/typescript"; +import hooksSnippets, { HooksSnippet } from "./sourceSnippets/hooks"; +import importsSnippets, { ImportsSnippet } from "./sourceSnippets/imports"; +import reactNativeSnippets, { + ReactNativeSnippet, +} from "./sourceSnippets/reactNative"; +import typescriptSnippets, { + TypescriptSnippet, +} from "./sourceSnippets/typescript"; import { ExtensionSettings } from "./helpers"; -import redux, { ReduxSnippet } from "./sourceSnippets/redux"; -import components, { ComponentsSnippet } from "./sourceSnippets/components"; -import console, { ConsoleSnippet } from "./sourceSnippets/console"; -import propTypes, { PropTypesSnippet } from "./sourceSnippets/propTypes"; -import tests, { TestsSnippet } from "./sourceSnippets/tests"; - -type SnippetsArray = Array< - | HooksSnippet - | ImportsSnippet - | ReactNativeSnippet - | TypescriptSnippet - | ReduxSnippet - | ComponentsSnippet - | ConsoleSnippet - | PropTypesSnippet - | TestsSnippet ->; +import reduxSnippets, { ReduxSnippet } from "./sourceSnippets/redux"; +import componentsSnippets, { + ComponentsSnippet, +} from "./sourceSnippets/components"; +import consoleSnippets, { ConsoleSnippet } from "./sourceSnippets/console"; +import propTypesSnippets, { + PropTypesSnippet, +} from "./sourceSnippets/propTypes"; +import testsSnippets, { TestsSnippet } from "./sourceSnippets/tests"; +import { SnippetPlaceholderMapping, SnippetPlaceholders } from "./types"; + +type SnippetKeys = + | HooksSnippet["key"] + | ImportsSnippet["key"] + | ReactNativeSnippet["key"] + | TypescriptSnippet["key"] + | ReduxSnippet["key"] + | ComponentsSnippet["key"] + | ConsoleSnippet["key"] + | PropTypesSnippet["key"] + | TestsSnippet["key"]; + +type Snippets = { + [key in SnippetKeys]: + | HooksSnippet + | ImportsSnippet + | ReactNativeSnippet + | TypescriptSnippet + | ReduxSnippet + | ComponentsSnippet + | ConsoleSnippet + | PropTypesSnippet + | TestsSnippet; +}; + +let snippetsCache: string | null = null; + +const getSnippets = () => { + if (snippetsCache) { + return snippetsCache; + } -const generateSnippets = () => { const config = workspace.getConfiguration( "esReactSnippets", ) as unknown as ExtensionSettings; - const snippets: SnippetsArray = [ - ...components, - ...console, - ...hooks, - ...imports, - ...propTypes, - ...reactNative, - ...redux, - ...tests, - ...(config.typescript ? typescript : []), - ]; - - writeFileSync("./snippets/generated.json", JSON.stringify(snippets, null, 2)); + const snippets: Snippets = [ + ...componentsSnippets, + ...consoleSnippets, + ...hooksSnippets, + ...importsSnippets, + ...propTypesSnippets, + ...reactNativeSnippets, + ...reduxSnippets, + ...testsSnippets, + ...(config.typescript ? typescriptSnippets : []), + ].reduce((acc, snippet) => { + acc[snippet.key] = snippet; + return acc; + }, {} as Snippets); + + const jsonSnippets = String(JSON.stringify(snippets, null, 2)) + .replace( + new RegExp(SnippetPlaceholders.FileName, "g"), + SnippetPlaceholderMapping[SnippetPlaceholders.FileName], + ) + .replace( + new RegExp(SnippetPlaceholders.FirstTab, "g"), + SnippetPlaceholderMapping[SnippetPlaceholders.FirstTab], + ) + .replace( + new RegExp(SnippetPlaceholders.SecondTab, "g"), + SnippetPlaceholderMapping[SnippetPlaceholders.SecondTab], + ) + .replace( + new RegExp(SnippetPlaceholders.ThirdTab, "g"), + SnippetPlaceholderMapping[SnippetPlaceholders.ThirdTab], + ) + .replace( + new RegExp(SnippetPlaceholders.LastTab, "g"), + SnippetPlaceholderMapping[SnippetPlaceholders.LastTab], + ) + .replace( + new RegExp(SnippetPlaceholders.TypeInterface, "g"), + config.typescriptComponentPropsStatePrefix || "type", + ); + + snippetsCache = jsonSnippets; + return jsonSnippets; +}; + +const generateSnippets = () => { + console.time("generate"); + const jsonSnippets = getSnippets(); + console.log(jsonSnippets); + console.timeEnd("generate"); + + writeFileSync(__dirname + "/snippets/generated.json", jsonSnippets); }; export default generateSnippets; diff --git a/src/helpers.ts b/src/helpers.ts index e784f21..1496b0f 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -8,7 +8,7 @@ export type ExtensionSettings = { quotes: boolean; typescript: boolean; tabWidth: number; - componentPropsPrefix: "type" | "interface"; + typescriptComponentPropsStatePrefix: "type" | "interface"; }; export const getPrettierConfig = async (): Promise => { diff --git a/src/snippetSearch.ts b/src/snippetSearch.ts index 3390e7d..72c5ca3 100644 --- a/src/snippetSearch.ts +++ b/src/snippetSearch.ts @@ -1,11 +1,12 @@ import { SnippetString, window } from "vscode"; import { parseSnippet } from "./helpers"; +import snippets from "./snippets/generated.json"; const snippetSearch = async () => { const { showQuickPick, activeTextEditor } = window; - const snippetsArray = [[]]; + const snippetsArray = Object.entries(snippets); const items = snippetsArray.map( // @ts-expect-error diff --git a/src/snippets/generated.json b/src/snippets/generated.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/snippets/generated.json @@ -0,0 +1 @@ +{} diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts index 2a018b7..2f28065 100644 --- a/src/sourceSnippets/hooks.ts +++ b/src/sourceSnippets/hooks.ts @@ -1,4 +1,4 @@ -import { SnippetMapping } from "../types"; +import { SnippetPlaceholders, SnippetMapping } from "../types"; type HookMappings = { useCallback: "useCallbackSnippet"; @@ -18,7 +18,7 @@ const useState: HooksSnippet = { key: "useState", prefix: "useStateSnippet", body: [ - "const [${1:state}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:initialState})", + `const [${SnippetPlaceholders.FirstTab}, set${SnippetPlaceholders.FirstTab}/(.*)/${SnippetPlaceholders.FirstTab}:/capitalize}/}] = useState(${SnippetPlaceholders.SecondTab})`, ], }; @@ -27,12 +27,12 @@ const useEffect: HooksSnippet = { prefix: "useEffectSnippet", body: [ "useEffect(() => {", - " ${1:effect}", + ` ${SnippetPlaceholders.FirstTab}`, "", " return () => {", - " ${2:cleanup}", + ` ${SnippetPlaceholders.SecondTab}`, " }", - "}, [${3:input}])", + `}, [${SnippetPlaceholders.ThirdTab}])`, "", ], }; @@ -40,14 +40,16 @@ const useEffect: HooksSnippet = { const useContext: HooksSnippet = { key: "useContext", prefix: "useContextSnippet", - body: ["const ${1:context} = useContext(${2:contextValue})"], + body: [ + `const ${SnippetPlaceholders.FirstTab} = useContext(${SnippetPlaceholders.SecondTab})`, + ], }; const useReducer: HooksSnippet = { key: "useReducer", prefix: "useReducerSnippet", body: [ - "const [state, dispatch] = useReducer(${1:reducer}, ${2:initialState}, ${3:init})", + `const [state, dispatch] = useReducer(${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab}, ${SnippetPlaceholders.ThirdTab})`, ], }; @@ -57,9 +59,9 @@ const useCallback: HooksSnippet = { body: [ "useCallback(", " () => {", - " ${1:callback}", + ` ${SnippetPlaceholders.FirstTab}`, " },", - " [${2:input}],", + ` [${SnippetPlaceholders.SecondTab}],`, ")", "", ], @@ -68,13 +70,17 @@ const useCallback: HooksSnippet = { const useMemo: HooksSnippet = { key: "useMemo", prefix: "useMemoSnippet", - body: ["useMemo(() => ${1:function}, ${2:input})"], + body: [ + `useMemo(() => ${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab})`, + ], }; const useRef: HooksSnippet = { key: "useRef", prefix: "useRefSnippet", - body: ["const ${1:ref} = useRef(${2:initialValue})"], + body: [ + `const ${SnippetPlaceholders.FirstTab} = useRef(${SnippetPlaceholders.SecondTab})`, + ], }; const useImperativeHandle: HooksSnippet = { @@ -82,11 +88,11 @@ const useImperativeHandle: HooksSnippet = { prefix: "useImperativeHandleSnippet", body: [ "useImperativeHandle(", - " ${1:ref},", + ` ${SnippetPlaceholders.FirstTab},`, " () => {", - " ${2:handler}", + ` ${SnippetPlaceholders.SecondTab}`, " },", - " [${3:input}],", + ` [${SnippetPlaceholders.ThirdTab}],`, ")", ], }; @@ -96,11 +102,11 @@ const useLayoutEffect: HooksSnippet = { prefix: "useLayoutEffectSnippet", body: [ "useLayoutEffect(() => {", - " ${1:effect}", + ` ${SnippetPlaceholders.FirstTab}`, " return () => {", - " ${2:cleanup}", + ` ${SnippetPlaceholders.SecondTab}`, " };", - "}, [${3:input}])", + `}, [${SnippetPlaceholders.ThirdTab}])`, ], }; diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts index 194bb7f..0ac0c2d 100644 --- a/src/sourceSnippets/imports.ts +++ b/src/sourceSnippets/imports.ts @@ -1,4 +1,4 @@ -import { SnippetMapping } from "../types"; +import { SnippetPlaceholders, SnippetMapping } from "../types"; type ImportsMappings = { import: "imp"; @@ -145,31 +145,46 @@ const importRouterNavLink: ImportsSnippet = { const importSnippet: ImportsSnippet = { key: "import", prefix: "imp", - body: ["import ${2:moduleName} from '${1:module}'$0", ""], + body: [ + `import ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, + "", + ], }; const importNoModuleName: ImportsSnippet = { key: "importNoModuleName", prefix: "imn", - body: ["import '${1:module}'$0", ""], + body: [ + `import '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, + "", + ], }; const importDestructing: ImportsSnippet = { key: "importDestructing", prefix: "imd", - body: ["import { $2 } from '${1:module}'$0", ""], + body: [ + `import { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, + "", + ], }; const importEverything: ImportsSnippet = { key: "importEverything", prefix: "ime", - body: ["import * as ${2:alias} from '${1:module}'$0", ""], + body: [ + `import * as ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, + "", + ], }; const importAs: ImportsSnippet = { key: "importAs", prefix: "ima", - body: ["import { ${2:originalName} as ${3:alias} } from '${1:module}'$0", ""], + body: [ + `import { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, + "", + ], }; export default [ diff --git a/src/sourceSnippets/redux.ts b/src/sourceSnippets/redux.ts index 21dd4e5..1cd0314 100644 --- a/src/sourceSnippets/redux.ts +++ b/src/sourceSnippets/redux.ts @@ -1,4 +1,4 @@ -import { SnippetMapping } from "../types"; +import { SnippetPlaceholders, SnippetMapping } from "../types"; type HookMappings = { importReduxConnect: "redux"; @@ -22,8 +22,8 @@ const reduxAction: ReduxSnippet = { key: "reduxAction", prefix: "rxaction", body: [ - "export const ${1:actionName} = (payload) => ({", - " type: ${3:type},", + `export const ${SnippetPlaceholders.FirstTab} = (payload) => ({`, + ` type: ${SnippetPlaceholders.SecondTab},`, " payload", "})", "", @@ -33,21 +33,21 @@ const reduxAction: ReduxSnippet = { const reduxConst: ReduxSnippet = { key: "reduxConst", prefix: "rxconst", - body: ["export const ${1:constantName} = '${1:constantName}'"], + body: [ + `export const ${SnippetPlaceholders.FirstTab} = '${SnippetPlaceholders.FirstTab}'`, + ], }; const reduxReducer: ReduxSnippet = { key: "reduxReducer", prefix: "rxreducer", body: [ - "const initialState = {", - "", - "}", + "const initialState = {}", "", "export default (state = initialState, { type, payload }) => {", " switch (type) {", "", - " case ${1:typeName}:", + ` case ${SnippetPlaceholders.FirstTab}:`, " return { ...state, ...payload }", "", " default:", @@ -64,7 +64,7 @@ const reduxSelector: ReduxSnippet = { body: [ "import { createSelector } from 'reselect'", "", - "export const ${1:selectorName} = state => state.${2:selector}", + `export const ${SnippetPlaceholders.FirstTab} = state => state.${SnippetPlaceholders.SecondTab}`, "", ], }; @@ -79,18 +79,15 @@ const reduxSlice: ReduxSnippet = { "", "}", "", - "const ${1:${TM_FILENAME_BASE}} = createSlice({", - " name: ${2:sliceName},", + `const ${SnippetPlaceholders.FileName} = createSlice({`, + ` name: ${SnippetPlaceholders.SecondTab},`, " initialState,", - " reducers: {", - " ", - " }", + " reducers: {}", "});", "", - "export const {", + `export const {} = ${SnippetPlaceholders.FileName}.actions`, "", - "} = ${1:${TM_FILENAME_BASE}}.actions", - "export default ${1:${TM_FILENAME_BASE}}.reducer", + `export default ${SnippetPlaceholders.FileName}.reducer`, ], }; diff --git a/src/types.ts b/src/types.ts index 0d64711..424b787 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,7 +17,7 @@ export enum SnippetPlaceholders { export const SnippetPlaceholderMapping: { [key in SnippetPlaceholders]: string; } = { - [SnippetPlaceholders.FileName]: "TM_FILENAME_BASE", + [SnippetPlaceholders.FileName]: "${1:TM_FILENAME_BASE}", [SnippetPlaceholders.FirstTab]: "$1", [SnippetPlaceholders.SecondTab]: "$2", [SnippetPlaceholders.ThirdTab]: "$3", diff --git a/yarn.lock b/yarn.lock index 596d5a4..061b69b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -355,10 +355,10 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/node@17.0.4": - version "17.0.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.4.tgz#fec0ce0526abb6062fd206d72a642811b887a111" - integrity sha512-6xwbrW4JJiJLgF+zNypN5wr2ykM9/jHcL7rQ8fZe2vuftggjzZeRSM4OwRc6Xk8qWjwJ99qVHo/JgOGmomWRog== +"@types/node@17.0.5": + version "17.0.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0" + integrity sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw== "@types/prettier@2.4.2": version "2.4.2" @@ -821,120 +821,6 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -esbuild-android-arm64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.8.tgz#69324e08ba68c7d9a541e7b825d7235b83e17bd6" - integrity sha512-tAEoSHnPBSH0cCAFa/aYs3LPsoTY4SwsP6wDKi4PaelbQYNJjqNpAeweyJ8l98g1D6ZkLyqsHbkYj+209sezkA== - -esbuild-darwin-64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.8.tgz#7176b692b9de746ba2f9dd4dd81dc4f1b7670786" - integrity sha512-t7p7WzTb+ybiD/irkMt5j/NzB+jY+8yPTsrXk5zCOH1O7DdthRnAUJ7pJPwImdL7jAGRbLtYRxUPgCHs/0qUPw== - -esbuild-darwin-arm64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.8.tgz#59167584e58428877e48e05c4cca58755f843327" - integrity sha512-5FeaT2zMUajKnBwUMSsjZev5iA38YHrDmXhkOCwZQIFUvhqojinqCrvv/X7dyxb1987bcY9KGwJ+EwDwd922HQ== - -esbuild-freebsd-64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.8.tgz#00b7d6e00abba9c2eccc9acd576c796333671e9c" - integrity sha512-pGHBLSf7ynfyDZXUtbq/GsA2VIwQlWXrUj1AMcE0id47mRdEUM8/1ZuqMGZx63hRnNgtK9zNJ8OIu2c7qq76Qw== - -esbuild-freebsd-arm64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.8.tgz#57f0cd5a1cb37fa2c0e84e780677fe62f1e8c894" - integrity sha512-g4GgAnrx6Gh1BjKJjJWgPnOR4tW2FcAx9wFvyUjRsIjB35gT+aAFR+P/zStu5OG9LnbS8Pvjd4wS68QIXk+2dA== - -esbuild-linux-32@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.8.tgz#bbf3e5d3fb30f949030d0c2241ac93a172917d56" - integrity sha512-wPfQJadF5vTzriw/B8Ide74PeAJlZW7czNx3NIUHkHlXb+En1SeIqNzl6jG9DuJUl57xD9Ucl9YJFEkFeX8eLg== - -esbuild-linux-64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.8.tgz#08631e9e0da613603bcec782f29fecbc6f4596de" - integrity sha512-+RNuLk9RhRDL2kG+KTEYl5cIgF6AGLkRnKKWEu9DpCZaickONEqrKyQSVn410Hj105DLdW6qvIXQQHPycJhExg== - -esbuild-linux-arm64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.8.tgz#206d39c8dfbb7c72aa2f5fc52f7402b5b8a77366" - integrity sha512-BtWoKNYul9UoxUvQUSdSrvSmJyFL1sGnNPTSqWCg1wMe4kmc8UY2yVsXSSkKO8N2jtHxlgFyz/XhvNBzEwGVcw== - -esbuild-linux-arm@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.8.tgz#e28e70420d187f5e403bfa4a72df676d53d707fd" - integrity sha512-HIct38SvUAIJbiTwV/PVQroimQo96TGtzRDAEZxTorB4vsAj1r8bd0keXExPU4RH7G0zIqC4loQQpWYL+nH4Vg== - -esbuild-linux-mips64le@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.8.tgz#04997ac1a0df794a4d5e04d78015863d48490590" - integrity sha512-0DxnCl9XTvaQtsX6Qa+Phr5i9b04INwwSv2RbQ2UWRLoQ/037iaFzbmuhgrcmaGOcRwPkCa+4Qo5EgI01MUgsQ== - -esbuild-linux-ppc64le@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.8.tgz#1827378feff9702c156047ba118c1f3bd74da67e" - integrity sha512-Uzr/OMj97Q0qoWLXCvXCKUY/z1SNI4iSZEuYylM5Nd71HGStL32XWq/MReJ0PYMvUMKKJicKSKw2jWM1uBQ84Q== - -esbuild-linux-s390x@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.8.tgz#200ac44cda59b81135b325c3a29d016969650876" - integrity sha512-vURka7aCA5DrRoOqOn6pXYwFlDSoQ4qnqam8AC0Ikn6tibutuhgar6M3Ek2DCuz9yqd396mngdYr5A8x2TPkww== - -esbuild-netbsd-64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.8.tgz#8159d8eae111f80ea6e4cbfa5d4cf658388a72d4" - integrity sha512-tjyDak2/pp0VUAhBW6/ueuReMd5qLHNlisXl5pq0Xn0z+kH9urA/t1igm0JassWbdMz123td5ZEQWoD9KbtOAw== - -esbuild-openbsd-64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.8.tgz#2a9498d881a3ab94927c724f34dd1160eef1f3b8" - integrity sha512-zAKKV15fIyAuDDga5rQv0lW2ufBWj/OCjqjDBb3dJf5SfoAi/DMIHuzmkKQeDQ+oxt9Rp1D7ZOlOBVflutFTqQ== - -esbuild-sunos-64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.8.tgz#2447de7d79848ad528c7d44caab4938eb8f5a0cc" - integrity sha512-xV41Wa8imziM/2dbWZjLKQbIETRgo5dE0oc/uPsgaecJhsrdA0VkGa/V432LJSUYv967xHDQdoRRl5tr80+NnQ== - -esbuild-windows-32@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.8.tgz#3287281552d7e4c851b3106940ff5826f518043e" - integrity sha512-AxpdeLKQSyCZo7MzdOyV4OgEbEJcjnrS/2niAjbHESbjuS5P1DN/5vZoJ/JSWDVa/40OkBuHBhAXMx1HK3UDsg== - -esbuild-windows-64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.8.tgz#b4052868438b4f17b5c2a908cf344ed2bd267c38" - integrity sha512-/3pllNoy8mrz/E1rYalwiwwhzJBrYQhEapwAteHZbFVhGzYuB8F80e8x5eA8dhFHxDiZh1VzK+hREwwSt8UTQA== - -esbuild-windows-arm64@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.8.tgz#512d06097cb4b848526a37c48a47223f1c6cc667" - integrity sha512-lTm5naoNgaUvzIiax3XYIEebqwr3bIIEEtqUhzQ2UQ+JMBmvhr02w3sJIJqF3axTX6TgWrC1OtM7DYNvFG+aXA== - -esbuild@0.14.8: - version "0.14.8" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.8.tgz#f60a07ca9400d61d09a98f96d666c50613972550" - integrity sha512-stMsCBmxwaMpeK8GC/49L/cRGIwsHwoEN7Twk5zDTHlm/63c0KXFKzDC8iM2Mi3fyCKwS002TAH6IlAvqR6t3g== - optionalDependencies: - esbuild-android-arm64 "0.14.8" - esbuild-darwin-64 "0.14.8" - esbuild-darwin-arm64 "0.14.8" - esbuild-freebsd-64 "0.14.8" - esbuild-freebsd-arm64 "0.14.8" - esbuild-linux-32 "0.14.8" - esbuild-linux-64 "0.14.8" - esbuild-linux-arm "0.14.8" - esbuild-linux-arm64 "0.14.8" - esbuild-linux-mips64le "0.14.8" - esbuild-linux-ppc64le "0.14.8" - esbuild-linux-s390x "0.14.8" - esbuild-netbsd-64 "0.14.8" - esbuild-openbsd-64 "0.14.8" - esbuild-sunos-64 "0.14.8" - esbuild-windows-32 "0.14.8" - esbuild-windows-64 "0.14.8" - esbuild-windows-arm64 "0.14.8" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" From ff84f0f057223887c678be022986ad1357a8b1c1 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 31 Dec 2021 00:06:00 +0100 Subject: [PATCH 081/110] feat: properly generate snippets from search --- README.md | 126 +++++++++++++++++++--------------------- package.json | 2 +- src/generateSnippets.ts | 33 ++--------- src/helpers.ts | 55 ++++++++++++++++-- src/snippetSearch.ts | 2 +- src/types.ts | 11 ---- 6 files changed, 117 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index 1c13c44..6edbb1c 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,8 @@ React 17 is currently supported by `_` prefix. | `ssf→` | `this.setState((state, props) => return { })` | | `props→` | `this.props.propName` | | `state→` | `this.state.stateName` | -| `rcontext→` | `const $1 = React.createContext()` | -| `cref→` | `this.$1Ref = React.createRef()` | +| `rcontext→` | `const $1 = React.createContext()` | +| `cref→` | `this.$1Ref = React.createRef()` | | `fref→` | `const ref = React.createRef()` | | `bnd→` | `this.methodName = this.methodName.bind(this)` | @@ -679,117 +679,111 @@ it("should $1", () => { ### `stest` ```javascript -import React from 'react' -import renderer from 'react-test-renderer' +import React from "react"; +import renderer from "react-test-renderer"; -import { $1 } from '../$1' +import { $1 } from "../$1"; -describe('<$1 />', () => { - const defaultProps = {} - const wrapper = renderer.create(<$1 {...defaultProps} />) +describe("<$1 />", () => { + const defaultProps = {}; + const wrapper = renderer.create(<$1 {...defaultProps} />); - test('render', () => { - expect(wrapper).toMatchSnapshot() - }) -}) + test("render", () => { + expect(wrapper).toMatchSnapshot(); + }); +}); ``` ### `srtest` ```javascript -import React from 'react' -import renderer from 'react-test-renderer' -import { Provider } from 'react-redux' +import React from "react"; +import renderer from "react-test-renderer"; +import { Provider } from "react-redux"; -import store from 'src/store' -import { $1 } from '../$1' +import store from "src/store"; +import { $1 } from "../$1"; -describe('<$1 />', () => { - const defaultProps = {} +describe("<$1 />", () => { + const defaultProps = {}; const wrapper = renderer.create( - <${1TM_FILENAME_BASE}} {...defaultProps} />) + <$1 {...defaultProps} />) , - ) + ); - test('render', () => { - expect(wrapper).toMatchSnapshot() - }) -}) + test("render", () => { + expect(wrapper).toMatchSnapshot(); + }); +}); ``` ### `sntest` ```javascript -import 'react-native' -import React from 'react' -import renderer from 'react-test-renderer' - -import $1 from '../$1' +import "react-native"; +import React from "react"; +import renderer from "react-test-renderer"; -describe('<$1 />', () => { - const defaultProps = { +import $1 from "../$1"; - } +describe("<$1 />", () => { + const defaultProps = {}; - const wrapper = renderer.create(<$1 {...defaultProps} />) + const wrapper = renderer.create(<$1 {...defaultProps} />); - test('render', () => { - expect(wrapper).toMatchSnapshot() - }) -}) + test("render", () => { + expect(wrapper).toMatchSnapshot(); + }); +}); ``` ### `snrtest` ```javascript -import 'react-native' -import React from 'react' -import renderer from 'react-test-renderer' -import { Provider } from 'react-redux' +import "react-native"; +import React from "react"; +import renderer from "react-test-renderer"; +import { Provider } from "react-redux"; -import store from 'src/store/configureStore' -import $1 from '../$1' +import store from "src/store/configureStore"; +import $1 from "../$1"; -describe('<$1 />', () => { - const defaultProps = {} +describe("<$1 />", () => { + const defaultProps = {}; const wrapper = renderer.create( <$1 {...defaultProps} /> , - ) + ); - test('render', () => { - expect(wrapper).toMatchSnapshot() - }) -}) + test("render", () => { + expect(wrapper).toMatchSnapshot(); + }); +}); ``` ### `hocredux` ```javascript -import React from 'react' -import PropTypes from 'prop-types' -import { connect } from 'react-redux' - -export const mapStateToProps = state => ({ - -}) +import React from "react"; +import PropTypes from "prop-types"; +import { connect } from "react-redux"; -export const mapDispatchToProps = { +export const mapStateToProps = (state) => ({}); -} +export const mapDispatchToProps = {}; export const $1 = (WrappedComponent) => { - const hocComponent = ({ ...props }) => + const hocComponent = ({ ...props }) => ; - hocComponent.propTypes = { - } + hocComponent.propTypes = {}; - return hocComponent -} + return hocComponent; +}; -export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)($1(WrapperComponent)) +export default (WrapperComponent) => + connect(mapStateToProps, mapDispatchToProps)($1(WrapperComponent)); ``` ### `hoc` diff --git a/package.json b/package.json index 586238e..191e680 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React (React-Native) and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "3.2.0", + "version": "4.0.0", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index cf7e152..acc357a 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -9,7 +9,7 @@ import reactNativeSnippets, { import typescriptSnippets, { TypescriptSnippet, } from "./sourceSnippets/typescript"; -import { ExtensionSettings } from "./helpers"; +import { ExtensionSettings, replaceSnippetPlaceholders } from "./helpers"; import reduxSnippets, { ReduxSnippet } from "./sourceSnippets/redux"; import componentsSnippets, { ComponentsSnippet, @@ -19,7 +19,6 @@ import propTypesSnippets, { PropTypesSnippet, } from "./sourceSnippets/propTypes"; import testsSnippets, { TestsSnippet } from "./sourceSnippets/tests"; -import { SnippetPlaceholderMapping, SnippetPlaceholders } from "./types"; type SnippetKeys = | HooksSnippet["key"] @@ -71,31 +70,10 @@ const getSnippets = () => { return acc; }, {} as Snippets); - const jsonSnippets = String(JSON.stringify(snippets, null, 2)) - .replace( - new RegExp(SnippetPlaceholders.FileName, "g"), - SnippetPlaceholderMapping[SnippetPlaceholders.FileName], - ) - .replace( - new RegExp(SnippetPlaceholders.FirstTab, "g"), - SnippetPlaceholderMapping[SnippetPlaceholders.FirstTab], - ) - .replace( - new RegExp(SnippetPlaceholders.SecondTab, "g"), - SnippetPlaceholderMapping[SnippetPlaceholders.SecondTab], - ) - .replace( - new RegExp(SnippetPlaceholders.ThirdTab, "g"), - SnippetPlaceholderMapping[SnippetPlaceholders.ThirdTab], - ) - .replace( - new RegExp(SnippetPlaceholders.LastTab, "g"), - SnippetPlaceholderMapping[SnippetPlaceholders.LastTab], - ) - .replace( - new RegExp(SnippetPlaceholders.TypeInterface, "g"), - config.typescriptComponentPropsStatePrefix || "type", - ); + const jsonSnippets = replaceSnippetPlaceholders( + JSON.stringify(snippets, null, 2), + config, + ); snippetsCache = jsonSnippets; return jsonSnippets; @@ -104,7 +82,6 @@ const getSnippets = () => { const generateSnippets = () => { console.time("generate"); const jsonSnippets = getSnippets(); - console.log(jsonSnippets); console.timeEnd("generate"); writeFileSync(__dirname + "/snippets/generated.json", jsonSnippets); diff --git a/src/helpers.ts b/src/helpers.ts index 1496b0f..3a0eeb4 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,5 +1,6 @@ import prettier, { Options } from "prettier"; import { workspace } from "vscode"; +import { SnippetPlaceholders } from "./types"; export type ExtensionSettings = { prettierEnabled: boolean; @@ -11,6 +12,35 @@ export type ExtensionSettings = { typescriptComponentPropsStatePrefix: "type" | "interface"; }; +export const replaceSnippetPlaceholders = ( + snippetString: string, + extensionConfig: ExtensionSettings, +) => + String(snippetString) + .replace( + new RegExp(SnippetPlaceholders.FileName, "g"), + "${1:${TM_FILENAME_BASE}}", + ) + .replace(new RegExp(SnippetPlaceholders.FirstTab, "g"), "${1:first}") + .replace(new RegExp(SnippetPlaceholders.SecondTab, "g"), "${2:second}") + .replace(new RegExp(SnippetPlaceholders.ThirdTab, "g"), "${3:third}") + .replace(new RegExp(SnippetPlaceholders.LastTab, "g"), "$0") + .replace( + new RegExp(SnippetPlaceholders.TypeInterface, "g"), + extensionConfig.typescriptComponentPropsStatePrefix || "type", + ); + +export const revertSnippetPlaceholders = (snippetString: string) => + String(snippetString) + .replace( + new RegExp(/\${1:${TM_FILENAME_BASE}}/, "g"), + SnippetPlaceholders.FileName, + ) + .replace(new RegExp(/\${1:first}/, "g"), SnippetPlaceholders.FirstTab) + .replace(new RegExp(/\${2:second}/, "g"), SnippetPlaceholders.SecondTab) + .replace(new RegExp(/\${3:third}/, "g"), SnippetPlaceholders.ThirdTab) + .replace(new RegExp(/\$0/, "g"), SnippetPlaceholders.LastTab); + export const getPrettierConfig = async (): Promise => { const settings = workspace.getConfiguration( "esReactSnippets.settings", @@ -23,19 +53,34 @@ export const getPrettierConfig = async (): Promise => { return { semi: settings.semiColons, singleQuote: settings.quotes, - tabWidth: 2, + tabWidth: settings.tabWidth, ...(settings.prettierEnabled && prettierConfig), }; }; -export const parseSnippet = (snippet: { +export const parseSnippet = async (snippet: { id: number; description: any; label: string; value: string; body: string | string[]; }) => { - return typeof snippet.body === "string" - ? snippet.body - : snippet.body.join("\n"); + const workspaceConfig = workspace.getConfiguration( + "esReactSnippets", + ) as unknown as ExtensionSettings; + const snippetBody = + typeof snippet.body === "string" ? snippet.body : snippet.body.join("\n"); + + const prettierConfig = await getPrettierConfig(); + const parsedBody = prettier.format( + revertSnippetPlaceholders(snippetBody), + prettierConfig, + ); + + console.log( + parsedBody, + replaceSnippetPlaceholders(parsedBody, workspaceConfig), + ); + + return replaceSnippetPlaceholders(parsedBody, workspaceConfig); }; diff --git a/src/snippetSearch.ts b/src/snippetSearch.ts index 72c5ca3..f0b76c7 100644 --- a/src/snippetSearch.ts +++ b/src/snippetSearch.ts @@ -25,7 +25,7 @@ const snippetSearch = async () => { placeHolder: "Search snippet by prefix or description", }); - const body = rawSnippet ? parseSnippet(rawSnippet) : ""; + const body = rawSnippet ? await parseSnippet(rawSnippet) : ""; if (activeTextEditor) { activeTextEditor.insertSnippet(new SnippetString(body)); diff --git a/src/types.ts b/src/types.ts index 424b787..3604f80 100644 --- a/src/types.ts +++ b/src/types.ts @@ -13,14 +13,3 @@ export enum SnippetPlaceholders { LastTab = "LAST_TAB", TypeInterface = "TYPE_INTERFACE", } - -export const SnippetPlaceholderMapping: { - [key in SnippetPlaceholders]: string; -} = { - [SnippetPlaceholders.FileName]: "${1:TM_FILENAME_BASE}", - [SnippetPlaceholders.FirstTab]: "$1", - [SnippetPlaceholders.SecondTab]: "$2", - [SnippetPlaceholders.ThirdTab]: "$3", - [SnippetPlaceholders.LastTab]: "$0", - [SnippetPlaceholders.TypeInterface]: "TYPE_INTERFACE", -}; From b00f5f8d7b905c02c1cd5aeb194ef845cc766fad Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 31 Dec 2021 00:12:32 +0100 Subject: [PATCH 082/110] chore: move from custom config --- .eslintrc.js | 26 -- package.json | 1 - yarn.lock | 1024 +------------------------------------------------- 3 files changed, 17 insertions(+), 1034 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 15a8151..f08e7d2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,33 +6,12 @@ module.exports = { }, plugins: ["simple-import-sort"], - extends: ["satya164"], rules: { "babel/no-unused-expressions": "off", "import/extensions": "off", "import/named": "off", "import/no-unresolved": "off", - "jest/consistent-test-it": ["error", { fn: "test" }], - "jest/no-truthy-falsy": "off", - "jest/expect-expect": [ - "error", - { assertFunctionNames: ["expect", "element"] }, - ], - - "prettier/prettier": [ - "error", - { - bracketSameLine: false, - bracketSpacing: true, - printWidth: 80, - semi: true, - singleQuote: false, - tabWidth: 2, - trailingComma: "all", - useTabs: false, - }, - ], "simple-import-sort/exports": "error", "simple-import-sort/imports": [ @@ -48,11 +27,6 @@ module.exports = { ], }, ], - - "@typescript-eslint/array-type": [ - "error", - { default: "generic", readonly: "generic" }, - ], }, globals: { __DEV__: true, diff --git a/package.json b/package.json index 191e680..cb5879c 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,6 @@ "@types/prettier": "2.4.2", "@types/vscode": "1.63.1", "eslint": "8.5.0", - "eslint-config-satya164": "3.1.10", "eslint-plugin-simple-import-sort": "7.0.0", "prettier": "2.5.1", "typescript": "4.5.4" diff --git a/yarn.lock b/yarn.lock index 061b69b..0752a89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,41 +25,6 @@ dependencies: "@babel/highlight" "^7.16.0" -"@babel/compat-data@^7.16.0": - version "7.16.4" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" - integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== - -"@babel/core@^7.13.10": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.5.tgz#924aa9e1ae56e1e55f7184c8bf073a50d8677f5c" - integrity sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.5" - "@babel/helper-compilation-targets" "^7.16.3" - "@babel/helper-module-transforms" "^7.16.5" - "@babel/helpers" "^7.16.5" - "@babel/parser" "^7.16.5" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.5" - "@babel/types" "^7.16.0" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - -"@babel/eslint-parser@^7.13.10": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.16.5.tgz#48d3485091d6e36915358e4c0d0b2ebe6da90462" - integrity sha512-mUqYa46lgWqHKQ33Q6LNCGp/wPR3eqOYTUixHFsfrSQqRxH0+WOzca75iEjFr5RDGH1dDz622LaHhLOzOuQRUA== - dependencies: - eslint-scope "^5.1.1" - eslint-visitor-keys "^2.1.0" - semver "^6.3.0" - "@babel/generator@^7.16.5": version "7.16.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.5.tgz#26e1192eb8f78e0a3acaf3eede3c6fc96d22bedf" @@ -76,16 +41,6 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-compilation-targets@^7.16.3": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" - integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== - dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.17.5" - semver "^6.3.0" - "@babel/helper-create-class-features-plugin@^7.16.0": version "7.16.5" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz#5d1bcd096792c1ebec6249eebc6358eec55d0cad" @@ -136,27 +91,6 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-module-imports@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" - integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-module-transforms@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz#530ebf6ea87b500f60840578515adda2af470a29" - integrity sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ== - dependencies: - "@babel/helper-environment-visitor" "^7.16.5" - "@babel/helper-module-imports" "^7.16.0" - "@babel/helper-simple-access" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.5" - "@babel/types" "^7.16.0" - "@babel/helper-optimise-call-expression@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" @@ -180,13 +114,6 @@ "@babel/traverse" "^7.16.5" "@babel/types" "^7.16.0" -"@babel/helper-simple-access@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" - integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== - dependencies: - "@babel/types" "^7.16.0" - "@babel/helper-split-export-declaration@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" @@ -204,15 +131,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== -"@babel/helpers@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.5.tgz#29a052d4b827846dd76ece16f565b9634c554ebd" - integrity sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw== - dependencies: - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.5" - "@babel/types" "^7.16.0" - "@babel/highlight@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" @@ -261,7 +179,7 @@ "@babel/parser" "^7.16.0" "@babel/types" "^7.16.0" -"@babel/traverse@^7.16.5", "@babel/traverse@^7.7.4": +"@babel/traverse@^7.16.5": version "7.16.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.5.tgz#d7d400a8229c714a59b87624fc67b0f1fbd4b2b3" integrity sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ== @@ -319,42 +237,11 @@ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@types/json-schema@^7.0.7": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= - "@types/node@17.0.5": version "17.0.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0" @@ -370,76 +257,6 @@ resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.63.1.tgz#b40f9f18055e2c9498ae543d18c59fbd6ef2e8a3" integrity sha512-Z+ZqjRcnGfHP86dvx/BtSwWyZPKQ/LBdmAVImY82TphyjOw2KgTKcp7Nx92oNwCTsHzlshwexAG/WiY2JuUm3g== -"@typescript-eslint/eslint-plugin@^4.19.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" - integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== - dependencies: - "@typescript-eslint/experimental-utils" "4.33.0" - "@typescript-eslint/scope-manager" "4.33.0" - debug "^4.3.1" - functional-red-black-tree "^1.0.1" - ignore "^5.1.8" - regexpp "^3.1.0" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/experimental-utils@4.33.0", "@typescript-eslint/experimental-utils@^4.0.1": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== - dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/parser@^4.19.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" - integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== - dependencies: - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - debug "^4.3.1" - -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== - -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== - dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" - acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -511,40 +328,6 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -array-includes@^3.1.3, array-includes@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" - integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - get-intrinsic "^1.1.1" - is-string "^1.0.7" - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -array.prototype.flat@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" - integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - -array.prototype.flatmap@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446" - integrity sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.19.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -563,7 +346,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.1, braces@~3.0.2: +braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -575,40 +358,16 @@ browser-stdout@1.3.1: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.17.5: - version "4.19.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3" - integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== - dependencies: - caniuse-lite "^1.0.30001286" - electron-to-chromium "^1.4.17" - escalade "^3.1.1" - node-releases "^2.0.1" - picocolors "^1.0.0" - buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -caniuse-lite@^1.0.30001286: - version "1.0.30001292" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz#4a55f61c06abc9595965cfd77897dc7bc1cdc456" - integrity sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw== - chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -680,7 +439,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -convert-source-map@^1.1.0, convert-source-map@^1.7.0: +convert-source-map@^1.1.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== @@ -703,21 +462,14 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: version "4.3.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" -debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.1.0, debug@^3.2.7: +debug@^3.1.0: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -729,32 +481,11 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -762,11 +493,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.17: - version "1.4.27" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.27.tgz#bfc6e798d8a56a17d658312f4b7ae1a7ca87724f" - integrity sha512-uZ95szi3zUbzRDx1zx/xnsCG+2xgZyy57pDOeaeO4r8zx5Dqe8Jv1ti8cunvBwJHVI5LzPuw8umKwZb3WKYxSQ== - enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -774,41 +500,6 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -es-abstract@^1.19.0, es-abstract@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - es6-promise@^4.0.3: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" @@ -821,11 +512,6 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -836,160 +522,11 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^8.1.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" - integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== - -eslint-config-satya164@3.1.10: - version "3.1.10" - resolved "https://registry.yarnpkg.com/eslint-config-satya164/-/eslint-config-satya164-3.1.10.tgz#26a8b7df0fa67cc9222cac7f315ce33830f519df" - integrity sha512-7fiPBr04CGKRfnllJMXiwJnBaALQ3kx8l/V+Ft+1ENo4uyOAzqrRQp3v9X59DCpXWyUt7rvWwWn4hTDUucF0tQ== - dependencies: - "@babel/core" "^7.13.10" - "@babel/eslint-parser" "^7.13.10" - "@typescript-eslint/eslint-plugin" "^4.19.0" - "@typescript-eslint/parser" "^4.19.0" - eslint-config-prettier "^8.1.0" - eslint-plugin-babel "^5.3.1" - eslint-plugin-eslint-comments "^3.2.0" - eslint-plugin-flowtype "^5.4.0" - eslint-plugin-import "^2.22.1" - eslint-plugin-jest "^24.3.2" - eslint-plugin-prettier "^3.3.1" - eslint-plugin-react "^7.23.0" - eslint-plugin-react-hooks "^4.2.0" - eslint-plugin-react-native "^3.10.0" - -eslint-import-resolver-node@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" - integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== - dependencies: - debug "^3.2.7" - resolve "^1.20.0" - -eslint-module-utils@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" - integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== - dependencies: - debug "^3.2.7" - find-up "^2.1.0" - pkg-dir "^2.0.0" - -eslint-plugin-babel@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.1.tgz#75a2413ffbf17e7be57458301c60291f2cfbf560" - integrity sha512-VsQEr6NH3dj664+EyxJwO4FCYm/00JhYb3Sk3ft8o+fpKuIfQ9TaW6uVUfvwMXHcf/lsnRIoyFPsLMyiWCSL/g== - dependencies: - eslint-rule-composer "^0.3.0" - -eslint-plugin-eslint-comments@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz#9e1cd7b4413526abb313933071d7aba05ca12ffa" - integrity sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ== - dependencies: - escape-string-regexp "^1.0.5" - ignore "^5.0.5" - -eslint-plugin-flowtype@^5.4.0: - version "5.10.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.10.0.tgz#7764cc63940f215bf3f0bd2d9a1293b2b9b2b4bb" - integrity sha512-vcz32f+7TP+kvTUyMXZmCnNujBQZDNmcqPImw8b9PZ+16w1Qdm6ryRuYZYVaG9xRqqmAPr2Cs9FAX5gN+x/bjw== - dependencies: - lodash "^4.17.15" - string-natural-compare "^3.0.1" - -eslint-plugin-import@^2.22.1: - version "2.25.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766" - integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg== - dependencies: - array-includes "^3.1.4" - array.prototype.flat "^1.2.5" - debug "^2.6.9" - doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.7.1" - has "^1.0.3" - is-core-module "^2.8.0" - is-glob "^4.0.3" - minimatch "^3.0.4" - object.values "^1.1.5" - resolve "^1.20.0" - tsconfig-paths "^3.11.0" - -eslint-plugin-jest@^24.3.2: - version "24.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.7.0.tgz#206ac0833841e59e375170b15f8d0955219c4889" - integrity sha512-wUxdF2bAZiYSKBclsUMrYHH6WxiBreNjyDxbRv345TIvPeoCEgPNEn3Sa+ZrSqsf1Dl9SqqSREXMHExlMMu1DA== - dependencies: - "@typescript-eslint/experimental-utils" "^4.0.1" - -eslint-plugin-prettier@^3.3.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" - integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-plugin-react-hooks@^4.2.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz#318dbf312e06fab1c835a4abef00121751ac1172" - integrity sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA== - -eslint-plugin-react-native-globals@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz#ee1348bc2ceb912303ce6bdbd22e2f045ea86ea2" - integrity sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g== - -eslint-plugin-react-native@^3.10.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-native/-/eslint-plugin-react-native-3.11.0.tgz#c73b0886abb397867e5e6689d3a6a418682e6bac" - integrity sha512-7F3OTwrtQPfPFd+VygqKA2VZ0f2fz0M4gJmry/TRE18JBb94/OtMxwbL7Oqwu7FGyrdeIOWnXQbBAveMcSTZIA== - dependencies: - "@babel/traverse" "^7.7.4" - eslint-plugin-react-native-globals "^0.1.1" - -eslint-plugin-react@^7.23.0: - version "7.28.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf" - integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw== - dependencies: - array-includes "^3.1.4" - array.prototype.flatmap "^1.2.5" - doctrine "^2.1.0" - estraverse "^5.3.0" - jsx-ast-utils "^2.4.1 || ^3.0.0" - minimatch "^3.0.4" - object.entries "^1.1.5" - object.fromentries "^2.0.5" - object.hasown "^1.1.0" - object.values "^1.1.5" - prop-types "^15.7.2" - resolve "^2.0.0-next.3" - semver "^6.3.0" - string.prototype.matchall "^4.0.6" - eslint-plugin-simple-import-sort@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz#a1dad262f46d2184a90095a60c66fef74727f0f8" integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw== -eslint-rule-composer@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" - integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - eslint-scope@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" @@ -1005,7 +542,7 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: +eslint-visitor-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== @@ -1082,12 +619,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: +estraverse@^5.1.0, estraverse@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -1102,22 +634,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-glob@^3.1.1: - version "3.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -1128,13 +644,6 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -1149,13 +658,6 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -1184,52 +686,25 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" + is-glob "^4.0.3" -glob-parent@^5.1.2, glob-parent@~5.1.2: +glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob-parent@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -1266,28 +741,11 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" -globby@^11.0.3: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -1298,25 +756,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -1360,11 +799,6 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.5, ignore@^5.1.4, ignore@^5.1.8: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== - import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -1391,22 +825,6 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -1414,33 +832,6 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - -is-core-module@^2.2.0, is-core-module@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" - integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== - dependencies: - has "^1.0.3" - -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -1453,63 +844,17 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-negative-zero@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" - integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== - -is-number-object@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== - dependencies: - has-tostringtag "^1.0.0" - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - -is-weakref@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" - integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== - dependencies: - call-bind "^1.0.2" - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: +js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== @@ -1536,28 +881,6 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - -"jsx-ast-utils@^2.4.1 || ^3.0.0": - version "3.2.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b" - integrity sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA== - dependencies: - array-includes "^3.1.3" - object.assign "^4.1.2" - levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -1566,31 +889,11 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.17.15: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -loose-envify@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -1606,19 +909,6 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -1631,11 +921,6 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - mkdirp@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -1680,76 +965,11 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -node-releases@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" - integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" - integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== - -object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.entries@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" - integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -object.fromentries@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" - integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -object.hasown@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.0.tgz#7232ed266f34d197d15cac5880232f7a4790afe5" - integrity sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.19.1" - -object.values@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" - integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1769,25 +989,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -1795,11 +996,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -1810,22 +1006,7 @@ path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: +picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== @@ -1835,25 +1016,11 @@ pify@^4.0.1: resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - prettier@2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" @@ -1864,30 +1031,11 @@ progress@^2.0.0: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -prop-types@^15.7.2: - version "15.8.0" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.0.tgz#d237e624c45a9846e469f5f31117f970017ff588" - integrity sha512-fDGekdaHh65eI3lMi5OnErU6a8Ighg2KjcjQxO7m8VHyWjcPyj5kiOgV1LQDOOOgVy3+5FgjXvdSSX7B8/5/4g== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.13.1" - punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -react-is@^16.13.1: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" - integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -1895,15 +1043,7 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -regexp.prototype.flags@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" - integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -regexpp@^3.1.0, regexpp@^3.2.0: +regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -1913,27 +1053,6 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@^1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -resolve@^2.0.0-next.3: - version "2.0.0-next.3" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" - integrity sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -1941,13 +1060,6 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -1958,12 +1070,7 @@ semver@^5.4.1, semver@^5.6.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.2.1, semver@^7.3.5: +semver@^7.2.1: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -1982,25 +1089,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - source-map-support@^0.5.0: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -2019,41 +1112,6 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -string-natural-compare@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" - integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== - -string.prototype.matchall@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa" - integrity sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - get-intrinsic "^1.1.1" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - regexp.prototype.flags "^1.3.1" - side-channel "^1.0.4" - -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -2061,11 +1119,6 @@ strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -2109,28 +1162,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tsconfig-paths@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" - integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== - dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.1" - minimist "^1.2.0" - strip-bom "^3.0.0" - -tslib@^1.8.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -2148,16 +1179,6 @@ typescript@4.5.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -2191,17 +1212,6 @@ vscode@1.1.37: source-map-support "^0.5.0" vscode-test "^0.4.1" -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" From 92b35ee2de1bc4f2ab116882df4153b126d48cdb Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 31 Dec 2021 00:22:12 +0100 Subject: [PATCH 083/110] refactor: eslint --- .eslintrc.js | 287 ++++++++++- package.json | 14 +- src/generateSnippets.ts | 66 +-- src/helpers.ts | 43 +- src/index.ts | 14 +- src/snippetSearch.ts | 18 +- src/sourceSnippets/components.ts | 245 ++++----- src/sourceSnippets/console.ts | 126 ++--- src/sourceSnippets/hooks.ts | 90 ++-- src/sourceSnippets/imports.ts | 164 +++--- src/sourceSnippets/others.ts | 466 ++++++++--------- src/sourceSnippets/propTypes.ts | 308 ++++++------ src/sourceSnippets/reactNative.ts | 139 +++--- src/sourceSnippets/redux.ts | 108 ++-- src/sourceSnippets/sharedSnippets.ts | 58 +-- src/sourceSnippets/tests.ts | 168 +++---- src/sourceSnippets/typescript.ts | 189 +++---- src/types.ts | 14 +- yarn.lock | 718 ++++++++++++++++++++++++++- 19 files changed, 2099 insertions(+), 1136 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f08e7d2..9ad9f12 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,35 +1,286 @@ +const path = require('path'); + module.exports = { env: { es6: true, + browser: true, node: true, - jest: true, }, - plugins: ["simple-import-sort"], + parserOptions: { + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + + extends: ['eslint-config-prettier'], + + plugins: [ + 'babel', + 'eslint-comments', + 'import', + 'prettier', + 'simple-import-sort', + ], rules: { - "babel/no-unused-expressions": "off", - "import/extensions": "off", - "import/named": "off", - "import/no-unresolved": "off", + 'array-callback-return': 'error', + 'babel/no-invalid-this': 'error', + 'babel/valid-typeof': 'error', + 'constructor-super': 'error', + 'default-case': ['error', { commentPattern: '^no default$' }], + 'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }], + 'eslint-comments/no-aggregating-enable': 'error', + 'eslint-comments/no-duplicate-disable': 'error', + 'eslint-comments/no-unlimited-disable': 'error', + 'eslint-comments/no-unused-disable': 'error', + 'eslint-comments/no-unused-enable': 'error', + 'for-direction': 'error', + 'getter-return': 'error', + 'import/export': 'error', + 'import/extensions': 'off', + 'import/imports-first': 'error', + 'import/named': 'off', + 'import/no-amd': 'error', + 'import/no-commonjs': 'error', + 'import/no-duplicates': 'error', + 'import/no-extraneous-dependencies': 'error', + 'import/no-self-import': 'error', + 'new-parens': 'error', + 'no-array-constructor': 'error', + 'no-caller': 'error', + 'no-case-declarations': 'error', + 'no-class-assign': 'error', + 'no-compare-neg-zero': 'error', + 'no-cond-assign': ['error', 'except-parens'], + 'no-const-assign': 'error', + 'no-constant-condition': 'error', + 'no-control-regex': 'error', + 'no-delete-var': 'error', + 'no-dupe-args': 'error', + 'no-dupe-class-members': 'error', + 'no-dupe-keys': 'error', + 'no-duplicate-case': 'error', + 'no-empty': 'error', + 'no-empty-character-class': 'error', + 'no-empty-pattern': 'error', + 'no-eval': 'error', + 'no-ex-assign': 'error', + 'no-extend-native': 'error', + 'no-extra-bind': 'error', + 'no-extra-boolean-cast': 'error', + 'no-extra-label': 'error', + 'no-extra-semi': 'error', + 'no-fallthrough': 'error', + 'no-func-assign': 'error', + 'no-global-assign': 'error', + 'no-implied-eval': 'error', + 'no-inner-declarations': 'error', + 'no-invalid-regexp': 'error', + 'no-iterator': 'error', + 'no-label-var': 'error', + 'no-labels': ['error', { allowLoop: true, allowSwitch: false }], + 'no-lone-blocks': 'error', + 'no-loop-func': 'error', + 'no-misleading-character-class': 'error', + 'no-multi-str': 'error', + 'no-new-func': 'error', + 'no-new-object': 'error', + 'no-new-symbol': 'error', + 'no-new-wrappers': 'error', + 'no-obj-calls': 'error', + 'no-octal': 'error', + 'no-octal-escape': 'error', + 'no-redeclare': 'error', + 'no-regex-spaces': 'error', + 'no-self-assign': 'error', + 'no-self-compare': 'error', + 'no-shadow-restricted-names': 'error', + 'no-sparse-arrays': 'error', + 'no-this-before-super': 'error', + 'no-throw-literal': 'error', + 'no-undef': 'error', + 'no-unexpected-multiline': 'error', + 'no-unreachable': 'error', + 'no-unsafe-finally': 'error', + 'no-unsafe-negation': 'error', + 'no-unused-labels': 'error', + 'no-unused-vars': 'error', + 'no-use-before-define': [ + 'error', + { functions: false, classes: false, variables: false }, + ], + 'no-useless-computed-key': 'error', + 'no-useless-concat': 'error', + 'no-useless-constructor': 'error', + 'no-useless-escape': 'error', + 'no-useless-rename': 'error', + 'no-with': 'error', + 'require-yield': 'error', + 'simple-import-sort/exports': 'error', + 'unicode-bom': 'error', + 'use-isnan': 'error', + eqeqeq: ['error', 'smart'], - "simple-import-sort/exports": "error", - "simple-import-sort/imports": [ - "error", + 'import/no-unresolved': [ + 'error', { - groups: [ - // Side effect imports. - ["^\\u0000"], - // Packages. - ["^@?\\w"], - ["^../"], - ["^./"], - ], + caseSensitive: false, + ignore: ['vscode'], + }, + ], + 'prettier/prettier': [ + 'error', + { + bracketSameLine: false, + bracketSpacing: true, + printWidth: 80, + semi: true, + singleQuote: true, + tabWidth: 2, + trailingComma: 'all', + useTabs: false, + endOfLine: 'auto', }, ], + 'simple-import-sort/imports': [ + 'error', + { groups: [['^\\u0000'], ['^@?\\w'], ['^~/'], ['^../'], ['^./']] }, + ], }, + overrides: [ + { + files: ['*.ts', '*.tsx'], + parser: require.resolve('@typescript-eslint/parser'), + plugins: ['@typescript-eslint/eslint-plugin'], + settings: { + 'import/extensions': ['.js', '.ts', '.tsx'], + 'import/parsers': { + '@typescript-eslint/parser': ['.ts', '.tsx'], + }, + 'import/resolver': { + node: { + extensions: ['.js', '.ts', '.tsx'], + }, + }, + }, + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/consistent-type-assertions': [ + 'error', + { assertionStyle: 'as' }, + ], + '@typescript-eslint/member-delimiter-style': 'error', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + '@typescript-eslint/no-empty-interface': [ + 'error', + { allowSingleExtends: true }, + ], + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_' }, + ], + '@typescript-eslint/no-use-before-define': [ + 'error', + { + functions: false, + classes: false, + variables: false, + typedefs: false, + }, + ], + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/unified-signatures': 'error', + + 'default-case': 'off', + 'no-dupe-class-members': 'off', + 'no-undef': 'off', + 'no-unused-vars': 'off', + 'no-array-constructor': 'off', + 'no-use-before-define': 'off', + }, + }, + { + plugins: ['jest'], + files: ['*.{spec,test}.{js,ts,tsx}', '**/__tests__/**/*.{js,ts,tsx}'], + env: { + jest: true, + }, + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { devDependencies: true }, + ], + 'jest/consistent-test-it': ['error', { fn: 'test' }], + 'jest/expect-expect': [ + 'error', + { assertFunctionNames: ['expect', 'element'] }, + ], + 'jest/no-disabled-tests': 'error', + 'jest/no-duplicate-hooks': 'error', + 'jest/no-export': 'error', + 'jest/no-focused-tests': 'error', + 'jest/no-identical-title': 'error', + 'jest/no-jasmine-globals': 'error', + 'jest/no-test-prefixes': 'error', + 'jest/no-test-return-statement': 'error', + 'jest/prefer-todo': 'error', + 'jest/require-to-throw-message': 'error', + 'jest/valid-describe-callback': 'error', + 'jest/valid-expect-in-promise': 'error', + 'jest/valid-expect': 'error', + 'jest/valid-title': 'error', + 'jest/no-restricted-matchers': [ + 'error', + { + toBeTruthy: 'Avoid `toBeTruthy`', + toBeFalsy: 'Avoid `toBeFalsy`', + }, + ], + }, + }, + { + files: ['*.js'], + parser: require.resolve('@babel/eslint-parser'), + parserOptions: { + requireConfigFile: false, + }, + rules: { + 'import/default': 'error', + 'import/namespace': 'error', + 'import/no-named-as-default': 'error', + 'import/no-named-as-default-member': 'error', + 'import/no-cycle': 'error', + 'import/no-deprecated': 'error', + }, + }, + { + files: ['*.config.js', '.*rc.js'], + env: { + node: true, + }, + rules: { + 'import/no-commonjs': 'off', + 'import/no-extraneous-dependencies': [ + 'error', + { devDependencies: true }, + ], + }, + }, + ], globals: { - __DEV__: true, jasmine: true, }, }; diff --git a/package.json b/package.json index cb5879c..fa7a188 100644 --- a/package.json +++ b/package.json @@ -114,11 +114,20 @@ }, "devDependencies": { "@babel/cli": "7.16.0", + "@babel/eslint-parser": "7.16.5", "@babel/preset-typescript": "7.16.5", "@types/node": "17.0.5", "@types/prettier": "2.4.2", "@types/vscode": "1.63.1", + "@typescript-eslint/eslint-plugin": "5.8.1", + "@typescript-eslint/parser": "5.8.1", "eslint": "8.5.0", + "eslint-config-prettier": "8.3.0", + "eslint-plugin-babel": "5.3.1", + "eslint-plugin-eslint-comments": "3.2.0", + "eslint-plugin-import": "2.25.3", + "eslint-plugin-jest": "25.3.3", + "eslint-plugin-prettier": "4.0.0", "eslint-plugin-simple-import-sort": "7.0.0", "prettier": "2.5.1", "typescript": "4.5.4" @@ -128,9 +137,10 @@ "bracketSpacing": true, "printWidth": 80, "semi": true, - "singleQuote": false, + "singleQuote": true, "tabWidth": 2, "trailingComma": "all", - "useTabs": false + "useTabs": false, + "endOfLine": "auto" } } diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index acc357a..e48ea9d 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -1,35 +1,35 @@ -import { workspace } from "vscode"; -import { writeFileSync } from "fs"; +import { writeFileSync } from 'fs'; +import { workspace } from 'vscode'; -import hooksSnippets, { HooksSnippet } from "./sourceSnippets/hooks"; -import importsSnippets, { ImportsSnippet } from "./sourceSnippets/imports"; -import reactNativeSnippets, { - ReactNativeSnippet, -} from "./sourceSnippets/reactNative"; -import typescriptSnippets, { - TypescriptSnippet, -} from "./sourceSnippets/typescript"; -import { ExtensionSettings, replaceSnippetPlaceholders } from "./helpers"; -import reduxSnippets, { ReduxSnippet } from "./sourceSnippets/redux"; +import { ExtensionSettings, replaceSnippetPlaceholders } from './helpers'; import componentsSnippets, { ComponentsSnippet, -} from "./sourceSnippets/components"; -import consoleSnippets, { ConsoleSnippet } from "./sourceSnippets/console"; +} from './sourceSnippets/components'; +import consoleSnippets, { ConsoleSnippet } from './sourceSnippets/console'; +import hooksSnippets, { HooksSnippet } from './sourceSnippets/hooks'; +import importsSnippets, { ImportsSnippet } from './sourceSnippets/imports'; import propTypesSnippets, { PropTypesSnippet, -} from "./sourceSnippets/propTypes"; -import testsSnippets, { TestsSnippet } from "./sourceSnippets/tests"; +} from './sourceSnippets/propTypes'; +import reactNativeSnippets, { + ReactNativeSnippet, +} from './sourceSnippets/reactNative'; +import reduxSnippets, { ReduxSnippet } from './sourceSnippets/redux'; +import testsSnippets, { TestsSnippet } from './sourceSnippets/tests'; +import typescriptSnippets, { + TypescriptSnippet, +} from './sourceSnippets/typescript'; type SnippetKeys = - | HooksSnippet["key"] - | ImportsSnippet["key"] - | ReactNativeSnippet["key"] - | TypescriptSnippet["key"] - | ReduxSnippet["key"] - | ComponentsSnippet["key"] - | ConsoleSnippet["key"] - | PropTypesSnippet["key"] - | TestsSnippet["key"]; + | HooksSnippet['key'] + | ImportsSnippet['key'] + | ReactNativeSnippet['key'] + | TypescriptSnippet['key'] + | ReduxSnippet['key'] + | ComponentsSnippet['key'] + | ConsoleSnippet['key'] + | PropTypesSnippet['key'] + | TestsSnippet['key']; type Snippets = { [key in SnippetKeys]: @@ -52,7 +52,7 @@ const getSnippets = () => { } const config = workspace.getConfiguration( - "esReactSnippets", + 'esReactSnippets', ) as unknown as ExtensionSettings; const snippets: Snippets = [ @@ -79,12 +79,14 @@ const getSnippets = () => { return jsonSnippets; }; -const generateSnippets = () => { - console.time("generate"); - const jsonSnippets = getSnippets(); - console.timeEnd("generate"); +const generateSnippets = () => + new Promise((resolve) => { + console.time('generate'); + const jsonSnippets = getSnippets(); + console.timeEnd('generate'); - writeFileSync(__dirname + "/snippets/generated.json", jsonSnippets); -}; + writeFileSync(__dirname + '/snippets/generated.json', jsonSnippets); + return resolve(true); + }); export default generateSnippets; diff --git a/src/helpers.ts b/src/helpers.ts index 3a0eeb4..b9a8ff9 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,6 +1,7 @@ -import prettier, { Options } from "prettier"; -import { workspace } from "vscode"; -import { SnippetPlaceholders } from "./types"; +import prettier, { Options } from 'prettier'; +import { workspace } from 'vscode'; + +import { SnippetPlaceholders } from './types'; export type ExtensionSettings = { prettierEnabled: boolean; @@ -9,7 +10,7 @@ export type ExtensionSettings = { quotes: boolean; typescript: boolean; tabWidth: number; - typescriptComponentPropsStatePrefix: "type" | "interface"; + typescriptComponentPropsStatePrefix: 'type' | 'interface'; }; export const replaceSnippetPlaceholders = ( @@ -18,35 +19,35 @@ export const replaceSnippetPlaceholders = ( ) => String(snippetString) .replace( - new RegExp(SnippetPlaceholders.FileName, "g"), - "${1:${TM_FILENAME_BASE}}", + new RegExp(SnippetPlaceholders.FileName, 'g'), + '${1:${TM_FILENAME_BASE}}', ) - .replace(new RegExp(SnippetPlaceholders.FirstTab, "g"), "${1:first}") - .replace(new RegExp(SnippetPlaceholders.SecondTab, "g"), "${2:second}") - .replace(new RegExp(SnippetPlaceholders.ThirdTab, "g"), "${3:third}") - .replace(new RegExp(SnippetPlaceholders.LastTab, "g"), "$0") + .replace(new RegExp(SnippetPlaceholders.FirstTab, 'g'), '${1:first}') + .replace(new RegExp(SnippetPlaceholders.SecondTab, 'g'), '${2:second}') + .replace(new RegExp(SnippetPlaceholders.ThirdTab, 'g'), '${3:third}') + .replace(new RegExp(SnippetPlaceholders.LastTab, 'g'), '$0') .replace( - new RegExp(SnippetPlaceholders.TypeInterface, "g"), - extensionConfig.typescriptComponentPropsStatePrefix || "type", + new RegExp(SnippetPlaceholders.TypeInterface, 'g'), + extensionConfig.typescriptComponentPropsStatePrefix || 'type', ); export const revertSnippetPlaceholders = (snippetString: string) => String(snippetString) .replace( - new RegExp(/\${1:${TM_FILENAME_BASE}}/, "g"), + new RegExp(/\${1:\${TM_FILENAME_BASE}}/, 'g'), SnippetPlaceholders.FileName, ) - .replace(new RegExp(/\${1:first}/, "g"), SnippetPlaceholders.FirstTab) - .replace(new RegExp(/\${2:second}/, "g"), SnippetPlaceholders.SecondTab) - .replace(new RegExp(/\${3:third}/, "g"), SnippetPlaceholders.ThirdTab) - .replace(new RegExp(/\$0/, "g"), SnippetPlaceholders.LastTab); + .replace(new RegExp(/\${1:first}/, 'g'), SnippetPlaceholders.FirstTab) + .replace(new RegExp(/\${2:second}/, 'g'), SnippetPlaceholders.SecondTab) + .replace(new RegExp(/\${3:third}/, 'g'), SnippetPlaceholders.ThirdTab) + .replace(new RegExp(/\$0/, 'g'), SnippetPlaceholders.LastTab); export const getPrettierConfig = async (): Promise => { const settings = workspace.getConfiguration( - "esReactSnippets.settings", + 'esReactSnippets.settings', ) as unknown as ExtensionSettings; - const prettierConfig = await prettier.resolveConfig("", { + const prettierConfig = await prettier.resolveConfig('', { editorconfig: true, }); @@ -66,10 +67,10 @@ export const parseSnippet = async (snippet: { body: string | string[]; }) => { const workspaceConfig = workspace.getConfiguration( - "esReactSnippets", + 'esReactSnippets', ) as unknown as ExtensionSettings; const snippetBody = - typeof snippet.body === "string" ? snippet.body : snippet.body.join("\n"); + typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); const prettierConfig = await getPrettierConfig(); const parsedBody = prettier.format( diff --git a/src/index.ts b/src/index.ts index dfbd723..ae23275 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,16 +1,16 @@ -import { commands, ExtensionContext } from "vscode"; +import { commands, ExtensionContext } from 'vscode'; -import snippetSearch from "./snippetSearch"; -import generateSnippets from "./generateSnippets"; +import generateSnippets from './generateSnippets'; +import snippetSearch from './snippetSearch'; + +export async function activate(context: ExtensionContext) { + await generateSnippets(); -export function activate(context: ExtensionContext) { const snippetSearchCommand = commands.registerCommand( - "esReactSnippets.search", + 'esReactSnippets.search', snippetSearch, ); - generateSnippets(); - context.subscriptions.push(snippetSearchCommand); } diff --git a/src/snippetSearch.ts b/src/snippetSearch.ts index f0b76c7..715996e 100644 --- a/src/snippetSearch.ts +++ b/src/snippetSearch.ts @@ -1,18 +1,20 @@ -import { SnippetString, window } from "vscode"; +import { SnippetString, window } from 'vscode'; -import { parseSnippet } from "./helpers"; -import snippets from "./snippets/generated.json"; +import { parseSnippet } from './helpers'; +import snippets from './snippets/generated.json'; const snippetSearch = async () => { const { showQuickPick, activeTextEditor } = window; - const snippetsArray = Object.entries(snippets); + const snippetsArray = Object.entries(snippets) as [ + string, + { prefix: string; body: string[]; description?: string }, + ][]; const items = snippetsArray.map( - // @ts-expect-error ([shortDescription, { prefix: label, body, description }], id) => ({ body, - description, + description: description || shortDescription, id, label, value: label, @@ -22,10 +24,10 @@ const snippetSearch = async () => { const rawSnippet = await showQuickPick(items, { matchOnDescription: true, matchOnDetail: true, - placeHolder: "Search snippet by prefix or description", + placeHolder: 'Search snippet by prefix or description', }); - const body = rawSnippet ? await parseSnippet(rawSnippet) : ""; + const body = rawSnippet ? await parseSnippet(rawSnippet) : ''; if (activeTextEditor) { activeTextEditor.insertSnippet(new SnippetString(body)); diff --git a/src/sourceSnippets/components.ts b/src/sourceSnippets/components.ts index eecde14..778914e 100644 --- a/src/sourceSnippets/components.ts +++ b/src/sourceSnippets/components.ts @@ -1,4 +1,7 @@ +import { SnippetMapping, SnippetPlaceholders } from '../types'; + import { + exportDefault, innerComponent, innerComponentReturn, react, @@ -9,320 +12,318 @@ import { reactWithMemo, reactWithReduxConnect, reduxComponentExport, - exportDefault, -} from "./sharedSnippets"; -import { SnippetPlaceholders, SnippetMapping } from "../types"; +} from './sharedSnippets'; type ComponentMappings = { - reactArrowFunctionComponent: "rafc"; - reactArrowFunctionComponentWithPropTypes: "rafcp"; - reactArrowFunctionExportComponent: "rafce"; - reactClassComponentPropTypes: "rccp"; - reactClassComponentRedux: "rcredux"; - reactClassComponentReduxPropTypes: "rcreduxp"; - reactClassComponent: "rcc"; - reactClassExportComponent: "rce"; - reactClassExportComponentWithPropTypes: "rcep"; - reactClassExportPureComponent: "rpce"; - reactClassPureComponent: "rpc"; - reactClassPureComponentWithPropTypes: "rpcp"; - reactFunctionMemoComponent: "rmc"; - reactFunctionMemoComponentWithPropTypes: "rmcp"; - reactFunctionalComponentRedux: "rfcredux"; - reactFunctionalComponentReduxPropTypes: "rfcreduxp"; - reactFunctionalComponent: "rfc"; - reactFunctionalComponentWithPropTypes: "rfcp"; - reactFunctionalExportComponent: "rfce"; + reactArrowFunctionComponent: 'rafc'; + reactArrowFunctionComponentWithPropTypes: 'rafcp'; + reactArrowFunctionExportComponent: 'rafce'; + reactClassComponentPropTypes: 'rccp'; + reactClassComponentRedux: 'rcredux'; + reactClassComponentReduxPropTypes: 'rcreduxp'; + reactClassComponent: 'rcc'; + reactClassExportComponent: 'rce'; + reactClassExportComponentWithPropTypes: 'rcep'; + reactClassExportPureComponent: 'rpce'; + reactClassPureComponent: 'rpc'; + reactClassPureComponentWithPropTypes: 'rpcp'; + reactFunctionMemoComponent: 'rmc'; + reactFunctionMemoComponentWithPropTypes: 'rmcp'; + reactFunctionalComponentRedux: 'rfcredux'; + reactFunctionalComponentReduxPropTypes: 'rfcreduxp'; + reactFunctionalComponent: 'rfc'; + reactFunctionalComponentWithPropTypes: 'rfcp'; + reactFunctionalExportComponent: 'rfce'; }; export type ComponentsSnippet = SnippetMapping; const reactClassComponent: ComponentsSnippet = { - key: "reactClassComponent", - prefix: "rcc", + key: 'reactClassComponent', + prefix: 'rcc', body: [ ...reactComponent, `export default class ${SnippetPlaceholders.FileName} extends Component {`, ...innerComponentReturn, - "}", - "", + '}', + '', ], - description: "Creates a React component class with ES7 module system", + description: 'Creates a React component class with ES7 module system', }; const reactClassExportComponent: ComponentsSnippet = { - key: "reactClassExportComponent", - prefix: "rce", + key: 'reactClassExportComponent', + prefix: 'rce', body: [ ...reactComponent, `export class ${SnippetPlaceholders.FileName} extends Component {`, ...innerComponentReturn, - "}", + '}', ...exportDefault, ], - description: "Creates a React component class with ES7 module system", + description: 'Creates a React component class with ES7 module system', }; const reactFunctionalExportComponent: ComponentsSnippet = { - key: "reactFunctionalExportComponent", - prefix: "rfce", + key: 'reactFunctionalExportComponent', + prefix: 'rfce', body: [ ...react, `function ${SnippetPlaceholders.FileName}() {`, ...innerComponent, - "}", + '}', ...exportDefault, ], - description: "Creates a React Functional Component with ES7 module system", + description: 'Creates a React Functional Component with ES7 module system', }; const reactFunctionalComponent: ComponentsSnippet = { - key: "reactFunctionalComponent", - prefix: "rfc", + key: 'reactFunctionalComponent', + prefix: 'rfc', body: [ ...react, `export default function ${SnippetPlaceholders.FileName}() {`, ...innerComponent, - "}", - "", + '}', + '', ], - description: "Creates a React Functional Component with ES7 module system", + description: 'Creates a React Functional Component with ES7 module system', }; const reactFunctionalComponentWithPropTypes: ComponentsSnippet = { - key: "reactFunctionalComponentWithPropTypes", - prefix: "rfcp", + key: 'reactFunctionalComponentWithPropTypes', + prefix: 'rfcp', body: [ ...reactPropTypes, `function ${SnippetPlaceholders.FileName}(props) {`, ...innerComponent, - "}", - "", + '}', + '', `${SnippetPlaceholders.FileName}.propTypes = {}`, ...exportDefault, - "", + '', ], description: - "Creates a React Functional Component with ES7 module system with PropTypes", + 'Creates a React Functional Component with ES7 module system with PropTypes', }; const reactArrowFunctionExportComponent: ComponentsSnippet = { - key: "reactArrowFunctionExportComponent", - prefix: "rafce", + key: 'reactArrowFunctionExportComponent', + prefix: 'rafce', body: [ ...react, `const ${SnippetPlaceholders.FileName} = () => {`, ...innerComponent, - "}", + '}', ...exportDefault, ], description: - "Creates a React Arrow Function Component with ES7 module system", + 'Creates a React Arrow Function Component with ES7 module system', }; const reactArrowFunctionComponent: ComponentsSnippet = { - key: "reactArrowFunctionComponent", - prefix: "rafc", + key: 'reactArrowFunctionComponent', + prefix: 'rafc', body: [ ...react, `export const ${SnippetPlaceholders.FileName} = () => {`, ...innerComponent, - "}", - "", + '}', + '', ], description: - "Creates a React Arrow Function Component with ES7 module system", + 'Creates a React Arrow Function Component with ES7 module system', }; const reactArrowFunctionComponentWithPropTypes: ComponentsSnippet = { - key: "reactArrowFunctionComponentWithPropTypes", - prefix: "rafcp", + key: 'reactArrowFunctionComponentWithPropTypes', + prefix: 'rafcp', body: [ ...reactPropTypes, `const ${SnippetPlaceholders.FileName} = props => {`, ...innerComponent, - "}", - "", + '}', + '', `${SnippetPlaceholders.FileName}.propTypes = {}`, ...exportDefault, ], description: - "Creates a React Arrow Function Component with ES7 module system with PropTypes", + 'Creates a React Arrow Function Component with ES7 module system with PropTypes', }; const reactClassExportComponentWithPropTypes: ComponentsSnippet = { - key: "reactClassExportComponentWithPropTypes", - prefix: "rcep", + key: 'reactClassExportComponentWithPropTypes', + prefix: 'rcep', body: [ "import PropTypes from 'prop-types'", ...reactComponent, `export class ${SnippetPlaceholders.FileName} extends Component {`, - " static propTypes = {}", - "", + ' static propTypes = {}', + '', ...innerComponentReturn, - "}", + '}', ...exportDefault, ], - description: "Creates a React component class with ES7 module system", + description: 'Creates a React component class with ES7 module system', }; const reactClassPureComponent: ComponentsSnippet = { - key: "reactClassPureComponent", - prefix: "rpc", + key: 'reactClassPureComponent', + prefix: 'rpc', body: [ ...reactPureComponent, `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, ...innerComponentReturn, - "}", - "", + '}', + '', ], - description: "Creates a React pure component class with ES7 module system", + description: 'Creates a React pure component class with ES7 module system', }; const reactClassExportPureComponent: ComponentsSnippet = { - key: "reactClassExportPureComponent", - prefix: "rpce", + key: 'reactClassExportPureComponent', + prefix: 'rpce', body: [ ...reactPureComponent, `export class ${SnippetPlaceholders.FileName} extends PureComponent {`, ...innerComponentReturn, - "}", + '}', ...exportDefault, ], description: - "Creates a React pure component class with ES7 module system export", + 'Creates a React pure component class with ES7 module system export', }; const reactClassPureComponentWithPropTypes: ComponentsSnippet = { - key: "reactClassPureComponentWithPropTypes", - prefix: "rpcp", + key: 'reactClassPureComponentWithPropTypes', + prefix: 'rpcp', body: [ "import PropTypes from 'prop-types'", ...reactPureComponent, `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, - " static propTypes = {}", - "", + ' static propTypes = {}', + '', ...innerComponentReturn, - "}", - "", + '}', + '', ], - description: "Creates a React component class with ES7 module system", + description: 'Creates a React component class with ES7 module system', }; const reactFunctionMemoComponent: ComponentsSnippet = { - key: "reactFunctionMemoComponent", - prefix: "rmc", + key: 'reactFunctionMemoComponent', + prefix: 'rmc', body: [ "import React, { memo } from 'react'", - "", + '', `export default memo(function ${SnippetPlaceholders.FileName}() {`, ...innerComponent, - "})", - "", + '})', + '', ], - description: "Creates a React Memo Function Component with ES7 module system", + description: 'Creates a React Memo Function Component with ES7 module system', }; const reactFunctionMemoComponentWithPropTypes: ComponentsSnippet = { - key: "reactFunctionMemoComponentWithPropTypes", - prefix: "rmcp", + key: 'reactFunctionMemoComponentWithPropTypes', + prefix: 'rmcp', body: [ "import PropTypes from 'prop-types'", ...reactWithMemo, `const ${SnippetPlaceholders.FileName} = memo(function ${SnippetPlaceholders.FileName}(props) {`, ...innerComponent, - "})", - "", + '})', + '', `${SnippetPlaceholders.FileName}.propTypes = {}`, ...exportDefault, ], description: - "Creates a React Memo Function Component with ES7 module system with PropTypes", + 'Creates a React Memo Function Component with ES7 module system with PropTypes', }; const reactClassComponentPropTypes: ComponentsSnippet = { - key: "reactClassComponentPropTypes", - prefix: "rccp", + key: 'reactClassComponentPropTypes', + prefix: 'rccp', body: [ "import PropTypes from 'prop-types'", ...reactComponent, `export default class ${SnippetPlaceholders.FileName} extends Component {`, - " static propTypes = {", + ' static propTypes = {', ` ${SnippetPlaceholders.SecondTab}: ${SnippetPlaceholders.ThirdTab}`, - " }", - "", + ' }', + '', ...innerComponentReturn, - "}", - "", + '}', + '', ], description: - "Creates a React component class with PropTypes and ES7 module system", + 'Creates a React component class with PropTypes and ES7 module system', }; const reactClassComponentRedux: ComponentsSnippet = { - key: "reactClassComponentRedux", - prefix: "rcredux", + key: 'reactClassComponentRedux', + prefix: 'rcredux', body: [ ...reactComponentWithReduxConnect, `export class ${SnippetPlaceholders.FileName} extends Component {`, ...innerComponentReturn, - "}", + '}', ...reduxComponentExport, ], description: - "Creates a React component class with connected redux and ES7 module system", + 'Creates a React component class with connected redux and ES7 module system', }; const reactClassComponentReduxPropTypes: ComponentsSnippet = { - key: "reactClassComponentReduxPropTypes", - prefix: "rcreduxp", + key: 'reactClassComponentReduxPropTypes', + prefix: 'rcreduxp', body: [ "import PropTypes from 'prop-types'", ...reactComponentWithReduxConnect, `export class ${SnippetPlaceholders.FileName} extends Component {`, - " static propTypes = {", + ' static propTypes = {', ` ${SnippetPlaceholders.SecondTab}: ${SnippetPlaceholders.ThirdTab}`, - " }", - "", + ' }', + '', ...innerComponentReturn, - "}", + '}', ...reduxComponentExport, ], description: - "Creates a React component class with PropTypes with connected redux and ES7 module system", + 'Creates a React component class with PropTypes with connected redux and ES7 module system', }; const reactFunctionalComponentRedux: ComponentsSnippet = { - key: "reactFunctionalComponentRedux", - prefix: "rfcredux", + key: 'reactFunctionalComponentRedux', + prefix: 'rfcredux', body: [ ...reactWithReduxConnect, `export const ${SnippetPlaceholders.FileName} = (props) => {`, ...innerComponent, - "}", + '}', ...reduxComponentExport, ], description: - "Creates a React functional component with connected redux and ES7 module system", + 'Creates a React functional component with connected redux and ES7 module system', }; const reactFunctionalComponentReduxPropTypes: ComponentsSnippet = { - key: "reactFunctionalComponentReduxPropTypes", - prefix: "rfcreduxp", + key: 'reactFunctionalComponentReduxPropTypes', + prefix: 'rfcreduxp', body: [ "import PropTypes from 'prop-types'", ...reactWithReduxConnect, `export const ${SnippetPlaceholders.FileName} = (props) => {`, ...innerComponent, - "}", - "", + '}', + '', `${SnippetPlaceholders.FileName}.propTypes = {`, ` ${SnippetPlaceholders.SecondTab}: PropTypes.${SnippetPlaceholders.ThirdTab}`, - "}", + '}', ...reduxComponentExport, ], description: - "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", + 'DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system', }; export default [ diff --git a/src/sourceSnippets/console.ts b/src/sourceSnippets/console.ts index b258de7..bb243a3 100644 --- a/src/sourceSnippets/console.ts +++ b/src/sourceSnippets/console.ts @@ -1,141 +1,141 @@ -import { SnippetPlaceholders, SnippetMapping } from "../types"; +import { SnippetMapping, SnippetPlaceholders } from '../types'; type ConsoleMapping = { - consoleAssert: "cas"; - consoleClear: "ccl"; - consoleCount: "cco"; - consoleDir: "cdi"; - consoleError: "cer"; - consoleGroup: "cgr"; - consoleGroupEnd: "cge"; - consoleLog: "clg"; - consoleTrace: "ctr"; - consoleLogObject: "clo"; - consoleLogJson: "clj"; - consoleTime: "ctm"; - consoleTimeEnd: "cte"; - consoleWarn: "cwa"; - consoleInfo: "cin"; + consoleAssert: 'cas'; + consoleClear: 'ccl'; + consoleCount: 'cco'; + consoleDir: 'cdi'; + consoleError: 'cer'; + consoleGroup: 'cgr'; + consoleGroupEnd: 'cge'; + consoleLog: 'clg'; + consoleTrace: 'ctr'; + consoleLogObject: 'clo'; + consoleLogJson: 'clj'; + consoleTime: 'ctm'; + consoleTimeEnd: 'cte'; + consoleWarn: 'cwa'; + consoleInfo: 'cin'; }; export type ConsoleSnippet = SnippetMapping; const consoleAssert: ConsoleSnippet = { - key: "consoleAssert", - prefix: "cas", + key: 'consoleAssert', + prefix: 'cas', body: [ `console.assert(${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab})`, ], description: - "If the specified expression is false, the message is written to the console along with a stack trace", + 'If the specified expression is false, the message is written to the console along with a stack trace', }; const consoleClear: ConsoleSnippet = { - key: "consoleClear", - prefix: "ccl", - body: ["console.clear()"], - description: "Clears the console", + key: 'consoleClear', + prefix: 'ccl', + body: ['console.clear()'], + description: 'Clears the console', }; const consoleCount: ConsoleSnippet = { - key: "consoleCount", - prefix: "cco", + key: 'consoleCount', + prefix: 'cco', body: [`console.count(${SnippetPlaceholders.FirstTab})`], description: - "Writes the the number of times that count() has been invoked at the same line and with the same label", + 'Writes the the number of times that count() has been invoked at the same line and with the same label', }; const consoleDir: ConsoleSnippet = { - key: "consoleDir", - prefix: "cdi", + key: 'consoleDir', + prefix: 'cdi', body: [`console.dir(${SnippetPlaceholders.FirstTab})`], - description: "Prints a JavaScript representation of the specified object", + description: 'Prints a JavaScript representation of the specified object', }; const consoleError: ConsoleSnippet = { - key: "consoleError", - prefix: "cer", + key: 'consoleError', + prefix: 'cer', body: [`console.error(${SnippetPlaceholders.FirstTab})`], description: - "Displays a message in the console and also includes a stack trace from where the method was called", + 'Displays a message in the console and also includes a stack trace from where the method was called', }; const consoleGroup: ConsoleSnippet = { - key: "consoleGroup", - prefix: "cgr", + key: 'consoleGroup', + prefix: 'cgr', body: [`console.group('${SnippetPlaceholders.FirstTab}')`], description: - "Groups and indents all following output by an additional level, until console.groupEnd() is called.", + 'Groups and indents all following output by an additional level, until console.groupEnd() is called.', }; const consoleGroupEnd: ConsoleSnippet = { - key: "consoleGroupEnd", - prefix: "cge", - body: ["console.groupEnd()"], - description: "Closes out the corresponding console.group().", + key: 'consoleGroupEnd', + prefix: 'cge', + body: ['console.groupEnd()'], + description: 'Closes out the corresponding console.group().', }; const consoleLog: ConsoleSnippet = { - key: "consoleLog", - prefix: "clg", + key: 'consoleLog', + prefix: 'clg', body: [`console.log(${SnippetPlaceholders.FirstTab})`], - description: "Displays a message in the console", + description: 'Displays a message in the console', }; const consoleTrace: ConsoleSnippet = { - key: "consoleTrace", - prefix: "ctr", + key: 'consoleTrace', + prefix: 'ctr', body: [`console.trace(${SnippetPlaceholders.FirstTab})`], description: - "Prints a stack trace from the point where the method was called", + 'Prints a stack trace from the point where the method was called', }; const consoleLogObject: ConsoleSnippet = { - key: "consoleLogObject", - prefix: "clo", + key: 'consoleLogObject', + prefix: 'clo', body: [ `console.log('${SnippetPlaceholders.FirstTab}', ${SnippetPlaceholders.FirstTab})`, ], - description: "Logs property with name.", + description: 'Logs property with name.', }; const consoleLogJson: ConsoleSnippet = { - key: "consoleLogJson", - prefix: "clj", + key: 'consoleLogJson', + prefix: 'clj', body: [ `console.log('${SnippetPlaceholders.FirstTab}', JSON.stringify(${SnippetPlaceholders.FirstTab}, null, 2))`, ], - description: "Logs stringified JSON property with name.", + description: 'Logs stringified JSON property with name.', }; const consoleTime: ConsoleSnippet = { - key: "consoleTime", - prefix: "ctm", + key: 'consoleTime', + prefix: 'ctm', body: [`console.time('${SnippetPlaceholders.FirstTab}')`], - description: "Console time wrapper", + description: 'Console time wrapper', }; const consoleTimeEnd: ConsoleSnippet = { - key: "consoleTimeEnd", - prefix: "cte", + key: 'consoleTimeEnd', + prefix: 'cte', body: [`console.timeEnd('${SnippetPlaceholders.FirstTab}')`], - description: "Console time end wrapper", + description: 'Console time end wrapper', }; const consoleWarn: ConsoleSnippet = { - key: "consoleWarn", - prefix: "cwa", + key: 'consoleWarn', + prefix: 'cwa', body: [`console.warn(${SnippetPlaceholders.FirstTab})`], description: - "Displays a message in the console but also displays a yellow warning icon along with the logged message", + 'Displays a message in the console but also displays a yellow warning icon along with the logged message', }; const consoleInfo: ConsoleSnippet = { - key: "consoleInfo", - prefix: "cin", + key: 'consoleInfo', + prefix: 'cin', body: [`console.info(${SnippetPlaceholders.FirstTab})`], description: - "Displays a message in the console but also displays a blue information icon along with the logged message", + 'Displays a message in the console but also displays a blue information icon along with the logged message', }; export default [ diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts index 2f28065..77c1546 100644 --- a/src/sourceSnippets/hooks.ts +++ b/src/sourceSnippets/hooks.ts @@ -1,111 +1,111 @@ -import { SnippetPlaceholders, SnippetMapping } from "../types"; +import { SnippetMapping, SnippetPlaceholders } from '../types'; type HookMappings = { - useCallback: "useCallbackSnippet"; - useContext: "useContextSnippet"; - useEffect: "useEffectSnippet"; - useImperativeHandle: "useImperativeHandleSnippet"; - useLayoutEffect: "useLayoutEffectSnippet"; - useMemo: "useMemoSnippet"; - useReducer: "useReducerSnippet"; - useRef: "useRefSnippet"; - useState: "useStateSnippet"; + useCallback: 'useCallbackSnippet'; + useContext: 'useContextSnippet'; + useEffect: 'useEffectSnippet'; + useImperativeHandle: 'useImperativeHandleSnippet'; + useLayoutEffect: 'useLayoutEffectSnippet'; + useMemo: 'useMemoSnippet'; + useReducer: 'useReducerSnippet'; + useRef: 'useRefSnippet'; + useState: 'useStateSnippet'; }; export type HooksSnippet = SnippetMapping; const useState: HooksSnippet = { - key: "useState", - prefix: "useStateSnippet", + key: 'useState', + prefix: 'useStateSnippet', body: [ `const [${SnippetPlaceholders.FirstTab}, set${SnippetPlaceholders.FirstTab}/(.*)/${SnippetPlaceholders.FirstTab}:/capitalize}/}] = useState(${SnippetPlaceholders.SecondTab})`, ], }; const useEffect: HooksSnippet = { - key: "useEffect", - prefix: "useEffectSnippet", + key: 'useEffect', + prefix: 'useEffectSnippet', body: [ - "useEffect(() => {", + 'useEffect(() => {', ` ${SnippetPlaceholders.FirstTab}`, - "", - " return () => {", + '', + ' return () => {', ` ${SnippetPlaceholders.SecondTab}`, - " }", + ' }', `}, [${SnippetPlaceholders.ThirdTab}])`, - "", + '', ], }; const useContext: HooksSnippet = { - key: "useContext", - prefix: "useContextSnippet", + key: 'useContext', + prefix: 'useContextSnippet', body: [ `const ${SnippetPlaceholders.FirstTab} = useContext(${SnippetPlaceholders.SecondTab})`, ], }; const useReducer: HooksSnippet = { - key: "useReducer", - prefix: "useReducerSnippet", + key: 'useReducer', + prefix: 'useReducerSnippet', body: [ `const [state, dispatch] = useReducer(${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab}, ${SnippetPlaceholders.ThirdTab})`, ], }; const useCallback: HooksSnippet = { - key: "useCallback", - prefix: "useCallbackSnippet", + key: 'useCallback', + prefix: 'useCallbackSnippet', body: [ - "useCallback(", - " () => {", + 'useCallback(', + ' () => {', ` ${SnippetPlaceholders.FirstTab}`, - " },", + ' },', ` [${SnippetPlaceholders.SecondTab}],`, - ")", - "", + ')', + '', ], }; const useMemo: HooksSnippet = { - key: "useMemo", - prefix: "useMemoSnippet", + key: 'useMemo', + prefix: 'useMemoSnippet', body: [ `useMemo(() => ${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab})`, ], }; const useRef: HooksSnippet = { - key: "useRef", - prefix: "useRefSnippet", + key: 'useRef', + prefix: 'useRefSnippet', body: [ `const ${SnippetPlaceholders.FirstTab} = useRef(${SnippetPlaceholders.SecondTab})`, ], }; const useImperativeHandle: HooksSnippet = { - key: "useImperativeHandle", - prefix: "useImperativeHandleSnippet", + key: 'useImperativeHandle', + prefix: 'useImperativeHandleSnippet', body: [ - "useImperativeHandle(", + 'useImperativeHandle(', ` ${SnippetPlaceholders.FirstTab},`, - " () => {", + ' () => {', ` ${SnippetPlaceholders.SecondTab}`, - " },", + ' },', ` [${SnippetPlaceholders.ThirdTab}],`, - ")", + ')', ], }; const useLayoutEffect: HooksSnippet = { - key: "useLayoutEffect", - prefix: "useLayoutEffectSnippet", + key: 'useLayoutEffect', + prefix: 'useLayoutEffectSnippet', body: [ - "useLayoutEffect(() => {", + 'useLayoutEffect(() => {', ` ${SnippetPlaceholders.FirstTab}`, - " return () => {", + ' return () => {', ` ${SnippetPlaceholders.SecondTab}`, - " };", + ' };', `}, [${SnippetPlaceholders.ThirdTab}])`, ], }; diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts index 0ac0c2d..8022cbc 100644 --- a/src/sourceSnippets/imports.ts +++ b/src/sourceSnippets/imports.ts @@ -1,27 +1,27 @@ -import { SnippetPlaceholders, SnippetMapping } from "../types"; +import { SnippetMapping, SnippetPlaceholders } from '../types'; type ImportsMappings = { - import: "imp"; - importAs: "ima"; - importBrowserRouter: "imbr"; - importBrowserRouterWithRouteAndNavLink: "imrr"; - importDestructing: "imd"; - importEverything: "ime"; - importNoModuleName: "imn"; - importPropTypes: "impt"; - importReact: "imr"; - importReactDom: "imrd"; - importReactWithComponent: "imrc"; - importReactWithComponentAndPropTypes: "imrcp"; - importReactWithMemo: "imrm"; - importReactWithMemoAndPropTypes: "imrmp"; - importReactWithPureComponent: "imrpc"; - importReactWithPureComponentAndPropTypes: "imrpcp"; - importReduxConnect: "redux"; - importRouterLink: "imbrl"; - importRouterNavLink: "imbrnl"; - importRouterSetup: "imbrc"; - importRouterSwitch: "imbrs"; + import: 'imp'; + importAs: 'ima'; + importBrowserRouter: 'imbr'; + importBrowserRouterWithRouteAndNavLink: 'imrr'; + importDestructing: 'imd'; + importEverything: 'ime'; + importNoModuleName: 'imn'; + importPropTypes: 'impt'; + importReact: 'imr'; + importReactDom: 'imrd'; + importReactWithComponent: 'imrc'; + importReactWithComponentAndPropTypes: 'imrcp'; + importReactWithMemo: 'imrm'; + importReactWithMemoAndPropTypes: 'imrmp'; + importReactWithPureComponent: 'imrpc'; + importReactWithPureComponentAndPropTypes: 'imrpcp'; + importReduxConnect: 'redux'; + importRouterLink: 'imbrl'; + importRouterNavLink: 'imbrnl'; + importRouterSetup: 'imbrc'; + importRouterSwitch: 'imbrs'; }; export type ImportsSnippet = SnippetMapping; @@ -30,69 +30,69 @@ export type ImportsSnippet = SnippetMapping; * react, react-dom & prop-types */ const importReact: ImportsSnippet = { - key: "importReact", - prefix: "imr", - body: ["import React from 'react'", ""], + key: 'importReact', + prefix: 'imr', + body: ["import React from 'react'", ''], }; const importReactDom: ImportsSnippet = { - key: "importReactDom", - prefix: "imrd", - body: ["import ReactDOM from 'react-dom'", ""], + key: 'importReactDom', + prefix: 'imrd', + body: ["import ReactDOM from 'react-dom'", ''], }; const importReactWithComponent: ImportsSnippet = { - key: "importReactWithComponent", - prefix: "imrc", - body: ["import React, { Component } from 'react'", ""], + key: 'importReactWithComponent', + prefix: 'imrc', + body: ["import React, { Component } from 'react'", ''], }; const importReactWithComponentAndPropTypes: ImportsSnippet = { - key: "importReactWithComponentAndPropTypes", - prefix: "imrcp", + key: 'importReactWithComponentAndPropTypes', + prefix: 'imrcp', body: [ "import React, { Component } from 'react'", "import PropTypes from 'prop-types'", - "", + '', ], }; const importReactWithPureComponent: ImportsSnippet = { - key: "importReactWithPureComponent", - prefix: "imrpc", - body: ["import React, { PureComponent } from 'react'", ""], + key: 'importReactWithPureComponent', + prefix: 'imrpc', + body: ["import React, { PureComponent } from 'react'", ''], }; const importReactWithPureComponentAndPropTypes: ImportsSnippet = { - key: "importReactWithPureComponentAndPropTypes", - prefix: "imrpcp", + key: 'importReactWithPureComponentAndPropTypes', + prefix: 'imrpcp', body: [ "import React, { PureComponent } from 'react'", "import PropTypes from 'prop-types'", - "", + '', ], }; const importReactWithMemo: ImportsSnippet = { - key: "importReactWithMemo", - prefix: "imrm", - body: ["import React, { memo } from 'react'", ""], + key: 'importReactWithMemo', + prefix: 'imrm', + body: ["import React, { memo } from 'react'", ''], }; const importReactWithMemoAndPropTypes: ImportsSnippet = { - key: "importReactWithMemoAndPropTypes", - prefix: "imrmp", + key: 'importReactWithMemoAndPropTypes', + prefix: 'imrmp', body: [ "import React, { memo } from 'react'", "import PropTypes from 'prop-types'", - "", + '', ], }; const importPropTypes: ImportsSnippet = { - key: "importPropTypes", - prefix: "impt", - body: ["import PropTypes from 'prop-types'", ""], + key: 'importPropTypes', + prefix: 'impt', + body: ["import PropTypes from 'prop-types'", ''], }; /** @@ -100,42 +100,42 @@ const importPropTypes: ImportsSnippet = { */ const importBrowserRouter: ImportsSnippet = { - key: "importBrowserRouter", - prefix: "imbr", - body: ["import { BrowserRouter as Router } from 'react-router-dom'", ""], + key: 'importBrowserRouter', + prefix: 'imbr', + body: ["import { BrowserRouter as Router } from 'react-router-dom'", ''], }; const importBrowserRouterWithRouteAndNavLink: ImportsSnippet = { - key: "importBrowserRouterWithRouteAndNavLink", - prefix: "imrr", + key: 'importBrowserRouterWithRouteAndNavLink', + prefix: 'imrr', body: [ "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", - "", + '', ], }; const importRouterSetup: ImportsSnippet = { - key: "importRouterSetup", - prefix: "imbrc", - body: ["import { Route, Switch, NavLink, Link } from 'react-router-dom'", ""], + key: 'importRouterSetup', + prefix: 'imbrc', + body: ["import { Route, Switch, NavLink, Link } from 'react-router-dom'", ''], }; const importRouterSwitch: ImportsSnippet = { - key: "importRouterSwitch", - prefix: "imbrs", - body: ["import { Switch } from 'react-router-dom'", ""], + key: 'importRouterSwitch', + prefix: 'imbrs', + body: ["import { Switch } from 'react-router-dom'", ''], }; const importRouterLink: ImportsSnippet = { - key: "importRouterLink", - prefix: "imbrl", - body: ["import { Link } from 'react-router-dom'", ""], + key: 'importRouterLink', + prefix: 'imbrl', + body: ["import { Link } from 'react-router-dom'", ''], }; const importRouterNavLink: ImportsSnippet = { - key: "importRouterNavLink", - prefix: "imbrnl", - body: ["import { NavLink } from 'react-router-dom'", ""], + key: 'importRouterNavLink', + prefix: 'imbrnl', + body: ["import { NavLink } from 'react-router-dom'", ''], }; /** @@ -143,47 +143,47 @@ const importRouterNavLink: ImportsSnippet = { */ const importSnippet: ImportsSnippet = { - key: "import", - prefix: "imp", + key: 'import', + prefix: 'imp', body: [ `import ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - "", + '', ], }; const importNoModuleName: ImportsSnippet = { - key: "importNoModuleName", - prefix: "imn", + key: 'importNoModuleName', + prefix: 'imn', body: [ `import '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - "", + '', ], }; const importDestructing: ImportsSnippet = { - key: "importDestructing", - prefix: "imd", + key: 'importDestructing', + prefix: 'imd', body: [ `import { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - "", + '', ], }; const importEverything: ImportsSnippet = { - key: "importEverything", - prefix: "ime", + key: 'importEverything', + prefix: 'ime', body: [ `import * as ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - "", + '', ], }; const importAs: ImportsSnippet = { - key: "importAs", - prefix: "ima", + key: 'importAs', + prefix: 'ima', body: [ `import { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - "", + '', ], }; diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts index 4c3ed3d..70a95a4 100644 --- a/src/sourceSnippets/others.ts +++ b/src/sourceSnippets/others.ts @@ -1,467 +1,467 @@ -import { SnippetPlaceholders, SnippetMapping } from "../types"; +import { SnippetMapping, SnippetPlaceholders } from '../types'; type OthersMapping = { - commentBigBlock: "cmmb"; - anonymousFunction: "anfn"; - bindThis: "bnd"; - classConstructor: "rconst"; - componentDidMount: "cdm"; - componentDidUpdate: "cdup"; - componentProps: "props"; - componentSetStateFunc: "ssf"; - componentSetStateObject: "sst"; - componentState: "state"; - componentWillUnmount: "cwun"; - createContext: "rcontext"; - createRef: "cref"; - destructProps: "cp"; - destructState: "cs"; - destructingArray: "dar"; - destructingObject: "dob"; - emptyState: "est"; - exportAs: "exa"; - exportDefault: "exp"; - exportDefaultFunction: "edf"; - exportDefaultNamedFunction: "ednf"; - exportDestructing: "exd"; - exportNamedFunction: "enf"; - forEach: "fre"; - forIn: "fin"; - forOf: "fof"; - getDerivedStateFromProps: "gdsfp"; - getSnapshotBeforeUpdate: "gsbu"; - hocComponent: "hoc"; - hocComponentWithRedux: "hocredux"; - method: "met"; - namedFunction: "nfn"; - promise: "prom"; - propertyGet: "pge"; - propertySet: "pse"; - setInterval: "sti"; - setTimeOut: "sto"; - shouldComponentUpdate: "scu"; - typeofSnippet: "tpf"; + commentBigBlock: 'cmmb'; + anonymousFunction: 'anfn'; + bindThis: 'bnd'; + classConstructor: 'rconst'; + componentDidMount: 'cdm'; + componentDidUpdate: 'cdup'; + componentProps: 'props'; + componentSetStateFunc: 'ssf'; + componentSetStateObject: 'sst'; + componentState: 'state'; + componentWillUnmount: 'cwun'; + createContext: 'rcontext'; + createRef: 'cref'; + destructProps: 'cp'; + destructState: 'cs'; + destructingArray: 'dar'; + destructingObject: 'dob'; + emptyState: 'est'; + exportAs: 'exa'; + exportDefault: 'exp'; + exportDefaultFunction: 'edf'; + exportDefaultNamedFunction: 'ednf'; + exportDestructing: 'exd'; + exportNamedFunction: 'enf'; + forEach: 'fre'; + forIn: 'fin'; + forOf: 'fof'; + getDerivedStateFromProps: 'gdsfp'; + getSnapshotBeforeUpdate: 'gsbu'; + hocComponent: 'hoc'; + hocComponentWithRedux: 'hocredux'; + method: 'met'; + namedFunction: 'nfn'; + promise: 'prom'; + propertyGet: 'pge'; + propertySet: 'pse'; + setInterval: 'sti'; + setTimeOut: 'sto'; + shouldComponentUpdate: 'scu'; + typeofSnippet: 'tpf'; }; export type OthersSnippet = SnippetMapping; const exportDefault: OthersSnippet = { - key: "exportDefault", - prefix: "exp", - body: [`export default ${SnippetPlaceholders.LastTab}`, ""], + key: 'exportDefault', + prefix: 'exp', + body: [`export default ${SnippetPlaceholders.LastTab}`, ''], }; const exportDestructing: OthersSnippet = { - key: "exportDestructing", - prefix: "exd", + key: 'exportDestructing', + prefix: 'exd', body: [ `export { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - "", + '', ], }; const exportAs: OthersSnippet = { - key: "exportAs", - prefix: "exa", + key: 'exportAs', + prefix: 'exa', body: [ `export { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - "", + '', ], }; const exportNamedFunction: OthersSnippet = { - key: "exportNamedFunction", - prefix: "enf", + key: 'exportNamedFunction', + prefix: 'enf', body: [ `export const ${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {${SnippetPlaceholders.LastTab}}`, - "", + '', ], - description: "Export named function", + description: 'Export named function', }; const exportDefaultFunction: OthersSnippet = { - key: "exportDefaultFunction", - prefix: "edf", + key: 'exportDefaultFunction', + prefix: 'edf', body: [ `export default (${SnippetPlaceholders.FirstTab}) => {${SnippetPlaceholders.LastTab}}`, - "", + '', ], - description: "Export default function", + description: 'Export default function', }; const exportDefaultNamedFunction: OthersSnippet = { - key: "exportDefaultNamedFunction", - prefix: "ednf", + key: 'exportDefaultNamedFunction', + prefix: 'ednf', body: [ `export default function ${SnippetPlaceholders.FirstTab}(${SnippetPlaceholders.SecondTab}) {${SnippetPlaceholders.LastTab}}`, - "", + '', ], - description: "Export default named function", + description: 'Export default named function', }; const method: OthersSnippet = { - key: "method", - prefix: "met", + key: 'method', + prefix: 'met', body: [ `${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {${SnippetPlaceholders.LastTab}}`, - "", + '', ], - description: "Creates a method inside a class", + description: 'Creates a method inside a class', }; const propertyGet: OthersSnippet = { - key: "propertyGet", - prefix: "pge", + key: 'propertyGet', + prefix: 'pge', body: [ `get ${SnippetPlaceholders.FirstTab}() {`, ` return this.${SnippetPlaceholders.LastTab}`, - "}", - "", + '}', + '', ], - description: "Creates a getter property inside a class", + description: 'Creates a getter property inside a class', }; const propertySet: OthersSnippet = { - key: "propertySet", - prefix: "pse", + key: 'propertySet', + prefix: 'pse', body: [ `set ${SnippetPlaceholders.FirstTab}(${SnippetPlaceholders.SecondTab}) {${SnippetPlaceholders.LastTab}}`, - "", + '', ], - description: "Creates a setter property inside a class", + description: 'Creates a setter property inside a class', }; const forEach: OthersSnippet = { - key: "forEach", - prefix: "fre", + key: 'forEach', + prefix: 'fre', body: [ `${SnippetPlaceholders.FirstTab}.forEach(${SnippetPlaceholders.SecondTab} => {`, ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], - description: "Creates a forEach statement", + description: 'Creates a forEach statement', }; const forOf: OthersSnippet = { - key: "forOf", - prefix: "fof", + key: 'forOf', + prefix: 'fof', body: [ `for(let ${SnippetPlaceholders.FirstTab} of ${SnippetPlaceholders.SecondTab}) {`, ` ${SnippetPlaceholders.LastTab}`, - "}", - "", + '}', + '', ], - description: "Iterating over property names of iterable objects", + description: 'Iterating over property names of iterable objects', }; const forIn: OthersSnippet = { - key: "forIn", - prefix: "fin", + key: 'forIn', + prefix: 'fin', body: [ `for(let ${SnippetPlaceholders.FirstTab} in ${SnippetPlaceholders.SecondTab}) {`, ` ${SnippetPlaceholders.LastTab}`, - "}", - "", + '}', + '', ], - description: "Iterating over property values of iterable objects", + description: 'Iterating over property values of iterable objects', }; const anonymousFunction: OthersSnippet = { - key: "anonymousFunction", - prefix: "anfn", + key: 'anonymousFunction', + prefix: 'anfn', body: [ `(${SnippetPlaceholders.FirstTab}) => {`, ` ${SnippetPlaceholders.SecondTab}`, - "}", + '}', ], - description: "Creates an anonymous function", + description: 'Creates an anonymous function', }; const namedFunction: OthersSnippet = { - key: "namedFunction", - prefix: "nfn", + key: 'namedFunction', + prefix: 'nfn', body: [ `const ${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {`, ` ${SnippetPlaceholders.ThirdTab}`, - "}", - "", + '}', + '', ], - description: "Creates a named function", + description: 'Creates a named function', }; const destructingObject: OthersSnippet = { - key: "destructingObject", - prefix: "dob", + key: 'destructingObject', + prefix: 'dob', body: [ `const {${SnippetPlaceholders.SecondTab}} = ${SnippetPlaceholders.FirstTab}`, - "", + '', ], - description: "Creates and assigns a local variable using object destructing", + description: 'Creates and assigns a local variable using object destructing', }; const destructingArray: OthersSnippet = { - key: "destructingArray", - prefix: "dar", + key: 'destructingArray', + prefix: 'dar', body: [ `const [${SnippetPlaceholders.SecondTab}] = ${SnippetPlaceholders.FirstTab}`, - "", + '', ], - description: "Creates and assigns a local variable using array destructing", + description: 'Creates and assigns a local variable using array destructing', }; const setInterval: OthersSnippet = { - key: "setInterval", - prefix: "sti", + key: 'setInterval', + prefix: 'sti', body: [ - "setInterval(() => {", + 'setInterval(() => {', ` ${SnippetPlaceholders.SecondTab}`, `}, ${SnippetPlaceholders.LastTab})`, - "", + '', ], - description: "Executes the given function at specified intervals", + description: 'Executes the given function at specified intervals', }; const setTimeOut: OthersSnippet = { - key: "setTimeOut", - prefix: "sto", + key: 'setTimeOut', + prefix: 'sto', body: [ - "setTimeout(() => {", + 'setTimeout(() => {', ` ${SnippetPlaceholders.SecondTab}`, `}, ${SnippetPlaceholders.FirstTab})`, - "", + '', ], - description: "Executes the given function after the specified delay", + description: 'Executes the given function after the specified delay', }; const promise: OthersSnippet = { - key: "promise", - prefix: "prom", + key: 'promise', + prefix: 'prom', body: [ - "return new Promise((resolve, reject) => {", + 'return new Promise((resolve, reject) => {', ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], - description: "Creates and returns a new Promise in the standard ES7 syntax", + description: 'Creates and returns a new Promise in the standard ES7 syntax', }; const destructProps: OthersSnippet = { - key: "destructProps", - prefix: "cp", - body: [`const { ${SnippetPlaceholders.LastTab} } = this.props`, ""], - description: "Creates and assigns a local variable using props destructing", + key: 'destructProps', + prefix: 'cp', + body: [`const { ${SnippetPlaceholders.LastTab} } = this.props`, ''], + description: 'Creates and assigns a local variable using props destructing', }; const destructState: OthersSnippet = { - key: "destructState", - prefix: "cs", - body: [`const { ${SnippetPlaceholders.LastTab} } = this.state`, ""], - description: "Creates and assigns a local variable using state destructing", + key: 'destructState', + prefix: 'cs', + body: [`const { ${SnippetPlaceholders.LastTab} } = this.state`, ''], + description: 'Creates and assigns a local variable using state destructing', }; const classConstructor: OthersSnippet = { - key: "classConstructor", - prefix: "rconst", + key: 'classConstructor', + prefix: 'rconst', body: [ - "constructor(props) {", - " super(props)", - "", - " this.state = {", + 'constructor(props) {', + ' super(props)', + '', + ' this.state = {', ` ${SnippetPlaceholders.LastTab}`, - " }", - "}", - "", + ' }', + '}', + '', ], description: "Adds a default constructor for it('', () => {})the class that contains props as arguments", }; const emptyState: OthersSnippet = { - key: "emptyState", - prefix: "est", - body: ["state = {", ` ${SnippetPlaceholders.LastTab}`, "}", ""], - description: "Creates empty state object. To be used in a constructor.", + key: 'emptyState', + prefix: 'est', + body: ['state = {', ` ${SnippetPlaceholders.LastTab}`, '}', ''], + description: 'Creates empty state object. To be used in a constructor.', }; const componentDidMount: OthersSnippet = { - key: "componentDidMount", - prefix: "cdm", - body: ["componentDidMount() {", ` ${SnippetPlaceholders.LastTab}`, "}", ""], + key: 'componentDidMount', + prefix: 'cdm', + body: ['componentDidMount() {', ` ${SnippetPlaceholders.LastTab}`, '}', ''], description: - "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", + 'Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.', }; const shouldComponentUpdate: OthersSnippet = { - key: "shouldComponentUpdate", - prefix: "scu", + key: 'shouldComponentUpdate', + prefix: 'scu', body: [ - "shouldComponentUpdate(nextProps, nextState) {", + 'shouldComponentUpdate(nextProps, nextState) {', ` ${SnippetPlaceholders.LastTab}`, - "}", - "", + '}', + '', ], description: - "Invoked before rendering when new props or state are being received. ", + 'Invoked before rendering when new props or state are being received. ', }; const componentDidUpdate: OthersSnippet = { - key: "componentDidUpdate", - prefix: "cdup", + key: 'componentDidUpdate', + prefix: 'cdup', body: [ - "componentDidUpdate(prevProps, prevState) {", + 'componentDidUpdate(prevProps, prevState) {', ` ${SnippetPlaceholders.LastTab}`, - "}", - "", + '}', + '', ], description: "Invoked immediately after the component's updates are flushed to the DOM.", }; const componentWillUnmount: OthersSnippet = { - key: "componentWillUnmount", - prefix: "cwun", + key: 'componentWillUnmount', + prefix: 'cwun', body: [ - "componentWillUnmount() {", + 'componentWillUnmount() {', ` ${SnippetPlaceholders.LastTab}`, - "}", - "", + '}', + '', ], description: - "Invoked immediately before a component is unmounted from the DOM.", + 'Invoked immediately before a component is unmounted from the DOM.', }; const getDerivedStateFromProps: OthersSnippet = { - key: "getDerivedStateFromProps", - prefix: "gdsfp", + key: 'getDerivedStateFromProps', + prefix: 'gdsfp', body: [ - "static getDerivedStateFromProps(props, state) {", + 'static getDerivedStateFromProps(props, state) {', ` ${SnippetPlaceholders.LastTab}`, - "}", + '}', ], description: - "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", + 'Invoked right before calling the render method, both on the initial mount and on subsequent updates.', }; const getSnapshotBeforeUpdate: OthersSnippet = { - key: "getSnapshotBeforeUpdate", - prefix: "gsbu", + key: 'getSnapshotBeforeUpdate', + prefix: 'gsbu', body: [ - "getSnapshotBeforeUpdate = (prevProps, prevState) => {", + 'getSnapshotBeforeUpdate = (prevProps, prevState) => {', ` ${SnippetPlaceholders.LastTab}`, - "}", - "", + '}', + '', ], description: - "Called right before mutations are made (e.g. before the DOM is updated)", + 'Called right before mutations are made (e.g. before the DOM is updated)', }; const createContext: OthersSnippet = { - key: "createContext", - prefix: "rcontext", - body: [`const ${SnippetPlaceholders.LastTab} = React.createContext()`, ""], - description: "Create React context", + key: 'createContext', + prefix: 'rcontext', + body: [`const ${SnippetPlaceholders.LastTab} = React.createContext()`, ''], + description: 'Create React context', }; const createRef: OthersSnippet = { - key: "createRef", - prefix: "cref", - body: [`this.${SnippetPlaceholders.LastTab}Ref = React.createRef()`, ""], - description: "Create ref statement used inside constructor", + key: 'createRef', + prefix: 'cref', + body: [`this.${SnippetPlaceholders.LastTab}Ref = React.createRef()`, ''], + description: 'Create ref statement used inside constructor', }; const componentSetStateObject: OthersSnippet = { - key: "componentSetStateObject", - prefix: "sst", - body: [`this.setState({${SnippetPlaceholders.LastTab}})`, ""], - description: "Performs a shallow merge of nextState into current state", + key: 'componentSetStateObject', + prefix: 'sst', + body: [`this.setState({${SnippetPlaceholders.LastTab}})`, ''], + description: 'Performs a shallow merge of nextState into current state', }; const componentSetStateFunc: OthersSnippet = { - key: "componentSetStateFunc", - prefix: "ssf", + key: 'componentSetStateFunc', + prefix: 'ssf', body: [ `this.setState((state, props) => { return { ${SnippetPlaceholders.LastTab} }})`, - "", + '', ], - description: "Performs a shallow merge of nextState into current state", + description: 'Performs a shallow merge of nextState into current state', }; const componentProps: OthersSnippet = { - key: "componentProps", - prefix: "props", - body: [`this.props.${SnippetPlaceholders.LastTab}`, ""], + key: 'componentProps', + prefix: 'props', + body: [`this.props.${SnippetPlaceholders.LastTab}`, ''], description: "Access component's props", }; const componentState: OthersSnippet = { - key: "componentState", - prefix: "state", - body: [`this.state.${SnippetPlaceholders.LastTab}`, ""], + key: 'componentState', + prefix: 'state', + body: [`this.state.${SnippetPlaceholders.LastTab}`, ''], }; const bindThis: OthersSnippet = { - key: "bindThis", - prefix: "bnd", + key: 'bindThis', + prefix: 'bnd', body: [ `this.${SnippetPlaceholders.FirstTab} = this.${SnippetPlaceholders.FirstTab}.bind(this)${SnippetPlaceholders.LastTab}`, - "", + '', ], - description: "Binds this to a method", + description: 'Binds this to a method', }; const commentBigBlock: OthersSnippet = { - key: "commentBigBlock", - prefix: "cmmb", - body: ["/**", ` * ${SnippetPlaceholders.LastTab}`, " */"], + key: 'commentBigBlock', + prefix: 'cmmb', + body: ['/**', ` * ${SnippetPlaceholders.LastTab}`, ' */'], }; const hocComponentWithRedux: OthersSnippet = { - key: "hocComponentWithRedux", - prefix: "hocredux", + key: 'hocComponentWithRedux', + prefix: 'hocredux', body: [ "import React from 'react'", "import { connect } from 'react-redux'", "import PropTypes from 'prop-types'", - "", - "export const mapStateToProps = state => ({})", - "", - "export const mapDispatchToProps = {}", - "", + '', + 'export const mapStateToProps = state => ({})', + '', + 'export const mapDispatchToProps = {}', + '', `export const ${SnippetPlaceholders.FirstTab} = (WrappedComponent) => {`, - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {}", - "", - " return hocComponent", - "}", - "", + ' const hocComponent = ({ ...props }) => ', + '', + ' hocComponent.propTypes = {}', + '', + ' return hocComponent', + '}', + '', `export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FirstTab}(WrapperComponent))`, - "", + '', ], }; const hocComponent: OthersSnippet = { - key: "hocComponent", - prefix: "hoc", + key: 'hocComponent', + prefix: 'hoc', body: [ "import React from 'react'", "import PropTypes from 'prop-types'", - "", - "export default (WrappedComponent) => {", - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {}", - "", - " return hocComponent", - "}", - "", + '', + 'export default (WrappedComponent) => {', + ' const hocComponent = ({ ...props }) => ', + '', + ' hocComponent.propTypes = {}', + '', + ' return hocComponent', + '}', + '', ], }; const typeofSnippet: OthersSnippet = { - key: "typeofSnippet", - prefix: "tpf", + key: 'typeofSnippet', + prefix: 'tpf', body: [`typeof ${SnippetPlaceholders.LastTab}`], }; diff --git a/src/sourceSnippets/propTypes.ts b/src/sourceSnippets/propTypes.ts index c6d0b03..68924b7 100644 --- a/src/sourceSnippets/propTypes.ts +++ b/src/sourceSnippets/propTypes.ts @@ -1,259 +1,259 @@ -import { SnippetMapping } from "../types"; +import { SnippetMapping } from '../types'; type PropTypesMapping = { - propTypeAny: "ptany"; - propTypeArray: "pta"; - propTypeArrayOf: "ptao"; - propTypeArrayOfRequired: "ptaor"; - propTypeArrayRequired: "ptar"; - propTypeBool: "ptb"; - propTypeBoolRequired: "ptbr"; - propTypeElement: "ptel"; - propTypeElementRequired: "ptelr"; - propTypeEnum: "pte"; - propTypeEnumRequired: "pter"; - propTypeExact: "ptex"; - propTypeExactRequired: "ptexr"; - propTypeFunc: "ptf"; - propTypeFuncRequired: "ptfr"; - propTypeInstanceOf: "pti"; - propTypeInstanceOfRequired: "ptir"; - propTypeNode: "ptnd"; - propTypeNodeRequired: "ptndr"; - propTypeNumber: "ptn"; - propTypeNumberRequired: "ptnr"; - propTypeObject: "pto"; - propTypeObjectOf: "ptoo"; - propTypeObjectOfRequired: "ptoor"; - propTypeObjectRequired: "ptor"; - propTypeOneOfType: "ptet"; - propTypeOneOfTypeRequired: "ptetr"; - propTypeShape: "ptsh"; - propTypeShapeRequired: "ptshr"; - propTypeString: "pts"; - propTypeStringRequired: "ptsr"; + propTypeAny: 'ptany'; + propTypeArray: 'pta'; + propTypeArrayOf: 'ptao'; + propTypeArrayOfRequired: 'ptaor'; + propTypeArrayRequired: 'ptar'; + propTypeBool: 'ptb'; + propTypeBoolRequired: 'ptbr'; + propTypeElement: 'ptel'; + propTypeElementRequired: 'ptelr'; + propTypeEnum: 'pte'; + propTypeEnumRequired: 'pter'; + propTypeExact: 'ptex'; + propTypeExactRequired: 'ptexr'; + propTypeFunc: 'ptf'; + propTypeFuncRequired: 'ptfr'; + propTypeInstanceOf: 'pti'; + propTypeInstanceOfRequired: 'ptir'; + propTypeNode: 'ptnd'; + propTypeNodeRequired: 'ptndr'; + propTypeNumber: 'ptn'; + propTypeNumberRequired: 'ptnr'; + propTypeObject: 'pto'; + propTypeObjectOf: 'ptoo'; + propTypeObjectOfRequired: 'ptoor'; + propTypeObjectRequired: 'ptor'; + propTypeOneOfType: 'ptet'; + propTypeOneOfTypeRequired: 'ptetr'; + propTypeShape: 'ptsh'; + propTypeShapeRequired: 'ptshr'; + propTypeString: 'pts'; + propTypeStringRequired: 'ptsr'; }; export type PropTypesSnippet = SnippetMapping; const propTypeArray: PropTypesSnippet = { - key: "propTypeArray", - prefix: "pta", - body: ["PropTypes.array,"], - description: "Array prop type", + key: 'propTypeArray', + prefix: 'pta', + body: ['PropTypes.array,'], + description: 'Array prop type', }; const propTypeArrayRequired: PropTypesSnippet = { - key: "propTypeArrayRequired", - prefix: "ptar", - body: ["PropTypes.array.isRequired,"], - description: "Array prop type required", + key: 'propTypeArrayRequired', + prefix: 'ptar', + body: ['PropTypes.array.isRequired,'], + description: 'Array prop type required', }; const propTypeBool: PropTypesSnippet = { - key: "propTypeBool", - prefix: "ptb", - body: ["PropTypes.bool,"], - description: "Bool prop type", + key: 'propTypeBool', + prefix: 'ptb', + body: ['PropTypes.bool,'], + description: 'Bool prop type', }; const propTypeBoolRequired: PropTypesSnippet = { - key: "propTypeBoolRequired", - prefix: "ptbr", - body: ["PropTypes.bool.isRequired,"], - description: "Bool prop type required", + key: 'propTypeBoolRequired', + prefix: 'ptbr', + body: ['PropTypes.bool.isRequired,'], + description: 'Bool prop type required', }; const propTypeFunc: PropTypesSnippet = { - key: "propTypeFunc", - prefix: "ptf", - body: ["PropTypes.func,"], - description: "Func prop type", + key: 'propTypeFunc', + prefix: 'ptf', + body: ['PropTypes.func,'], + description: 'Func prop type', }; const propTypeFuncRequired: PropTypesSnippet = { - key: "propTypeFuncRequired", - prefix: "ptfr", - body: ["PropTypes.func.isRequired,"], - description: "Func prop type required", + key: 'propTypeFuncRequired', + prefix: 'ptfr', + body: ['PropTypes.func.isRequired,'], + description: 'Func prop type required', }; const propTypeNumber: PropTypesSnippet = { - key: "propTypeNumber", - prefix: "ptn", - body: ["PropTypes.number,"], - description: "Number prop type", + key: 'propTypeNumber', + prefix: 'ptn', + body: ['PropTypes.number,'], + description: 'Number prop type', }; const propTypeNumberRequired: PropTypesSnippet = { - key: "propTypeNumberRequired", - prefix: "ptnr", - body: ["PropTypes.number.isRequired,"], - description: "Number prop type required", + key: 'propTypeNumberRequired', + prefix: 'ptnr', + body: ['PropTypes.number.isRequired,'], + description: 'Number prop type required', }; const propTypeObject: PropTypesSnippet = { - key: "propTypeObject", - prefix: "pto", - body: ["PropTypes.object,"], - description: "Object prop type", + key: 'propTypeObject', + prefix: 'pto', + body: ['PropTypes.object,'], + description: 'Object prop type', }; const propTypeObjectRequired: PropTypesSnippet = { - key: "propTypeObjectRequired", - prefix: "ptor", - body: ["PropTypes.object.isRequired,"], - description: "Object prop type required", + key: 'propTypeObjectRequired', + prefix: 'ptor', + body: ['PropTypes.object.isRequired,'], + description: 'Object prop type required', }; const propTypeString: PropTypesSnippet = { - key: "propTypeString", - prefix: "pts", - body: ["PropTypes.string,"], - description: "String prop type", + key: 'propTypeString', + prefix: 'pts', + body: ['PropTypes.string,'], + description: 'String prop type', }; const propTypeStringRequired: PropTypesSnippet = { - key: "propTypeStringRequired", - prefix: "ptsr", - body: ["PropTypes.string.isRequired,"], - description: "String prop type required", + key: 'propTypeStringRequired', + prefix: 'ptsr', + body: ['PropTypes.string.isRequired,'], + description: 'String prop type required', }; const propTypeNode: PropTypesSnippet = { - key: "propTypeNode", - prefix: "ptnd", - body: ["PropTypes.node,"], + key: 'propTypeNode', + prefix: 'ptnd', + body: ['PropTypes.node,'], description: - "Anything that can be rendered: numbers, strings, elements or an array", + 'Anything that can be rendered: numbers, strings, elements or an array', }; const propTypeNodeRequired: PropTypesSnippet = { - key: "propTypeNodeRequired", - prefix: "ptndr", - body: ["PropTypes.node.isRequired,"], + key: 'propTypeNodeRequired', + prefix: 'ptndr', + body: ['PropTypes.node.isRequired,'], description: - "Anything that can be rendered: numbers, strings, elements or an array required", + 'Anything that can be rendered: numbers, strings, elements or an array required', }; const propTypeElement: PropTypesSnippet = { - key: "propTypeElement", - prefix: "ptel", - body: ["PropTypes.element,"], - description: "React element prop type", + key: 'propTypeElement', + prefix: 'ptel', + body: ['PropTypes.element,'], + description: 'React element prop type', }; const propTypeElementRequired: PropTypesSnippet = { - key: "propTypeElementRequired", - prefix: "ptelr", - body: ["PropTypes.element.isRequired,"], - description: "React element prop type required", + key: 'propTypeElementRequired', + prefix: 'ptelr', + body: ['PropTypes.element.isRequired,'], + description: 'React element prop type required', }; const propTypeInstanceOf: PropTypesSnippet = { - key: "propTypeInstanceOf", - prefix: "pti", - body: ["PropTypes.instanceOf($0),"], - description: "Is an instance of a class prop type", + key: 'propTypeInstanceOf', + prefix: 'pti', + body: ['PropTypes.instanceOf($0),'], + description: 'Is an instance of a class prop type', }; const propTypeInstanceOfRequired: PropTypesSnippet = { - key: "propTypeInstanceOfRequired", - prefix: "ptir", - body: ["PropTypes.instanceOf($0).isRequired,"], - description: "Is an instance of a class prop type required", + key: 'propTypeInstanceOfRequired', + prefix: 'ptir', + body: ['PropTypes.instanceOf($0).isRequired,'], + description: 'Is an instance of a class prop type required', }; const propTypeEnum: PropTypesSnippet = { - key: "propTypeEnum", - prefix: "pte", + key: 'propTypeEnum', + prefix: 'pte', body: ["PropTypes.oneOf(['$0']),"], - description: "Prop type limited to specific values by treating it as an enum", + description: 'Prop type limited to specific values by treating it as an enum', }; const propTypeEnumRequired: PropTypesSnippet = { - key: "propTypeEnumRequired", - prefix: "pter", + key: 'propTypeEnumRequired', + prefix: 'pter', body: ["PropTypes.oneOf(['$0']).isRequired,"], description: - "Prop type limited to specific values by treating it as an enum required", + 'Prop type limited to specific values by treating it as an enum required', }; const propTypeOneOfType: PropTypesSnippet = { - key: "propTypeOneOfType", - prefix: "ptet", - body: ["PropTypes.oneOfType([", " $0", "]),"], - description: "An object that could be one of many types", + key: 'propTypeOneOfType', + prefix: 'ptet', + body: ['PropTypes.oneOfType([', ' $0', ']),'], + description: 'An object that could be one of many types', }; const propTypeOneOfTypeRequired: PropTypesSnippet = { - key: "propTypeOneOfTypeRequired", - prefix: "ptetr", - body: ["PropTypes.oneOfType([", " $0", "]).isRequired,"], - description: "An object that could be one of many types required", + key: 'propTypeOneOfTypeRequired', + prefix: 'ptetr', + body: ['PropTypes.oneOfType([', ' $0', ']).isRequired,'], + description: 'An object that could be one of many types required', }; const propTypeArrayOf: PropTypesSnippet = { - key: "propTypeArrayOf", - prefix: "ptao", - body: ["PropTypes.arrayOf($0),"], - description: "An array of a certain type", + key: 'propTypeArrayOf', + prefix: 'ptao', + body: ['PropTypes.arrayOf($0),'], + description: 'An array of a certain type', }; const propTypeArrayOfRequired: PropTypesSnippet = { - key: "propTypeArrayOfRequired", - prefix: "ptaor", - body: ["PropTypes.arrayOf($0).isRequired,"], - description: "An array of a certain type required", + key: 'propTypeArrayOfRequired', + prefix: 'ptaor', + body: ['PropTypes.arrayOf($0).isRequired,'], + description: 'An array of a certain type required', }; const propTypeObjectOf: PropTypesSnippet = { - key: "propTypeObjectOf", - prefix: "ptoo", - body: ["PropTypes.objectOf($0),"], - description: "An object with property values of a certain type", + key: 'propTypeObjectOf', + prefix: 'ptoo', + body: ['PropTypes.objectOf($0),'], + description: 'An object with property values of a certain type', }; const propTypeObjectOfRequired: PropTypesSnippet = { - key: "propTypeObjectOfRequired", - prefix: "ptoor", - body: ["PropTypes.objectOf($0).isRequired,"], - description: "An object with property values of a certain type required", + key: 'propTypeObjectOfRequired', + prefix: 'ptoor', + body: ['PropTypes.objectOf($0).isRequired,'], + description: 'An object with property values of a certain type required', }; const propTypeShape: PropTypesSnippet = { - key: "propTypeShape", - prefix: "ptsh", - body: ["PropTypes.shape({", " $0", "}),"], - description: "An object taking on a particular shape", + key: 'propTypeShape', + prefix: 'ptsh', + body: ['PropTypes.shape({', ' $0', '}),'], + description: 'An object taking on a particular shape', }; const propTypeShapeRequired: PropTypesSnippet = { - key: "propTypeShapeRequired", - prefix: "ptshr", - body: ["PropTypes.shape({", " $0", "}).isRequired,"], - description: "An object taking on a particular shape required", + key: 'propTypeShapeRequired', + prefix: 'ptshr', + body: ['PropTypes.shape({', ' $0', '}).isRequired,'], + description: 'An object taking on a particular shape required', }; const propTypeExact: PropTypesSnippet = { - key: "propTypeExact", - prefix: "ptex", - body: ["PropTypes.exact({", " $0", "}),"], - description: "An object with warnings on extra properties", + key: 'propTypeExact', + prefix: 'ptex', + body: ['PropTypes.exact({', ' $0', '}),'], + description: 'An object with warnings on extra properties', }; const propTypeExactRequired: PropTypesSnippet = { - key: "propTypeExactRequired", - prefix: "ptexr", - body: ["PropTypes.exact({", " $0", "}).isRequired,"], - description: "An object with warnings on extra properties required", + key: 'propTypeExactRequired', + prefix: 'ptexr', + body: ['PropTypes.exact({', ' $0', '}).isRequired,'], + description: 'An object with warnings on extra properties required', }; const propTypeAny: PropTypesSnippet = { - key: "propTypeAny", - prefix: "ptany", - body: ["PropTypes.any,"], - description: "Any prop type", + key: 'propTypeAny', + prefix: 'ptany', + body: ['PropTypes.any,'], + description: 'Any prop type', }; export default [ diff --git a/src/sourceSnippets/reactNative.ts b/src/sourceSnippets/reactNative.ts index 3fdf52c..03dc035 100644 --- a/src/sourceSnippets/reactNative.ts +++ b/src/sourceSnippets/reactNative.ts @@ -1,180 +1,181 @@ +import { SnippetMapping, SnippetPlaceholders } from '../types'; + import { - reactPureComponent, - reactComponent, - react, exportDefault, -} from "./sharedSnippets"; -import { SnippetMapping, SnippetPlaceholders } from "../types"; + react, + reactComponent, + reactPureComponent, +} from './sharedSnippets'; type ReactNativeMapping = { - reactNativeImport: "imrn"; - reactNativeStyles: "rnstyle"; - reactNativeComponent: "rnc"; - reactNativeComponentWithStyles: "rncs"; - reactNativeComponentExport: "rnce"; - reactNativePureComponent: "rnpc"; - reactNativePureComponentExport: "rnpce"; - reactNativeFunctionalExportComponent: "rnfe"; - reactNativeFunctionalExportComponentWithStyles: "rnfes"; - reactNativeFunctionalComponent: "rnf"; - reactNativeFunctionalComponentWithStyles: "rnfs"; + reactNativeImport: 'imrn'; + reactNativeStyles: 'rnstyle'; + reactNativeComponent: 'rnc'; + reactNativeComponentWithStyles: 'rncs'; + reactNativeComponentExport: 'rnce'; + reactNativePureComponent: 'rnpc'; + reactNativePureComponentExport: 'rnpce'; + reactNativeFunctionalExportComponent: 'rnfe'; + reactNativeFunctionalExportComponentWithStyles: 'rnfes'; + reactNativeFunctionalComponent: 'rnf'; + reactNativeFunctionalComponentWithStyles: 'rnfs'; }; export type ReactNativeSnippet = SnippetMapping; -const reactNativeStylesSnippet = ["const styles = StyleSheet.create({})", ""]; +const reactNativeStylesSnippet = ['const styles = StyleSheet.create({})', '']; const reactNativeComponentReturn = [ - " render() {", - " return (", - " ", + ' render() {', + ' return (', + ' ', ` ${SnippetPlaceholders.LastTab}`, - " ", - " )", - " }", + ' ', + ' )', + ' }', ]; const reactNativeReturn = [ - " return (", - " ", - " $0", - " ", - " )", + ' return (', + ' ', + ' $0', + ' ', + ' )', ]; const reactNativeImport: ReactNativeSnippet = { - key: "reactNativeImport", - prefix: "imrn", - body: [`import { ${SnippetPlaceholders.LastTab} } from 'react-native'`, ""], + key: 'reactNativeImport', + prefix: 'imrn', + body: [`import { ${SnippetPlaceholders.LastTab} } from 'react-native'`, ''], }; const reactNativeStyles: ReactNativeSnippet = { - key: "reactNativeStyles", - prefix: "rnstyle", + key: 'reactNativeStyles', + prefix: 'rnstyle', body: [ - "const styles = StyleSheet.create({", + 'const styles = StyleSheet.create({', ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], }; const reactNativeComponent: ReactNativeSnippet = { - key: "reactNativeComponent", - prefix: "rnc", + key: 'reactNativeComponent', + prefix: 'rnc', body: [ "import { Text, View } from 'react-native'", ...reactComponent, `export default class ${SnippetPlaceholders.FileName} extends Component {`, ...reactNativeComponentReturn, - "}", - "", + '}', + '', ], }; const reactNativeComponentWithStyles: ReactNativeSnippet = { - key: "reactNativeComponentWithStyles", - prefix: "rncs", + key: 'reactNativeComponentWithStyles', + prefix: 'rncs', body: [ "import { Text, StyleSheet, View } from 'react-native'", ...reactComponent, `export default class ${SnippetPlaceholders.FileName} extends Component {`, ...reactNativeComponentReturn, - "}", - "", + '}', + '', ...reactNativeStylesSnippet, ], }; const reactNativeComponentExport: ReactNativeSnippet = { - key: "reactNativeComponentExport", - prefix: "rnce", + key: 'reactNativeComponentExport', + prefix: 'rnce', body: [ "import { Text, View } from 'react-native'", ...reactComponent, `export class ${SnippetPlaceholders.FileName} extends Component {`, ...reactNativeComponentReturn, - "}", + '}', ...exportDefault, ], }; const reactNativePureComponent: ReactNativeSnippet = { - key: "reactNativePureComponent", - prefix: "rnpc", + key: 'reactNativePureComponent', + prefix: 'rnpc', body: [ "import { Text, View } from 'react-native'", ...reactPureComponent, `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, ...reactNativeComponentReturn, - "}", - "", + '}', + '', ], }; const reactNativePureComponentExport: ReactNativeSnippet = { - key: "reactNativePureComponentExport", - prefix: "rnpce", + key: 'reactNativePureComponentExport', + prefix: 'rnpce', body: [ "import { Text, View } from 'react-native'", ...reactPureComponent, `export class ${SnippetPlaceholders.FileName} extends PureComponent {`, ...reactNativeComponentReturn, - "}", + '}', ...exportDefault, ], }; const reactNativeFunctionalExportComponent: ReactNativeSnippet = { - key: "reactNativeFunctionalExportComponent", - prefix: "rnfe", + key: 'reactNativeFunctionalExportComponent', + prefix: 'rnfe', body: [ "import { View, Text } from 'react-native'", ...react, `const ${SnippetPlaceholders.FileName} = () => {`, ...reactNativeReturn, - "}", + '}', ...exportDefault, ], }; const reactNativeFunctionalExportComponentWithStyles: ReactNativeSnippet = { - key: "reactNativeFunctionalExportComponentWithStyles", - prefix: "rnfes", + key: 'reactNativeFunctionalExportComponentWithStyles', + prefix: 'rnfes', body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, `const ${SnippetPlaceholders.FileName} = () => {`, ...reactNativeReturn, - "}", + '}', ...exportDefault, - "", + '', ...reactNativeStylesSnippet, ], }; const reactNativeFunctionalComponent: ReactNativeSnippet = { - key: "reactNativeFunctionalComponent", - prefix: "rnf", + key: 'reactNativeFunctionalComponent', + prefix: 'rnf', body: [ "import { View, Text } from 'react-native'", ...react, `export default function ${SnippetPlaceholders.FileName}() {`, ...reactNativeReturn, - "}", - "", + '}', + '', ], }; const reactNativeFunctionalComponentWithStyles: ReactNativeSnippet = { - key: "reactNativeFunctionalComponentWithStyles", - prefix: "rnfs", + key: 'reactNativeFunctionalComponentWithStyles', + prefix: 'rnfs', body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, `export default function ${SnippetPlaceholders.FileName}() {`, ...reactNativeReturn, - "}", - "", + '}', + '', ...reactNativeStylesSnippet, ], }; diff --git a/src/sourceSnippets/redux.ts b/src/sourceSnippets/redux.ts index 1cd0314..c39a691 100644 --- a/src/sourceSnippets/redux.ts +++ b/src/sourceSnippets/redux.ts @@ -1,104 +1,104 @@ -import { SnippetPlaceholders, SnippetMapping } from "../types"; +import { SnippetMapping, SnippetPlaceholders } from '../types'; type HookMappings = { - importReduxConnect: "redux"; - reduxAction: "rxaction"; - reduxConst: "rxconst"; - reduxReducer: "rxreducer"; - reduxSelector: "rxselect"; - reduxSlice: "rxslice"; - mappingToProps: "reduxmap"; + importReduxConnect: 'redux'; + reduxAction: 'rxaction'; + reduxConst: 'rxconst'; + reduxReducer: 'rxreducer'; + reduxSelector: 'rxselect'; + reduxSlice: 'rxslice'; + mappingToProps: 'reduxmap'; }; export type ReduxSnippet = SnippetMapping; const importReduxConnect: ReduxSnippet = { - key: "importReduxConnect", - prefix: "redux", - body: ["import { connect } from 'react-redux'", ""], + key: 'importReduxConnect', + prefix: 'redux', + body: ["import { connect } from 'react-redux'", ''], }; const reduxAction: ReduxSnippet = { - key: "reduxAction", - prefix: "rxaction", + key: 'reduxAction', + prefix: 'rxaction', body: [ `export const ${SnippetPlaceholders.FirstTab} = (payload) => ({`, ` type: ${SnippetPlaceholders.SecondTab},`, - " payload", - "})", - "", + ' payload', + '})', + '', ], }; const reduxConst: ReduxSnippet = { - key: "reduxConst", - prefix: "rxconst", + key: 'reduxConst', + prefix: 'rxconst', body: [ `export const ${SnippetPlaceholders.FirstTab} = '${SnippetPlaceholders.FirstTab}'`, ], }; const reduxReducer: ReduxSnippet = { - key: "reduxReducer", - prefix: "rxreducer", + key: 'reduxReducer', + prefix: 'rxreducer', body: [ - "const initialState = {}", - "", - "export default (state = initialState, { type, payload }) => {", - " switch (type) {", - "", + 'const initialState = {}', + '', + 'export default (state = initialState, { type, payload }) => {', + ' switch (type) {', + '', ` case ${SnippetPlaceholders.FirstTab}:`, - " return { ...state, ...payload }", - "", - " default:", - " return state", - " }", - "}", - "", + ' return { ...state, ...payload }', + '', + ' default:', + ' return state', + ' }', + '}', + '', ], }; const reduxSelector: ReduxSnippet = { - key: "reduxSelector", - prefix: "rxselect", + key: 'reduxSelector', + prefix: 'rxselect', body: [ "import { createSelector } from 'reselect'", - "", + '', `export const ${SnippetPlaceholders.FirstTab} = state => state.${SnippetPlaceholders.SecondTab}`, - "", + '', ], }; const reduxSlice: ReduxSnippet = { - key: "reduxSlice", - prefix: "rxslice", + key: 'reduxSlice', + prefix: 'rxslice', body: [ "import { createSlice } from '@reduxjs/toolkit'", - "", - "const initialState = {", - "", - "}", - "", + '', + 'const initialState = {', + '', + '}', + '', `const ${SnippetPlaceholders.FileName} = createSlice({`, ` name: ${SnippetPlaceholders.SecondTab},`, - " initialState,", - " reducers: {}", - "});", - "", + ' initialState,', + ' reducers: {}', + '});', + '', `export const {} = ${SnippetPlaceholders.FileName}.actions`, - "", + '', `export default ${SnippetPlaceholders.FileName}.reducer`, ], }; const mappingToProps: ReduxSnippet = { - key: "mappingToProps", - prefix: "reduxmap", + key: 'mappingToProps', + prefix: 'reduxmap', body: [ - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", + 'const mapStateToProps = (state) => ({})', + '', + 'const mapDispatchToProps = {}', + '', ], }; diff --git a/src/sourceSnippets/sharedSnippets.ts b/src/sourceSnippets/sharedSnippets.ts index 5c861bf..31b3158 100644 --- a/src/sourceSnippets/sharedSnippets.ts +++ b/src/sourceSnippets/sharedSnippets.ts @@ -1,75 +1,75 @@ -import { SnippetPlaceholders } from "../types"; +import { SnippetPlaceholders } from '../types'; -export const reactComponent = ["import React, { Component } from 'react'", ""]; -export const react = ["import React from 'react'", ""]; +export const reactComponent = ["import React, { Component } from 'react'", '']; +export const react = ["import React from 'react'", '']; export const reactPureComponent = [ "import React, { PureComponent } from 'react'", - "", + '', ]; export const reactPropTypes = [ "import React from 'react'", "import PropTypes from 'prop-types'", - "", + '', ]; export const reactWithReduxConnect = [ "import React from 'react'", "import { connect } from 'react-redux'", - "", + '', ]; export const reactComponentWithReduxConnect = [ "import React, { Component } from 'react'", "import { connect } from 'react-redux'", - "", + '', ]; -export const reactWithMemo = ["import React, { memo } from 'react'", ""]; +export const reactWithMemo = ["import React, { memo } from 'react'", '']; export const reduxComponentExport = [ - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", + '', + 'const mapStateToProps = (state) => ({})', + '', + 'const mapDispatchToProps = {}', + '', `export default connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FileName})`, - "", + '', ]; export const innerComponent = [ - " return (", - "
", + ' return (', + '
', ` ${SnippetPlaceholders.LastTab}`, - "
", - " )", + '
', + ' )', ]; export const innerComponentReturn = [ - " render() {", - " return (", - "
", + ' render() {', + ' return (', + '
', ` ${SnippetPlaceholders.LastTab}`, - "
", - " )", - " }", + '
', + ' )', + ' }', ]; export const exportDefault = [ - "", + '', `export default ${SnippetPlaceholders.FileName}`, - "", + '', ]; export const propsTypeInterface = [ `${SnippetPlaceholders.TypeInterface} Props {}`, - "", + '', ]; export const stateTypeInterface = [ `${SnippetPlaceholders.TypeInterface} State {}`, - "", + '', ]; export const propsStateInterface = [ ...propsTypeInterface, ...stateTypeInterface, - "", + '', ]; diff --git a/src/sourceSnippets/tests.ts b/src/sourceSnippets/tests.ts index 76f5a01..bbee965 100644 --- a/src/sourceSnippets/tests.ts +++ b/src/sourceSnippets/tests.ts @@ -1,167 +1,167 @@ -import { SnippetMapping, SnippetPlaceholders } from "../types"; +import { SnippetMapping, SnippetPlaceholders } from '../types'; type TestMapping = { - describeBlock: "desc"; - itAsyncBlock: "tita"; - itBlock: "tit"; - setupReactComponentTestWithRedux: "srtest"; - setupReactNativeTest: "sntest"; - setupReactNativeTestWithRedux: "snrtest"; - setupReactTest: "stest"; - testAsyncBlock: "testa"; - testBlock: "test"; + describeBlock: 'desc'; + itAsyncBlock: 'tita'; + itBlock: 'tit'; + setupReactComponentTestWithRedux: 'srtest'; + setupReactNativeTest: 'sntest'; + setupReactNativeTestWithRedux: 'snrtest'; + setupReactTest: 'stest'; + testAsyncBlock: 'testa'; + testBlock: 'test'; }; export type TestsSnippet = SnippetMapping; const describeBlock: TestsSnippet = { - key: "describeBlock", - prefix: "desc", + key: 'describeBlock', + prefix: 'desc', body: [ `describe('${SnippetPlaceholders.FirstTab}', () => {`, ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], - description: "Testing `describe` block", + description: 'Testing `describe` block', }; const testBlock: TestsSnippet = { - key: "testBlock", - prefix: "test", + key: 'testBlock', + prefix: 'test', body: [ `test('should ${SnippetPlaceholders.FirstTab}', () => {`, ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], - description: "Testing `test` block", + description: 'Testing `test` block', }; const testAsyncBlock: TestsSnippet = { - key: "testAsyncBlock", - prefix: "testa", + key: 'testAsyncBlock', + prefix: 'testa', body: [ `test('should ${SnippetPlaceholders.FirstTab}', async () => {`, ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], - description: "Testing `asynchronous test` block", + description: 'Testing `asynchronous test` block', }; const itBlock: TestsSnippet = { - key: "itBlock", - prefix: "tit", + key: 'itBlock', + prefix: 'tit', body: [ `it('should ${SnippetPlaceholders.FirstTab}', () => {`, ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], - description: "Testing `it` block", + description: 'Testing `it` block', }; const itAsyncBlock: TestsSnippet = { - key: "itAsyncBlock", - prefix: "tita", + key: 'itAsyncBlock', + prefix: 'tita', body: [ `it('should ${SnippetPlaceholders.FirstTab}', async () => {`, ` ${SnippetPlaceholders.LastTab}`, - "})", - "", + '})', + '', ], - description: "Testing asynchronous `it` block", + description: 'Testing asynchronous `it` block', }; const setupReactTest: TestsSnippet = { - key: "setupReactTest", - prefix: "stest", + key: 'setupReactTest', + prefix: 'stest', body: [ "import React from 'react'", "import renderer from 'react-test-renderer'", - "", + '', `import { ${SnippetPlaceholders.FileName} } from '../${SnippetPlaceholders.FileName}'`, - "", + '', `describe('<${SnippetPlaceholders.FileName} />', () => {`, - " const defaultProps = {}", + ' const defaultProps = {}', ` const wrapper = renderer.create(<${SnippetPlaceholders.FileName} {...defaultProps} />)`, - "", + '', " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})", - "", + ' expect(wrapper).toMatchSnapshot()', + ' })', + '})', + '', ], }; const setupReactNativeTest: TestsSnippet = { - key: "setupReactNativeTest", - prefix: "sntest", + key: 'setupReactNativeTest', + prefix: 'sntest', body: [ "import 'react-native'", "import React from 'react'", "import renderer from 'react-test-renderer'", - "", + '', `import ${SnippetPlaceholders.FileName} from '../${SnippetPlaceholders.FileName}'`, - "", + '', `describe('<${SnippetPlaceholders.FileName} />', () => {`, - " const defaultProps = {}", + ' const defaultProps = {}', ` const wrapper = renderer.create(<${SnippetPlaceholders.FileName} {...defaultProps} />)`, - "", + '', " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})", - "", + ' expect(wrapper).toMatchSnapshot()', + ' })', + '})', + '', ], }; const setupReactComponentTestWithRedux: TestsSnippet = { - key: "setupReactComponentTestWithRedux", - prefix: "srtest", + key: 'setupReactComponentTestWithRedux', + prefix: 'srtest', body: [ "import React from 'react'", "import renderer from 'react-test-renderer'", "import { Provider } from 'react-redux'", - "", + '', "import store from '~/store'", `import { ${SnippetPlaceholders.FileName} } from '../${SnippetPlaceholders.FileName}'`, - "", + '', `describe('<${SnippetPlaceholders.FileName} />', () => {`, - " const defaultProps = {}", - " const wrapper = renderer.create(", - " ", + ' const defaultProps = {}', + ' const wrapper = renderer.create(', + ' ', ` <${SnippetPlaceholders.FileName} {...defaultProps} />`, - " ,", - " )", - "", + ' ,', + ' )', + '', " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})", - "", + ' expect(wrapper).toMatchSnapshot()', + ' })', + '})', + '', ], - description: "Create test component", + description: 'Create test component', }; const setupReactNativeTestWithRedux: TestsSnippet = { - key: "setupReactNativeTestWithRedux", - prefix: "snrtest", + key: 'setupReactNativeTestWithRedux', + prefix: 'snrtest', body: [ "import 'react-native'", "import React from 'react'", "import renderer from 'react-test-renderer'", "import { Provider } from 'react-redux'", - "", + '', "import store from '~/store'", `import ${SnippetPlaceholders.FileName} from '../${SnippetPlaceholders.FileName}'`, - "", + '', `describe('<${SnippetPlaceholders.FileName} />', () => {`, - " const defaultProps = {}", - " const wrapper = renderer.create(", - " ", + ' const defaultProps = {}', + ' const wrapper = renderer.create(', + ' ', ` <${SnippetPlaceholders.FileName} {...defaultProps} />`, - " ,", - " )", - "", + ' ,', + ' )', + '', " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})", - "", + ' expect(wrapper).toMatchSnapshot()', + ' })', + '})', + '', ], }; diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts index fe85e2d..b69789c 100644 --- a/src/sourceSnippets/typescript.ts +++ b/src/sourceSnippets/typescript.ts @@ -1,3 +1,5 @@ +import { SnippetMapping, SnippetPlaceholders } from '../types'; + import { exportDefault, innerComponent, @@ -8,25 +10,24 @@ import { reactComponent, reactPureComponent, reduxComponentExport, -} from "./sharedSnippets"; -import { SnippetPlaceholders, SnippetMapping } from "../types"; +} from './sharedSnippets'; type TypescriptMappings = { - exportInterface: "expint"; - exportType: "exptp"; - typescriptReactArrowFunctionComponent: "tsrafc"; - typescriptReactArrowFunctionExportComponent: "tsrafce"; - typescriptReactClassComponent: "tsrcc"; - typescriptReactClassComponentRedux: "tsrcredux"; - typescriptReactClassExportComponent: "tsrce"; - typescriptReactClassExportPureComponent: "tsrpce"; - typescriptReactClassPureComponent: "tsrpc"; - typescriptReactFunctionMemoComponent: "tsrmc"; - typescriptReactFunctionalComponent: "tsrfc"; - typescriptReactFunctionalExportComponent: "tsrfce"; - typescriptReactNativeArrowFunctionComponent: "tsrnf"; - typescriptReactNativeArrowFunctionComponentNamedProps: "tsrnfi"; - typescriptReactNativeArrowFunctionComponentWithStyles: "tsrnfs"; + exportInterface: 'expint'; + exportType: 'exptp'; + typescriptReactArrowFunctionComponent: 'tsrafc'; + typescriptReactArrowFunctionExportComponent: 'tsrafce'; + typescriptReactClassComponent: 'tsrcc'; + typescriptReactClassComponentRedux: 'tsrcredux'; + typescriptReactClassExportComponent: 'tsrce'; + typescriptReactClassExportPureComponent: 'tsrpce'; + typescriptReactClassPureComponent: 'tsrpc'; + typescriptReactFunctionMemoComponent: 'tsrmc'; + typescriptReactFunctionalComponent: 'tsrfc'; + typescriptReactFunctionalExportComponent: 'tsrfce'; + typescriptReactNativeArrowFunctionComponent: 'tsrnf'; + typescriptReactNativeArrowFunctionComponentNamedProps: 'tsrnfi'; + typescriptReactNativeArrowFunctionComponentWithStyles: 'tsrnfs'; }; export type TypescriptSnippet = SnippetMapping; @@ -35,223 +36,223 @@ const exportType: TypescriptSnippet = { body: [ `export type ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, ], - key: "exportType", - prefix: "exptp", + key: 'exportType', + prefix: 'exptp', }; const exportInterface: TypescriptSnippet = { - key: "exportInterface", - prefix: "expint", + key: 'exportInterface', + prefix: 'expint', body: [ `export exportInterface ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, - "", + '', ], }; const typescriptReactClassComponent: TypescriptSnippet = { - key: "typescriptReactClassComponent", - prefix: "tsrcc", + key: 'typescriptReactClassComponent', + prefix: 'tsrcc', description: - "Creates a React component class with ES7 module system and TypeScript interfaces", + 'Creates a React component class with ES7 module system and TypeScript interfaces', body: [ ...reactComponent, ...propsStateInterface, `export default class ${SnippetPlaceholders.FileName} extends Component {`, - " state = {}", - "", + ' state = {}', + '', ...innerComponentReturn, - "}", - "", + '}', + '', ], }; const typescriptReactClassExportComponent: TypescriptSnippet = { - key: "typescriptReactClassExportComponent", - prefix: "tsrce", + key: 'typescriptReactClassExportComponent', + prefix: 'tsrce', body: [ ...reactComponent, ...propsStateInterface, `class ${SnippetPlaceholders.FileName} extends Component {`, - " state = {}", - "", + ' state = {}', + '', ...innerComponentReturn, - "}", + '}', ...exportDefault, ], description: - "Creates a React component class with ES7 module system and TypeScript interfaces", + 'Creates a React component class with ES7 module system and TypeScript interfaces', }; const typescriptReactFunctionalExportComponent: TypescriptSnippet = { - key: "typescriptReactFunctionalExportComponent", - prefix: "tsrfce", + key: 'typescriptReactFunctionalExportComponent', + prefix: 'tsrfce', body: [ ...react, ...propsTypeInterface, `function ${SnippetPlaceholders.FileName}({}: Props) {`, ...innerComponent, - "}", + '}', ...exportDefault, ], description: - "Creates a React Functional Component with ES7 module system and TypeScript interface", + 'Creates a React Functional Component with ES7 module system and TypeScript interface', }; const typescriptReactFunctionalComponent: TypescriptSnippet = { - key: "typescriptReactFunctionalComponent", - prefix: "tsrfc", + key: 'typescriptReactFunctionalComponent', + prefix: 'tsrfc', body: [ ...react, ...propsTypeInterface, `export default function ${SnippetPlaceholders.FileName}({}: Props) {`, ...innerComponent, - "}", - "", + '}', + '', ], description: - "Creates a React Functional Component with ES7 module system and TypeScript interface", + 'Creates a React Functional Component with ES7 module system and TypeScript interface', }; const typescriptReactArrowFunctionExportComponent: TypescriptSnippet = { - key: "typescriptReactArrowFunctionExportComponent", - prefix: "tsrafce", + key: 'typescriptReactArrowFunctionExportComponent', + prefix: 'tsrafce', body: [ ...react, ...propsTypeInterface, `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, ...innerComponent, - "}", + '}', ...exportDefault, ], description: - "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + 'Creates a React Arrow Function Component with ES7 module system and TypeScript interface', }; const typescriptReactArrowFunctionComponent: TypescriptSnippet = { - key: "typescriptReactArrowFunctionComponent", - prefix: "tsrafc", + key: 'typescriptReactArrowFunctionComponent', + prefix: 'tsrafc', body: [ ...react, ...propsTypeInterface, `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, ...innerComponent, - "}", - "", + '}', + '', ], description: - "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + 'Creates a React Arrow Function Component with ES7 module system and TypeScript interface', }; const typescriptReactClassPureComponent: TypescriptSnippet = { - key: "typescriptReactClassPureComponent", - prefix: "tsrpc", + key: 'typescriptReactClassPureComponent', + prefix: 'tsrpc', body: [ ...reactPureComponent, ...propsTypeInterface, `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, ...innerComponentReturn, - "}", - "", + '}', + '', ], description: - "Creates a React pure component class with ES7 module system and TypeScript interface", + 'Creates a React pure component class with ES7 module system and TypeScript interface', }; const typescriptReactClassExportPureComponent: TypescriptSnippet = { - key: "typescriptReactClassExportPureComponent", - prefix: "tsrpce", + key: 'typescriptReactClassExportPureComponent', + prefix: 'tsrpce', body: [ ...reactPureComponent, ...propsTypeInterface, `class ${SnippetPlaceholders.FileName} extends PureComponent {`, ...innerComponentReturn, - "}", + '}', ...exportDefault, ], description: - "Creates a React pure component class with ES7 module system and TypeScript interface", + 'Creates a React pure component class with ES7 module system and TypeScript interface', }; const typescriptReactClassComponentRedux: TypescriptSnippet = { - key: "typescriptReactClassComponentRedux", - prefix: "tsrcredux", + key: 'typescriptReactClassComponentRedux', + prefix: 'tsrcredux', body: [ "import { connect } from 'react-redux'", ...reactComponent, ...propsStateInterface, `export class ${SnippetPlaceholders.FileName} extends Component {`, - " state = {}", - "", + ' state = {}', + '', ...innerComponentReturn, - "}", + '}', ...reduxComponentExport, ], description: - "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", + 'Creates a React component class with connected redux and ES7 module system and TypeScript interfaces', }; const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = { - key: "typescriptReactNativeArrowFunctionComponent", - prefix: "tsrnf", + key: 'typescriptReactNativeArrowFunctionComponent', + prefix: 'tsrnf', body: [ "import { View, Text } from 'react-native'", ...react, ...propsTypeInterface, `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, - " return (", - " ", + ' return (', + ' ', ` ${SnippetPlaceholders.LastTab}`, - " ", - " )", - "}", + ' ', + ' )', + '}', ...exportDefault, ], description: - "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface", + 'Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface', }; const typescriptReactNativeArrowFunctionComponentNamedProps: TypescriptSnippet = { - key: "typescriptReactNativeArrowFunctionComponentNamedProps", - prefix: "tsrnfi", + key: 'typescriptReactNativeArrowFunctionComponentNamedProps', + prefix: 'tsrnfi', body: [ "import { View } from 'react-native'", ...react, ...propsTypeInterface, `const ${SnippetPlaceholders.FileName}: React.FC<${SnippetPlaceholders.FileName}Props> = (props) => {`, - " return (", - " ", + ' return (', + ' ', ` ${SnippetPlaceholders.LastTab}`, - " ", - " )", - "}", + ' ', + ' )', + '}', ...exportDefault, ], description: - "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface", + 'Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface', }; const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = { - key: "typescriptReactNativeArrowFunctionComponentWithStyles", - prefix: "tsrnfs", + key: 'typescriptReactNativeArrowFunctionComponentWithStyles', + prefix: 'tsrnfs', body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, ...propsTypeInterface, `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, - " return (", - " ", + ' return (', + ' ', ` ${SnippetPlaceholders.LastTab}`, - " ", - " )", - "}", + ' ', + ' )', + '}', ...exportDefault, - "const styles = StyleSheet.create({})", - "", + 'const styles = StyleSheet.create({})', + '', ], description: - "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", + 'Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet', }; export default [ diff --git a/src/types.ts b/src/types.ts index 3604f80..2a6673a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,15 +1,15 @@ export type SnippetMapping = { key: keyof T; prefix: T[keyof T]; - body: Array; + body: string[]; description?: string; }; export enum SnippetPlaceholders { - FileName = "FILE_NAME", - FirstTab = "FIRST_TAB", - SecondTab = "SECOND_TAB", - ThirdTab = "THIRD_TAB", - LastTab = "LAST_TAB", - TypeInterface = "TYPE_INTERFACE", + FileName = 'FILE_NAME', + FirstTab = 'FIRST_TAB', + SecondTab = 'SECOND_TAB', + ThirdTab = 'THIRD_TAB', + LastTab = 'LAST_TAB', + TypeInterface = 'TYPE_INTERFACE', } diff --git a/yarn.lock b/yarn.lock index 0752a89..7ec1ffe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,6 +25,15 @@ dependencies: "@babel/highlight" "^7.16.0" +"@babel/eslint-parser@7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.16.5.tgz#48d3485091d6e36915358e4c0d0b2ebe6da90462" + integrity sha512-mUqYa46lgWqHKQ33Q6LNCGp/wPR3eqOYTUixHFsfrSQqRxH0+WOzca75iEjFr5RDGH1dDz622LaHhLOzOuQRUA== + dependencies: + eslint-scope "^5.1.1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + "@babel/generator@^7.16.5": version "7.16.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.5.tgz#26e1192eb8f78e0a3acaf3eede3c6fc96d22bedf" @@ -237,11 +246,42 @@ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@types/json-schema@^7.0.9": + version "7.0.9" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + "@types/node@17.0.5": version "17.0.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0" @@ -257,6 +297,76 @@ resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.63.1.tgz#b40f9f18055e2c9498ae543d18c59fbd6ef2e8a3" integrity sha512-Z+ZqjRcnGfHP86dvx/BtSwWyZPKQ/LBdmAVImY82TphyjOw2KgTKcp7Nx92oNwCTsHzlshwexAG/WiY2JuUm3g== +"@typescript-eslint/eslint-plugin@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz#97dfaa39f38e99f86801fdf34f9f1bed66704258" + integrity sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw== + dependencies: + "@typescript-eslint/experimental-utils" "5.8.1" + "@typescript-eslint/scope-manager" "5.8.1" + debug "^4.3.2" + functional-red-black-tree "^1.0.1" + ignore "^5.1.8" + regexpp "^3.2.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@5.8.1", "@typescript-eslint/experimental-utils@^5.0.0": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz#01861eb2f0749f07d02db342b794145a66ed346f" + integrity sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.8.1" + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/typescript-estree" "5.8.1" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.8.1.tgz#380f5f1e596b540059998aa3fc80d78f0f9b0d0a" + integrity sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw== + dependencies: + "@typescript-eslint/scope-manager" "5.8.1" + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/typescript-estree" "5.8.1" + debug "^4.3.2" + +"@typescript-eslint/scope-manager@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz#7fc0604f7ade8833e4d42cebaa1e2debf8b932e4" + integrity sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q== + dependencies: + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/visitor-keys" "5.8.1" + +"@typescript-eslint/types@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" + integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== + +"@typescript-eslint/typescript-estree@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" + integrity sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ== + dependencies: + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/visitor-keys" "5.8.1" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" + integrity sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg== + dependencies: + "@typescript-eslint/types" "5.8.1" + eslint-visitor-keys "^3.0.0" + acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -328,6 +438,31 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +array-includes@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" + integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + get-intrinsic "^1.1.1" + is-string "^1.0.7" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array.prototype.flat@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" + integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -346,7 +481,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@~3.0.2: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -363,6 +498,14 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -469,7 +612,14 @@ debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: dependencies: ms "2.1.2" -debug@^3.1.0: +debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.1.0, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -481,11 +631,32 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -500,6 +671,41 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" +es-abstract@^1.19.0, es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.1" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" + is-string "^1.0.7" + is-weakref "^1.0.1" + object-inspect "^1.11.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es6-promise@^4.0.3: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" @@ -522,11 +728,94 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +eslint-config-prettier@8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" + integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== + +eslint-import-resolver-node@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" + integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-module-utils@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" + integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== + dependencies: + debug "^3.2.7" + find-up "^2.1.0" + pkg-dir "^2.0.0" + +eslint-plugin-babel@5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.1.tgz#75a2413ffbf17e7be57458301c60291f2cfbf560" + integrity sha512-VsQEr6NH3dj664+EyxJwO4FCYm/00JhYb3Sk3ft8o+fpKuIfQ9TaW6uVUfvwMXHcf/lsnRIoyFPsLMyiWCSL/g== + dependencies: + eslint-rule-composer "^0.3.0" + +eslint-plugin-eslint-comments@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz#9e1cd7b4413526abb313933071d7aba05ca12ffa" + integrity sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ== + dependencies: + escape-string-regexp "^1.0.5" + ignore "^5.0.5" + +eslint-plugin-import@2.25.3: + version "2.25.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766" + integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg== + dependencies: + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.7.1" + has "^1.0.3" + is-core-module "^2.8.0" + is-glob "^4.0.3" + minimatch "^3.0.4" + object.values "^1.1.5" + resolve "^1.20.0" + tsconfig-paths "^3.11.0" + +eslint-plugin-jest@25.3.3: + version "25.3.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-25.3.3.tgz#60bb52a08ff37933adf8b19ba9b216c13c22fdc7" + integrity sha512-qi7aduaU4/oWegWo0zH4kbJbx8+Be+ABTr72OnO68zTMcJeeSuyH1CduTGF4ATyNFgpE1zp0u10/gIhe+QDSfg== + dependencies: + "@typescript-eslint/experimental-utils" "^5.0.0" + +eslint-plugin-prettier@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" + integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== + dependencies: + prettier-linter-helpers "^1.0.0" + eslint-plugin-simple-import-sort@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz#a1dad262f46d2184a90095a60c66fef74727f0f8" integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw== +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" + integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + eslint-scope@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" @@ -542,12 +831,12 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^2.0.0: +eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.1.0: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== @@ -619,6 +908,11 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + estraverse@^5.1.0, estraverse@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" @@ -634,6 +928,22 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-glob@^3.1.1: + version "3.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -644,6 +954,13 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -658,6 +975,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -686,25 +1010,47 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -glob-parent@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== dependencies: - is-glob "^4.0.3" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" -glob-parent@~5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -741,11 +1087,28 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" +globby@^11.0.4: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -756,6 +1119,25 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -799,6 +1181,11 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.0.5, ignore@^5.1.4, ignore@^5.1.8: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -825,6 +1212,22 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -832,6 +1235,33 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + +is-core-module@^2.2.0, is-core-module@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -844,11 +1274,57 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-negative-zero@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + dependencies: + has-tostringtag "^1.0.0" + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-weakref@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -881,6 +1357,13 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -889,6 +1372,14 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -909,6 +1400,19 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -921,6 +1425,11 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= +minimist@^1.2.0: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + mkdirp@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -970,6 +1479,35 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +object-inspect@^1.11.0, object-inspect@^1.9.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -989,6 +1527,25 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -996,6 +1553,11 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -1006,7 +1568,17 @@ path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -picomatch@^2.0.4, picomatch@^2.2.1: +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== @@ -1016,11 +1588,25 @@ pify@^4.0.1: resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + prettier@2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" @@ -1036,6 +1622,11 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -1053,6 +1644,19 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== +resolve@^1.20.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -1060,6 +1664,13 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -1070,7 +1681,12 @@ semver@^5.4.1, semver@^5.6.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^7.2.1: +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.2.1, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -1089,11 +1705,25 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + source-map-support@^0.5.0: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -1112,6 +1742,22 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -1119,6 +1765,11 @@ strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -1162,6 +1813,28 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +tsconfig-paths@^3.11.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" + integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -1179,6 +1852,16 @@ typescript@4.5.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== +unbox-primitive@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -1212,6 +1895,17 @@ vscode@1.1.37: source-map-support "^0.5.0" vscode-test "^0.4.1" +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" From de763f2732ac67bb9c626b5279594cfbe9c3ef71 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 31 Dec 2021 01:27:37 +0100 Subject: [PATCH 084/110] docs: move snippets to separate file --- README.md | 751 +--------------------------------------- docs/Snippets.md | 739 +++++++++++++++++++++++++++++++++++++++ package.json | 2 +- src/generateSnippets.ts | 26 +- src/helpers.ts | 4 +- src/snippetSearch.ts | 10 +- 6 files changed, 760 insertions(+), 772 deletions(-) create mode 100644 docs/Snippets.md diff --git a/README.md b/README.md index 6edbb1c..2751c7f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Downloads](https://vsmarketplacebadge.apphb.com/downloads/dsznajder.es7-react-js-snippets.svg)](https://vsmarketplacebadge.apphb.com/downloads-short/dsznajder.es7-react-js-snippets.svg) [![Ratings](https://vsmarketplacebadge.apphb.com/rating-short/dsznajder.es7-react-js-snippets.svg)](https://vsmarketplacebadge.apphb.com/rating-short/dsznajder.es7-react-js-snippets.svg) -# VS Code ES7 React/Redux/React-Native/JS snippets +# VS Code ES7+ React/Redux/React-Native/JS snippets JavaScript and React/Redux snippets in ES7+ with Babel plugin features for [VS Code](https://code.visualstudio.com/) @@ -52,751 +52,4 @@ Here is direct link to marketplace [ES7 React/Redux/React-Native/JS Snippets](ht
-## Supported languages (file extensions) - -- JavaScript (.js) -- JavaScript React (.jsx) -- TypeScript (.ts) -- TypeScript React (.tsx) - -## Snippets info - -Every space inside `{ }` and `( )` means that this is pushed into next line :) -`$` represent each step after `tab`. - -_TypeScript_ has own components and own snippets. Use search or just type `ts` before every component snippet. - -I.E. `tsrcc` - -React 17 is currently supported by `_` prefix. - -
- -### Basic Methods - -| Prefix | Method | -| ------: | --------------------------------------------------- | -| `imp→` | `import moduleName from 'module'` | -| `imn→` | `import 'module'` | -| `imd→` | `import { destructuredModule } from 'module'` | -| `ime→` | `import * as alias from 'module'` | -| `ima→` | `import { originalName as aliasName} from 'module'` | -| `exp→` | `export default moduleName` | -| `exd→` | `export { destructuredModule } from 'module'` | -| `exa→` | `export { originalName as aliasName} from 'module'` | -| `enf→` | `export const functionName = (params) => { }` | -| `edf→` | `export default (params) => { }` | -| `ednf→` | `export default function functionName(params) { }` | -| `met→` | `methodName = (params) => { }` | -| `fre→` | `arrayName.forEach(element => { }` | -| `fof→` | `for(let itemName of objectName { }` | -| `fin→` | `for(let itemName in objectName { }` | -| `anfn→` | `(params) => { }` | -| `nfn→` | `const functionName = (params) => { }` | -| `dob→` | `const {propName} = objectToDescruct` | -| `dar→` | `const [propName] = arrayToDescruct` | -| `sti→` | `setInterval(() => { }, intervalTime` | -| `sto→` | `setTimeout(() => { }, delayTime` | -| `prom→` | `return new Promise((resolve, reject) => { }` | -| `cmmb→` | `comment block` | -| `cp→` | `const { } = this.props` | -| `cs→` | `const { } = this.state` | - -### React - -| Prefix | Method | -| ----------: | --------------------------------------------------------------------------- | -| `imr→` | `import React from 'react'` | -| `imrd→` | `import ReactDOM from 'react-dom'` | -| `imrc→` | `import React, { Component } from 'react'` | -| `imrpc→` | `import React, { PureComponent } from 'react'` | -| `imrm→` | `import React, { memo } from 'react'` | -| `imrr→` | `import { BrowserRouter as Router, Route, NavLink} from 'react-router-dom'` | -| `imbr→` | `import { BrowserRouter as Router} from 'react-router-dom'` | -| `imbrc→` | `import { Route, Switch, NavLink, Link } from react-router-dom'` | -| `imbrr→` | `import { Route } from 'react-router-dom'` | -| `imbrs→` | `import { Switch } from 'react-router-dom'` | -| `imbrl→` | `import { Link } from 'react-router-dom'` | -| `imbrnl→` | `import { NavLink } from 'react-router-dom'` | -| `imrs→` | `import React, { useState } from 'react'` | -| `imrse→` | `import React, { useState, useEffect } from 'react'` | -| `redux→` | `import { connect } from 'react-redux'` | -| `rconst→` | `constructor(props) with this.state` | -| `rconc→` | `constructor(props, context) with this.state` | -| `est→` | `this.state = { }` | -| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | -| `cdm→` | `componentDidMount = () => { }` | -| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | -| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | -| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | -| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | -| `cwun→` | `componentWillUnmount = () => { }` | -| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | -| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | -| `sst→` | `this.setState({ })` | -| `ssf→` | `this.setState((state, props) => return { })` | -| `props→` | `this.props.propName` | -| `state→` | `this.state.stateName` | -| `rcontext→` | `const $1 = React.createContext()` | -| `cref→` | `this.$1Ref = React.createRef()` | -| `fref→` | `const ref = React.createRef()` | -| `bnd→` | `this.methodName = this.methodName.bind(this)` | - -### React Hooks - -- All hooks from [official docs](https://reactjs.org/docs/hooks-reference.html) are added with hook name prefix. - -### React Native - -| Prefix | Method | -| ---------: | -------------------------------------- | -| `imrn→` | `import { $1 } from 'react-native'` | -| `rnstyle→` | `const styles = StyleSheet.create({})` | - -### Redux - -| Prefix | Method | -| -----------: | ------------------------- | -| `rxaction→` | `redux action template` | -| `rxconst→` | `export const $1 = '$1'` | -| `rxreducer→` | `redux reducer template` | -| `rxselect→` | `redux selector template` | -| `rxslice→` | `redux slice template` | - -### PropTypes - -| Prefix | Method | -| --------: | ---------------------------------------- | -| `pta→` | `PropTypes.array` | -| `ptar→` | `PropTypes.array.isRequired` | -| `ptb→` | `PropTypes.bool` | -| `ptbr→` | `PropTypes.bool.isRequired` | -| `ptf→` | `PropTypes.func` | -| `ptfr→` | `PropTypes.func.isRequired` | -| `ptn→` | `PropTypes.number` | -| `ptnr→` | `PropTypes.number.isRequired` | -| `pto→` | `PropTypes.object` | -| `ptor→` | `PropTypes.object.isRequired` | -| `pts→` | `PropTypes.string` | -| `ptsr→` | `PropTypes.string.isRequired` | -| `ptnd→` | `PropTypes.node` | -| `ptndr→` | `PropTypes.node.isRequired` | -| `ptel→` | `PropTypes.element` | -| `ptelr→` | `PropTypes.element.isRequired` | -| `pti→` | `PropTypes.instanceOf(name)` | -| `ptir→` | `PropTypes.instanceOf(name).isRequired` | -| `pte→` | `PropTypes.oneOf([name])` | -| `pter→` | `PropTypes.oneOf([name]).isRequired` | -| `ptet→` | `PropTypes.oneOfType([name])` | -| `ptetr→` | `PropTypes.oneOfType([name]).isRequired` | -| `ptao→` | `PropTypes.arrayOf(name)` | -| `ptaor→` | `PropTypes.arrayOf(name).isRequired` | -| `ptoo→` | `PropTypes.objectOf(name)` | -| `ptoor→` | `PropTypes.objectOf(name).isRequired` | -| `ptsh→` | `PropTypes.shape({ })` | -| `ptshr→` | `PropTypes.shape({ }).isRequired` | -| `ptany→` | `PropTypes.any` | -| `ptypes→` | `static propTypes = {}` | - -### Console - -| Prefix | Method | -| ------ | ------------------------------------------------------------ | -| `clg→` | `console.log(object)` | -| `clo→` | `` console.log(`object`, object) `` | -| `clj→` | `` console.log(`object`, JSON.stringify(object, null, 2)) `` | -| `ctm→` | `` console.time(`timeId`) `` | -| `cte→` | `` console.timeEnd(`timeId`) `` | -| `cas→` | `console.assert(expression,object)` | -| `ccl→` | `console.clear()` | -| `cco→` | `console.count(label)` | -| `cdi→` | `console.dir` | -| `cer→` | `console.error(object)` | -| `cgr→` | `console.group(label)` | -| `cge→` | `console.groupEnd()` | -| `ctr→` | `console.trace(object)` | -| `cwa→` | `console.warn` | -| `cin→` | `console.info` | - -### React Components - -### Note for React 17 use `_` prefix. Currently workaround for future options. - -### `rcc` - -```javascript -import React, { Component } from "react"; - -export default class FileName extends Component { - render() { - return
$2
; - } -} -``` - -### `rce` - -```javascript -import React, { Component } from "react"; - -export class FileName extends Component { - render() { - return
$2
; - } -} - -export default $1; -``` - -### `rcep` - -```javascript -import React, { Component } from "react"; -import PropTypes from "prop-types"; - -export class FileName extends Component { - static propTypes = {}; - - render() { - return
$2
; - } -} - -export default $1; -``` - -### `rpc` - -```javascript -import React, { PureComponent } from "react"; - -export default class FileName extends PureComponent { - render() { - return
$2
; - } -} -``` - -### `rpcp` - -```javascript -import React, { PureComponent } from "react"; -import PropTypes from "prop-types"; - -export default class FileName extends PureComponent { - static propTypes = {}; - - render() { - return
$2
; - } -} -``` - -### `rpce` - -```javascript -import React, { PureComponent } from "react"; -import PropTypes from "prop-types"; - -export class FileName extends PureComponent { - static propTypes = {}; - - render() { - return
$2
; - } -} - -export default FileName; -``` - -### `rccp` - -```javascript -import React, { Component } from "react"; -import PropTypes from "prop-types"; - -export default class FileName extends Component { - static propTypes = { - $2: $3, - }; - - render() { - return
$4
; - } -} -``` - -### `rfcp` - -```javascript -import React from "react"; -import PropTypes from "prop-types"; - -function $1(props) { - return
$0
; -} - -$1.propTypes = {}; - -export default $1; -``` - -### `rfc` - -```javascript -import React from "react"; - -export default function $1() { - return
$0
; -} -``` - -### `rfce` - -```javascript -import React from "react"; - -function $1() { - return
$0
; -} - -export default $1; -``` - -### `rafcp` - -```javascript -import React from "react"; -import PropTypes from "prop-types"; - -const $1 = (props) => { - return
$0
; -}; - -$1.propTypes = {}; - -export default $1; -``` - -### `rafc` - -```javascript -import React from "react"; - -export const $1 = () => { - return
$0
; -}; -``` - -### `rafce` - -```javascript -import React from "react"; - -const $1 = () => { - return
$0
; -}; - -export default $1; -``` - -### `rmc` - -```javascript -import React, { memo } from "react"; - -export default memo(function $1() { - return
$0
; -}); -``` - -### `rmcp` - -```javascript -import React, { memo } from "react"; -import PropTypes from "prop-types"; - -const $1 = memo(function $1(props) { - return
$0
; -}); - -$1.propTypes = {}; - -export default $1; -``` - -### `rcredux` - -```javascript -import React, { Component } from "react"; -import { connect } from "react-redux"; - -export class FileName extends Component { - render() { - return
$4
; - } -} - -const mapStateToProps = (state) => ({}); - -const mapDispatchToProps = {}; - -export default connect(mapStateToProps, mapDispatchToProps)(FileName); -``` - -### `rcreduxp` - -```javascript -import React, { Component } from "react"; -import PropTypes from "prop-types"; -import { connect } from "react-redux"; - -export class FileName extends Component { - static propTypes = { - $2: $3, - }; - - render() { - return
$4
; - } -} - -const mapStateToProps = (state) => ({}); - -const mapDispatchToProps = {}; - -export default connect(mapStateToProps, mapDispatchToProps)(FileName); -``` - -### `rfcredux` - -```javascript -import React, { Component } from "react"; -import { connect } from "react-redux"; - -export const FileName = () => { - return
$4
; -}; - -const mapStateToProps = (state) => ({}); - -const mapDispatchToProps = {}; - -export default connect(mapStateToProps, mapDispatchToProps)(FileName); -``` - -### `rfreduxp` - -```javascript -import React, { Component } from "react"; -import PropTypes from "prop-types"; -import { connect } from "react-redux"; - -export const FileName = () => { - return
$4
; -}; - -FileName.propTypes = { - $2: $3, -}; - -const mapStateToProps = (state) => ({}); - -const mapDispatchToProps = {}; - -export default connect(mapStateToProps, mapDispatchToProps)(FileName); -``` - -### `reduxmap` - -```javascript -const mapStateToProps = (state) => ({}); - -const mapDispatchToProps = {}; -``` - -## React Native Components - -### `rnc` - -```javascript -import React, { Component } from "react"; -import { Text, View } from "react-native"; - -export default class FileName extends Component { - render() { - return ( - - $2 - - ); - } -} -``` - -### `rnf` - -```javascript -import React from "react"; -import { View, Text } from "react-native"; - -export default function $1() { - return ( - - $2 - - ); -} -``` - -### `rnfs` - -```javascript -import React from "react"; -import { StyleSheet, View, Text } from "react-native"; - -export default function $1() { - return ( - - $2 - - ); -} - -const styles = StyleSheet.create({}); -``` - -### `rnfe` - -```javascript -import React from "react"; -import { View, Text } from "react-native"; - -const $1 = () => { - return ( - - $2 - - ); -}; - -export default $1; -``` - -### `rnfes` - -```javascript -import React from "react"; -import { StyleSheet, View, Text } from "react-native"; - -const $1 = () => { - return ( - - $2 - - ); -}; - -export default $1; - -const styles = StyleSheet.create({}); -``` - -### `rncs` - -```javascript -import React, { Component } from "react"; -import { Text, StyleSheet, View } from "react-native"; - -export default class FileName extends Component { - render() { - return ( - - $2 - - ); - } -} - -const styles = StyleSheet.create({}); -``` - -### `rnce` - -```javascript -import React, { Component } from "react"; -import { Text, View } from "react-native"; - -export class FileName extends Component { - render() { - return ( - - $2 - - ); - } -} - -export default $1; -``` - -## Others - -### `cmmb` - -```JS -/** -|-------------------------------------------------- -| $1 -|-------------------------------------------------- -*/ -``` - -### `desc` - -```javascript -describe("$1", () => { - $2; -}); -``` - -### `test` - -```javascript -test("should $1", () => { - $2; -}); -``` - -### `tit` - -```javascript -it("should $1", () => { - $2; -}); -``` - -### `stest` - -```javascript -import React from "react"; -import renderer from "react-test-renderer"; - -import { $1 } from "../$1"; - -describe("<$1 />", () => { - const defaultProps = {}; - const wrapper = renderer.create(<$1 {...defaultProps} />); - - test("render", () => { - expect(wrapper).toMatchSnapshot(); - }); -}); -``` - -### `srtest` - -```javascript -import React from "react"; -import renderer from "react-test-renderer"; -import { Provider } from "react-redux"; - -import store from "src/store"; -import { $1 } from "../$1"; - -describe("<$1 />", () => { - const defaultProps = {}; - const wrapper = renderer.create( - - <$1 {...defaultProps} />) - , - ); - - test("render", () => { - expect(wrapper).toMatchSnapshot(); - }); -}); -``` - -### `sntest` - -```javascript -import "react-native"; -import React from "react"; -import renderer from "react-test-renderer"; - -import $1 from "../$1"; - -describe("<$1 />", () => { - const defaultProps = {}; - - const wrapper = renderer.create(<$1 {...defaultProps} />); - - test("render", () => { - expect(wrapper).toMatchSnapshot(); - }); -}); -``` - -### `snrtest` - -```javascript -import "react-native"; -import React from "react"; -import renderer from "react-test-renderer"; -import { Provider } from "react-redux"; - -import store from "src/store/configureStore"; -import $1 from "../$1"; - -describe("<$1 />", () => { - const defaultProps = {}; - const wrapper = renderer.create( - - <$1 {...defaultProps} /> - , - ); - - test("render", () => { - expect(wrapper).toMatchSnapshot(); - }); -}); -``` - -### `hocredux` - -```javascript -import React from "react"; -import PropTypes from "prop-types"; -import { connect } from "react-redux"; - -export const mapStateToProps = (state) => ({}); - -export const mapDispatchToProps = {}; - -export const $1 = (WrappedComponent) => { - const hocComponent = ({ ...props }) => ; - - hocComponent.propTypes = {}; - - return hocComponent; -}; - -export default (WrapperComponent) => - connect(mapStateToProps, mapDispatchToProps)($1(WrapperComponent)); -``` - -### `hoc` - -```javascript -import React from "react"; -import PropTypes from "prop-types"; - -export default (WrappedComponent) => { - const hocComponent = ({ ...props }) => ; - - hocComponent.propTypes = {}; - - return hocComponent; -}; -``` +## [Snippets](./docs/Snippets.md) diff --git a/docs/Snippets.md b/docs/Snippets.md new file mode 100644 index 0000000..53691e4 --- /dev/null +++ b/docs/Snippets.md @@ -0,0 +1,739 @@ +# Snippets + +## Snippets info + +Every space inside `{ }` and `( )` means that this is pushed into next line :) +`$` represent each step after `tab`. + +_TypeScript_ has own components and own snippets. Use search or just type `ts` before every component snippet. + +I.E. `tsrcc` + +
+ +### React Hooks + +- Hooks from [official docs](https://reactjs.org/docs/hooks-reference.html) are added with hook name as prefix. + +### Basic Methods + +| Prefix | Method | +| ------: | --------------------------------------------------- | +| `imp→` | `import moduleName from 'module'` | +| `imn→` | `import 'module'` | +| `imd→` | `import { destructuredModule } from 'module'` | +| `ime→` | `import * as alias from 'module'` | +| `ima→` | `import { originalName as aliasName} from 'module'` | +| `exp→` | `export default moduleName` | +| `exd→` | `export { destructuredModule } from 'module'` | +| `exa→` | `export { originalName as aliasName} from 'module'` | +| `enf→` | `export const functionName = (params) => { }` | +| `edf→` | `export default (params) => { }` | +| `ednf→` | `export default function functionName(params) { }` | +| `met→` | `methodName = (params) => { }` | +| `fre→` | `arrayName.forEach(element => { }` | +| `fof→` | `for(let itemName of objectName { }` | +| `fin→` | `for(let itemName in objectName { }` | +| `anfn→` | `(params) => { }` | +| `nfn→` | `const functionName = (params) => { }` | +| `dob→` | `const {propName} = objectToDescruct` | +| `dar→` | `const [propName] = arrayToDescruct` | +| `sti→` | `setInterval(() => { }, intervalTime` | +| `sto→` | `setTimeout(() => { }, delayTime` | +| `prom→` | `return new Promise((resolve, reject) => { }` | +| `cmmb→` | `comment block` | +| `cp→` | `const { } = this.props` | +| `cs→` | `const { } = this.state` | + +### React + +| Prefix | Method | +| ----------: | --------------------------------------------------------------------------- | +| `imr→` | `import React from 'react'` | +| `imrd→` | `import ReactDOM from 'react-dom'` | +| `imrc→` | `import React, { Component } from 'react'` | +| `imrpc→` | `import React, { PureComponent } from 'react'` | +| `imrm→` | `import React, { memo } from 'react'` | +| `imrr→` | `import { BrowserRouter as Router, Route, NavLink} from 'react-router-dom'` | +| `imbr→` | `import { BrowserRouter as Router} from 'react-router-dom'` | +| `imbrc→` | `import { Route, Switch, NavLink, Link } from react-router-dom'` | +| `imbrr→` | `import { Route } from 'react-router-dom'` | +| `imbrs→` | `import { Switch } from 'react-router-dom'` | +| `imbrl→` | `import { Link } from 'react-router-dom'` | +| `imbrnl→` | `import { NavLink } from 'react-router-dom'` | +| `imrs→` | `import React, { useState } from 'react'` | +| `imrse→` | `import React, { useState, useEffect } from 'react'` | +| `redux→` | `import { connect } from 'react-redux'` | +| `rconst→` | `constructor(props) with this.state` | +| `rconc→` | `constructor(props, context) with this.state` | +| `est→` | `this.state = { }` | +| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | +| `cdm→` | `componentDidMount = () => { }` | +| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | +| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | +| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | +| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | +| `cwun→` | `componentWillUnmount = () => { }` | +| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | +| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` | +| `sst→` | `this.setState({ })` | +| `ssf→` | `this.setState((state, props) => return { })` | +| `props→` | `this.props.propName` | +| `state→` | `this.state.stateName` | +| `rcontext→` | `const $1 = React.createContext()` | +| `cref→` | `this.$1Ref = React.createRef()` | +| `fref→` | `const ref = React.createRef()` | +| `bnd→` | `this.methodName = this.methodName.bind(this)` | + +### React Native + +| Prefix | Method | +| ---------: | -------------------------------------- | +| `imrn→` | `import { $1 } from 'react-native'` | +| `rnstyle→` | `const styles = StyleSheet.create({})` | + +### Redux + +| Prefix | Method | +| -----------: | ------------------------- | +| `rxaction→` | `redux action template` | +| `rxconst→` | `export const $1 = '$1'` | +| `rxreducer→` | `redux reducer template` | +| `rxselect→` | `redux selector template` | +| `rxslice→` | `redux slice template` | + +### PropTypes + +| Prefix | Method | +| --------: | ---------------------------------------- | +| `pta→` | `PropTypes.array` | +| `ptar→` | `PropTypes.array.isRequired` | +| `ptb→` | `PropTypes.bool` | +| `ptbr→` | `PropTypes.bool.isRequired` | +| `ptf→` | `PropTypes.func` | +| `ptfr→` | `PropTypes.func.isRequired` | +| `ptn→` | `PropTypes.number` | +| `ptnr→` | `PropTypes.number.isRequired` | +| `pto→` | `PropTypes.object` | +| `ptor→` | `PropTypes.object.isRequired` | +| `pts→` | `PropTypes.string` | +| `ptsr→` | `PropTypes.string.isRequired` | +| `ptnd→` | `PropTypes.node` | +| `ptndr→` | `PropTypes.node.isRequired` | +| `ptel→` | `PropTypes.element` | +| `ptelr→` | `PropTypes.element.isRequired` | +| `pti→` | `PropTypes.instanceOf(name)` | +| `ptir→` | `PropTypes.instanceOf(name).isRequired` | +| `pte→` | `PropTypes.oneOf([name])` | +| `pter→` | `PropTypes.oneOf([name]).isRequired` | +| `ptet→` | `PropTypes.oneOfType([name])` | +| `ptetr→` | `PropTypes.oneOfType([name]).isRequired` | +| `ptao→` | `PropTypes.arrayOf(name)` | +| `ptaor→` | `PropTypes.arrayOf(name).isRequired` | +| `ptoo→` | `PropTypes.objectOf(name)` | +| `ptoor→` | `PropTypes.objectOf(name).isRequired` | +| `ptsh→` | `PropTypes.shape({ })` | +| `ptshr→` | `PropTypes.shape({ }).isRequired` | +| `ptany→` | `PropTypes.any` | +| `ptypes→` | `static propTypes = {}` | + +### Console + +| Prefix | Method | +| ------ | ------------------------------------------------------------ | +| `clg→` | `console.log(object)` | +| `clo→` | `` console.log(`object`, object) `` | +| `clj→` | `` console.log(`object`, JSON.stringify(object, null, 2)) `` | +| `ctm→` | `` console.time(`timeId`) `` | +| `cte→` | `` console.timeEnd(`timeId`) `` | +| `cas→` | `console.assert(expression,object)` | +| `ccl→` | `console.clear()` | +| `cco→` | `console.count(label)` | +| `cdi→` | `console.dir` | +| `cer→` | `console.error(object)` | +| `cgr→` | `console.group(label)` | +| `cge→` | `console.groupEnd()` | +| `ctr→` | `console.trace(object)` | +| `cwa→` | `console.warn` | +| `cin→` | `console.info` | + +### React Components + +### `rcc` + +```javascript +import React, { Component } from 'react'; + +export default class FileName extends Component { + render() { + return
$2
; + } +} +``` + +### `rce` + +```javascript +import React, { Component } from 'react'; + +export class FileName extends Component { + render() { + return
$2
; + } +} + +export default $1; +``` + +### `rcep` + +```javascript +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; + +export class FileName extends Component { + static propTypes = {}; + + render() { + return
$2
; + } +} + +export default $1; +``` + +### `rpc` + +```javascript +import React, { PureComponent } from 'react'; + +export default class FileName extends PureComponent { + render() { + return
$2
; + } +} +``` + +### `rpcp` + +```javascript +import React, { PureComponent } from 'react'; +import PropTypes from 'prop-types'; + +export default class FileName extends PureComponent { + static propTypes = {}; + + render() { + return
$2
; + } +} +``` + +### `rpce` + +```javascript +import React, { PureComponent } from 'react'; +import PropTypes from 'prop-types'; + +export class FileName extends PureComponent { + static propTypes = {}; + + render() { + return
$2
; + } +} + +export default FileName; +``` + +### `rccp` + +```javascript +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; + +export default class FileName extends Component { + static propTypes = { + $2: $3, + }; + + render() { + return
$4
; + } +} +``` + +### `rfcp` + +```javascript +import React from 'react'; +import PropTypes from 'prop-types'; + +function $1(props) { + return
$0
; +} + +$1.propTypes = {}; + +export default $1; +``` + +### `rfc` + +```javascript +import React from 'react'; + +export default function $1() { + return
$0
; +} +``` + +### `rfce` + +```javascript +import React from 'react'; + +function $1() { + return
$0
; +} + +export default $1; +``` + +### `rafcp` + +```javascript +import React from 'react'; +import PropTypes from 'prop-types'; + +const $1 = (props) => { + return
$0
; +}; + +$1.propTypes = {}; + +export default $1; +``` + +### `rafc` + +```javascript +import React from 'react'; + +export const $1 = () => { + return
$0
; +}; +``` + +### `rafce` + +```javascript +import React from 'react'; + +const $1 = () => { + return
$0
; +}; + +export default $1; +``` + +### `rmc` + +```javascript +import React, { memo } from 'react'; + +export default memo(function $1() { + return
$0
; +}); +``` + +### `rmcp` + +```javascript +import React, { memo } from 'react'; +import PropTypes from 'prop-types'; + +const $1 = memo(function $1(props) { + return
$0
; +}); + +$1.propTypes = {}; + +export default $1; +``` + +### `rcredux` + +```javascript +import React, { Component } from 'react'; +import { connect } from 'react-redux'; + +export class FileName extends Component { + render() { + return
$4
; + } +} + +const mapStateToProps = (state) => ({}); + +const mapDispatchToProps = {}; + +export default connect(mapStateToProps, mapDispatchToProps)(FileName); +``` + +### `rcreduxp` + +```javascript +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { connect } from 'react-redux'; + +export class FileName extends Component { + static propTypes = { + $2: $3, + }; + + render() { + return
$4
; + } +} + +const mapStateToProps = (state) => ({}); + +const mapDispatchToProps = {}; + +export default connect(mapStateToProps, mapDispatchToProps)(FileName); +``` + +### `rfcredux` + +```javascript +import React, { Component } from 'react'; +import { connect } from 'react-redux'; + +export const FileName = () => { + return
$4
; +}; + +const mapStateToProps = (state) => ({}); + +const mapDispatchToProps = {}; + +export default connect(mapStateToProps, mapDispatchToProps)(FileName); +``` + +### `rfreduxp` + +```javascript +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { connect } from 'react-redux'; + +export const FileName = () => { + return
$4
; +}; + +FileName.propTypes = { + $2: $3, +}; + +const mapStateToProps = (state) => ({}); + +const mapDispatchToProps = {}; + +export default connect(mapStateToProps, mapDispatchToProps)(FileName); +``` + +### `reduxmap` + +```javascript +const mapStateToProps = (state) => ({}); + +const mapDispatchToProps = {}; +``` + +## React Native Components + +### `rnc` + +```javascript +import React, { Component } from 'react'; +import { Text, View } from 'react-native'; + +export default class FileName extends Component { + render() { + return ( + + $2 + + ); + } +} +``` + +### `rnf` + +```javascript +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function $1() { + return ( + + $2 + + ); +} +``` + +### `rnfs` + +```javascript +import React from 'react'; +import { StyleSheet, View, Text } from 'react-native'; + +export default function $1() { + return ( + + $2 + + ); +} + +const styles = StyleSheet.create({}); +``` + +### `rnfe` + +```javascript +import React from 'react'; +import { View, Text } from 'react-native'; + +const $1 = () => { + return ( + + $2 + + ); +}; + +export default $1; +``` + +### `rnfes` + +```javascript +import React from 'react'; +import { StyleSheet, View, Text } from 'react-native'; + +const $1 = () => { + return ( + + $2 + + ); +}; + +export default $1; + +const styles = StyleSheet.create({}); +``` + +### `rncs` + +```javascript +import React, { Component } from 'react'; +import { Text, StyleSheet, View } from 'react-native'; + +export default class FileName extends Component { + render() { + return ( + + $2 + + ); + } +} + +const styles = StyleSheet.create({}); +``` + +### `rnce` + +```javascript +import React, { Component } from 'react'; +import { Text, View } from 'react-native'; + +export class FileName extends Component { + render() { + return ( + + $2 + + ); + } +} + +export default $1; +``` + +## Others + +### `cmmb` + +```JS +/** +|-------------------------------------------------- +| $1 +|-------------------------------------------------- +*/ +``` + +### `desc` + +```javascript +describe('$1', () => { + $2; +}); +``` + +### `test` + +```javascript +test('should $1', () => { + $2; +}); +``` + +### `tit` + +```javascript +it('should $1', () => { + $2; +}); +``` + +### `stest` + +```javascript +import React from 'react'; +import renderer from 'react-test-renderer'; + +import { $1 } from '../$1'; + +describe('<$1 />', () => { + const defaultProps = {}; + const wrapper = renderer.create(<$1 {...defaultProps} />); + + test('render', () => { + expect(wrapper).toMatchSnapshot(); + }); +}); +``` + +### `srtest` + +```javascript +import React from 'react'; +import renderer from 'react-test-renderer'; +import { Provider } from 'react-redux'; + +import store from 'src/store'; +import { $1 } from '../$1'; + +describe('<$1 />', () => { + const defaultProps = {}; + const wrapper = renderer.create( + + <$1 {...defaultProps} />) + , + ); + + test('render', () => { + expect(wrapper).toMatchSnapshot(); + }); +}); +``` + +### `sntest` + +```javascript +import 'react-native'; +import React from 'react'; +import renderer from 'react-test-renderer'; + +import $1 from '../$1'; + +describe('<$1 />', () => { + const defaultProps = {}; + + const wrapper = renderer.create(<$1 {...defaultProps} />); + + test('render', () => { + expect(wrapper).toMatchSnapshot(); + }); +}); +``` + +### `snrtest` + +```javascript +import 'react-native'; +import React from 'react'; +import renderer from 'react-test-renderer'; +import { Provider } from 'react-redux'; + +import store from 'src/store/configureStore'; +import $1 from '../$1'; + +describe('<$1 />', () => { + const defaultProps = {}; + const wrapper = renderer.create( + + <$1 {...defaultProps} /> + , + ); + + test('render', () => { + expect(wrapper).toMatchSnapshot(); + }); +}); +``` + +### `hocredux` + +```javascript +import React from 'react'; +import PropTypes from 'prop-types'; +import { connect } from 'react-redux'; + +export const mapStateToProps = (state) => ({}); + +export const mapDispatchToProps = {}; + +export const $1 = (WrappedComponent) => { + const hocComponent = ({ ...props }) => ; + + hocComponent.propTypes = {}; + + return hocComponent; +}; + +export default (WrapperComponent) => + connect(mapStateToProps, mapDispatchToProps)($1(WrapperComponent)); +``` + +### `hoc` + +```javascript +import React from 'react'; +import PropTypes from 'prop-types'; + +export default (WrappedComponent) => { + const hocComponent = ({ ...props }) => ; + + hocComponent.propTypes = {}; + + return hocComponent; +}; +``` diff --git a/package.json b/package.json index fa7a188..59ce2a7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", - "description": "Extensions for React (React-Native) and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", + "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", "version": "4.0.0", "publisher": "dsznajder", "icon": "images/logo.png", diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index e48ea9d..0e032d0 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -20,7 +20,7 @@ import typescriptSnippets, { TypescriptSnippet, } from './sourceSnippets/typescript'; -type SnippetKeys = +export type SnippetKeys = | HooksSnippet['key'] | ImportsSnippet['key'] | ReactNativeSnippet['key'] @@ -31,17 +31,19 @@ type SnippetKeys = | PropTypesSnippet['key'] | TestsSnippet['key']; -type Snippets = { - [key in SnippetKeys]: - | HooksSnippet - | ImportsSnippet - | ReactNativeSnippet - | TypescriptSnippet - | ReduxSnippet - | ComponentsSnippet - | ConsoleSnippet - | PropTypesSnippet - | TestsSnippet; +export type Snippet = + | HooksSnippet + | ImportsSnippet + | ReactNativeSnippet + | TypescriptSnippet + | ReduxSnippet + | ComponentsSnippet + | ConsoleSnippet + | PropTypesSnippet + | TestsSnippet; + +export type Snippets = { + [key in SnippetKeys]: Snippet; }; let snippetsCache: string | null = null; diff --git a/src/helpers.ts b/src/helpers.ts index b9a8ff9..12c2cd2 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -60,11 +60,9 @@ export const getPrettierConfig = async (): Promise => { }; export const parseSnippet = async (snippet: { - id: number; description: any; label: string; - value: string; - body: string | string[]; + body: string[]; }) => { const workspaceConfig = workspace.getConfiguration( 'esReactSnippets', diff --git a/src/snippetSearch.ts b/src/snippetSearch.ts index 715996e..e64f7ee 100644 --- a/src/snippetSearch.ts +++ b/src/snippetSearch.ts @@ -1,23 +1,19 @@ import { SnippetString, window } from 'vscode'; +import { Snippet } from './generateSnippets'; import { parseSnippet } from './helpers'; import snippets from './snippets/generated.json'; const snippetSearch = async () => { const { showQuickPick, activeTextEditor } = window; - const snippetsArray = Object.entries(snippets) as [ - string, - { prefix: string; body: string[]; description?: string }, - ][]; + const snippetsArray = Object.entries(snippets) as [string, Snippet][]; const items = snippetsArray.map( - ([shortDescription, { prefix: label, body, description }], id) => ({ + ([shortDescription, { body, description, prefix: label }]) => ({ body, description: description || shortDescription, - id, label, - value: label, }), ); From d4108013646cd1d14af500286085d4a010ed7581 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 15 Jan 2022 09:59:59 +0100 Subject: [PATCH 085/110] refactor: adjust snippets generation and prettier config application --- docs/Snippets.md | 3 --- package.json | 46 ++++++++++++++++++++++++----------- src/generateSnippets.ts | 35 +++++++++----------------- src/helpers.ts | 33 ++++++++++--------------- src/index.ts | 40 ++++++++++++++++++++++++++---- src/snippetSearch.ts | 2 +- src/sourceSnippets/hooks.ts | 10 -------- src/sourceSnippets/imports.ts | 16 ++++++------ src/sourceSnippets/others.ts | 8 +++--- 9 files changed, 104 insertions(+), 89 deletions(-) diff --git a/docs/Snippets.md b/docs/Snippets.md index 53691e4..bb30685 100644 --- a/docs/Snippets.md +++ b/docs/Snippets.md @@ -67,11 +67,8 @@ I.E. `tsrcc` | `rconst→` | `constructor(props) with this.state` | | `rconc→` | `constructor(props, context) with this.state` | | `est→` | `this.state = { }` | -| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! | | `cdm→` | `componentDidMount = () => { }` | -| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! | | `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | -| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! | | `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | | `cwun→` | `componentWillUnmount = () => { }` | | `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` | diff --git a/package.json b/package.json index 59ce2a7..f690072 100644 --- a/package.json +++ b/package.json @@ -39,18 +39,18 @@ } }, "activationEvents": [ - "onCommand:esReactSnippets.search" + "onCommand:reactSnippets.search" ], "contributes": { "commands": [ { - "command": "esReactSnippets.search", + "command": "reactSnippets.search", "title": "Snippet search" } ], "keybindings": [ { - "command": "esReactSnippets.search", + "command": "reactSnippets.search", "key": "ctrl+alt+r", "mac": "shift+cmd+r", "when": "editorTextFocus" @@ -59,37 +59,37 @@ "configuration": { "title": "ES React/React-Native/Redux snippets", "properties": { - "esReactSnippets.settings.prettierEnabled": { + "reactSnippets.settings.prettierEnabled": { "type": "boolean", "markdownDescription": "Integrate prettier settings with code generated from snippets.", "default": false }, - "esReactSnippets.settings.importReactOnTop": { + "reactSnippets.settings.importReactOnTop": { "type": "boolean", "markdownDescription": "Controls if snippets should add `import React from 'react';` at the top of components.\nUse if you have React +17 and use jsx transform.", "default": true }, - "esReactSnippets.settings.typescript": { + "reactSnippets.settings.typescript": { "type": "boolean", "markdownDescription": "Controls if React components have typescript Props typing.", "default": false }, - "esReactSnippets.settings.semiColons": { + "reactSnippets.settings.semiColons": { "type": "boolean", - "markdownDescription": "Controls if snippets should use semi colons.\nOnly applies when `#esReactSnippets.settings.prettierEnabled#` is disabled", + "markdownDescription": "Controls if snippets should use semi colons.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", "default": true }, - "esReactSnippets.settings.singleQuote": { + "reactSnippets.settings.singleQuote": { "type": "boolean", - "markdownDescription": "Controls if snippets should use single quotes.\nOnly applies when `#esReactSnippets.settings.prettierEnabled#` is disabled", + "markdownDescription": "Controls if snippets should use single quotes.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", "default": true }, - "esReactSnippets.settings.tabWidth": { + "reactSnippets.settings.tabWidth": { "type": "number", - "markdownDescription": "Controls how many spaces snippets will have.\nOnly applies when `#esReactSnippets.settings.prettierEnabled#` is disabled", + "markdownDescription": "Controls how many spaces snippets will have.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", "default": 2 }, - "esReactSnippets.settings.typescriptComponentPropsStatePrefix": { + "reactSnippets.settings.typescriptComponentPropsStatePrefix": { "type": "string", "markdownDescription": "Controls which prefix for typescript snippets should use for props/state.", "default": "type", @@ -99,7 +99,25 @@ ] } } - } + }, + "snippets": [ + { + "language": "javascript", + "path": "./src/snippets/generated.json" + }, + { + "language": "javascriptreact", + "path": "./src/snippets/generated.json" + }, + { + "language": "typescript", + "path": "./src/snippets/generated.json" + }, + { + "language": "typescriptreact", + "path": "./src/snippets/generated.json" + } + ] }, "scripts": { "vscode:prepublish": "yarn compile", diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index 0e032d0..cf12bb9 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -1,4 +1,4 @@ -import { writeFileSync } from 'fs'; +import { writeFile } from 'fs'; import { workspace } from 'vscode'; import { ExtensionSettings, replaceSnippetPlaceholders } from './helpers'; @@ -46,18 +46,12 @@ export type Snippets = { [key in SnippetKeys]: Snippet; }; -let snippetsCache: string | null = null; - const getSnippets = () => { - if (snippetsCache) { - return snippetsCache; - } - const config = workspace.getConfiguration( - 'esReactSnippets', + 'reactSnippets', ) as unknown as ExtensionSettings; - const snippets: Snippets = [ + const snippets = [ ...componentsSnippets, ...consoleSnippets, ...hooksSnippets, @@ -72,23 +66,16 @@ const getSnippets = () => { return acc; }, {} as Snippets); - const jsonSnippets = replaceSnippetPlaceholders( - JSON.stringify(snippets, null, 2), - config, - ); - - snippetsCache = jsonSnippets; - return jsonSnippets; + return replaceSnippetPlaceholders(JSON.stringify(snippets, null, 2), config); }; -const generateSnippets = () => +export const generateSnippets = () => new Promise((resolve) => { - console.time('generate'); const jsonSnippets = getSnippets(); - console.timeEnd('generate'); - - writeFileSync(__dirname + '/snippets/generated.json', jsonSnippets); - return resolve(true); + writeFile(__dirname + '/snippets/generated.json', jsonSnippets, (error) => { + if (error) { + console.error(error); + } + return resolve(true); + }); }); - -export default generateSnippets; diff --git a/src/helpers.ts b/src/helpers.ts index 12c2cd2..336bc4b 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -42,44 +42,37 @@ export const revertSnippetPlaceholders = (snippetString: string) => .replace(new RegExp(/\${3:third}/, 'g'), SnippetPlaceholders.ThirdTab) .replace(new RegExp(/\$0/, 'g'), SnippetPlaceholders.LastTab); -export const getPrettierConfig = async (): Promise => { +let prettierConfig: prettier.Options | null; + +prettier + .resolveConfig('', { editorconfig: true }) + .then((config) => (prettierConfig = config)); + +export const getPrettierConfig = (): Options => { const settings = workspace.getConfiguration( - 'esReactSnippets.settings', + 'reactSnippets.settings', ) as unknown as ExtensionSettings; - const prettierConfig = await prettier.resolveConfig('', { - editorconfig: true, - }); - return { semi: settings.semiColons, singleQuote: settings.quotes, tabWidth: settings.tabWidth, + parser: 'typescript', ...(settings.prettierEnabled && prettierConfig), }; }; -export const parseSnippet = async (snippet: { - description: any; - label: string; - body: string[]; -}) => { +export const parseSnippet = (body: string[]) => { const workspaceConfig = workspace.getConfiguration( - 'esReactSnippets', + 'reactSnippets', ) as unknown as ExtensionSettings; - const snippetBody = - typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); + const snippetBody = typeof body === 'string' ? body : body.join('\n'); - const prettierConfig = await getPrettierConfig(); + const prettierConfig = getPrettierConfig(); const parsedBody = prettier.format( revertSnippetPlaceholders(snippetBody), prettierConfig, ); - console.log( - parsedBody, - replaceSnippetPlaceholders(parsedBody, workspaceConfig), - ); - return replaceSnippetPlaceholders(parsedBody, workspaceConfig); }; diff --git a/src/index.ts b/src/index.ts index ae23275..b447380 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,17 +1,47 @@ -import { commands, ExtensionContext } from 'vscode'; +import { + commands, + ConfigurationChangeEvent, + ExtensionContext, + window, + workspace, +} from 'vscode'; -import generateSnippets from './generateSnippets'; +import { generateSnippets } from './generateSnippets'; import snippetSearch from './snippetSearch'; -export async function activate(context: ExtensionContext) { - await generateSnippets(); +const showRestartMessage = async ({ + affectsConfiguration, +}: ConfigurationChangeEvent) => { + let timeoutId: NodeJS.Timeout | undefined; + if (affectsConfiguration('reactSnippets')) { + await generateSnippets(); + timeoutId && clearTimeout(timeoutId); + timeoutId = setTimeout(() => { + window + .showWarningMessage( + 'React Snippets: Please restart VS Code to apply snippet formatting changes', + 'Restart VS Code', + 'Ignore', + ) + .then((action?: string) => { + if (action === 'Restart VS Code') { + commands.executeCommand('workbench.action.reloadWindow'); + } + }); + }, 3000); + } +}; +export async function activate(context: ExtensionContext) { + workspace.onDidChangeConfiguration(showRestartMessage); const snippetSearchCommand = commands.registerCommand( - 'esReactSnippets.search', + 'reactSnippets.search', snippetSearch, ); context.subscriptions.push(snippetSearchCommand); + + await generateSnippets(); } export function deactivate() {} diff --git a/src/snippetSearch.ts b/src/snippetSearch.ts index e64f7ee..aad6db0 100644 --- a/src/snippetSearch.ts +++ b/src/snippetSearch.ts @@ -23,7 +23,7 @@ const snippetSearch = async () => { placeHolder: 'Search snippet by prefix or description', }); - const body = rawSnippet ? await parseSnippet(rawSnippet) : ''; + const body = rawSnippet ? parseSnippet(rawSnippet.body) : ''; if (activeTextEditor) { activeTextEditor.insertSnippet(new SnippetString(body)); diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts index 77c1546..c4c6252 100644 --- a/src/sourceSnippets/hooks.ts +++ b/src/sourceSnippets/hooks.ts @@ -9,19 +9,10 @@ type HookMappings = { useMemo: 'useMemoSnippet'; useReducer: 'useReducerSnippet'; useRef: 'useRefSnippet'; - useState: 'useStateSnippet'; }; export type HooksSnippet = SnippetMapping; -const useState: HooksSnippet = { - key: 'useState', - prefix: 'useStateSnippet', - body: [ - `const [${SnippetPlaceholders.FirstTab}, set${SnippetPlaceholders.FirstTab}/(.*)/${SnippetPlaceholders.FirstTab}:/capitalize}/}] = useState(${SnippetPlaceholders.SecondTab})`, - ], -}; - const useEffect: HooksSnippet = { key: 'useEffect', prefix: 'useEffectSnippet', @@ -111,7 +102,6 @@ const useLayoutEffect: HooksSnippet = { }; export default [ - useState, useEffect, useContext, useReducer, diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts index 8022cbc..d9eca8f 100644 --- a/src/sourceSnippets/imports.ts +++ b/src/sourceSnippets/imports.ts @@ -155,8 +155,8 @@ const importNoModuleName: ImportsSnippet = { key: 'importNoModuleName', prefix: 'imn', body: [ - `import '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - '', + `import '${SnippetPlaceholders.FirstTab}'`, + SnippetPlaceholders.LastTab, ], }; @@ -164,8 +164,8 @@ const importDestructing: ImportsSnippet = { key: 'importDestructing', prefix: 'imd', body: [ - `import { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - '', + `import { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'`, + SnippetPlaceholders.LastTab, ], }; @@ -173,8 +173,8 @@ const importEverything: ImportsSnippet = { key: 'importEverything', prefix: 'ime', body: [ - `import * as ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - '', + `import * as ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'`, + SnippetPlaceholders.LastTab, ], }; @@ -182,8 +182,8 @@ const importAs: ImportsSnippet = { key: 'importAs', prefix: 'ima', body: [ - `import { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - '', + `import { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'`, + SnippetPlaceholders.LastTab, ], }; diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts index 70a95a4..bdd76c4 100644 --- a/src/sourceSnippets/others.ts +++ b/src/sourceSnippets/others.ts @@ -55,8 +55,8 @@ const exportDestructing: OthersSnippet = { key: 'exportDestructing', prefix: 'exd', body: [ - `export { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - '', + `export { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'`, + SnippetPlaceholders.LastTab, ], }; @@ -64,8 +64,8 @@ const exportAs: OthersSnippet = { key: 'exportAs', prefix: 'exa', body: [ - `export { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - '', + `export { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'`, + SnippetPlaceholders.LastTab, ], }; From dcf35307bb41f561b032e8853c660b47bac60f06 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Sat, 15 Jan 2022 11:07:19 +0100 Subject: [PATCH 086/110] fix: typescript dynamic generate --- .vscodeignore | 10 +- LICENCE => LICENSE | 2 +- package.json | 12 +- src/generateSnippets.ts | 22 +- src/helpers.ts | 71 +- src/index.ts | 27 +- src/snippets/generated.json | 1203 +++++++++++++++++++++++++- src/sourceSnippets/imports.ts | 4 +- src/sourceSnippets/propTypes.ts | 62 +- src/sourceSnippets/sharedSnippets.ts | 19 +- src/sourceSnippets/typescript.ts | 2 +- src/types.ts | 1 - yarn.lock | 215 +---- 13 files changed, 1336 insertions(+), 314 deletions(-) rename LICENCE => LICENSE (96%) diff --git a/.vscodeignore b/.vscodeignore index e77db6a..ce152c9 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,6 +1,8 @@ -.vscode/** -src/** -.gitignore **/tsconfig.json *.ts -webpack.config.js +.github/** +.gitignore +.vscode/** +docs/** +node_modules/** +src/** diff --git a/LICENCE b/LICENSE similarity index 96% rename from LICENCE rename to LICENSE index 2803d0a..35f3a73 100644 --- a/LICENCE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Damian Sznajder +Copyright (c) 2022 Damian Sznajder Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index f690072..344d05c 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,8 @@ } }, "activationEvents": [ + "onLanguage:typescript", + "onLanguage:javascript", "onCommand:reactSnippets.search" ], "contributes": { @@ -89,6 +91,11 @@ "markdownDescription": "Controls how many spaces snippets will have.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", "default": 2 }, + "reactSnippets.settings.languageScopes": { + "type": "string", + "markdownDescription": "defines the language scopes for which the snippets will be available.\nUse comma separated values.\nFor example: `typescript,typescriptreact,javascript,javascriptreact`", + "default": "typescript,typescriptreact,javascript,javascriptreact" + }, "reactSnippets.settings.typescriptComponentPropsStatePrefix": { "type": "string", "markdownDescription": "Controls which prefix for typescript snippets should use for props/state.", @@ -127,8 +134,7 @@ "typescript": "tsc --noEmit" }, "dependencies": { - "prettier": "2.5.1", - "vscode": "1.1.37" + "prettier": "2.5.1" }, "devDependencies": { "@babel/cli": "7.16.0", @@ -136,7 +142,7 @@ "@babel/preset-typescript": "7.16.5", "@types/node": "17.0.5", "@types/prettier": "2.4.2", - "@types/vscode": "1.63.1", + "@types/vscode": "1.60.0", "@typescript-eslint/eslint-plugin": "5.8.1", "@typescript-eslint/parser": "5.8.1", "eslint": "8.5.0", diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index cf12bb9..29ae88e 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -1,7 +1,10 @@ import { writeFile } from 'fs'; -import { workspace } from 'vscode'; -import { ExtensionSettings, replaceSnippetPlaceholders } from './helpers'; +import { + extensionConfig, + formatSnippet, + replaceSnippetPlaceholders, +} from './helpers'; import componentsSnippets, { ComponentsSnippet, } from './sourceSnippets/components'; @@ -47,11 +50,10 @@ export type Snippets = { }; const getSnippets = () => { - const config = workspace.getConfiguration( - 'reactSnippets', - ) as unknown as ExtensionSettings; + const { typescript, languageScopes } = extensionConfig(); const snippets = [ + ...(typescript ? typescriptSnippets : []), ...componentsSnippets, ...consoleSnippets, ...hooksSnippets, @@ -60,13 +62,17 @@ const getSnippets = () => { ...reactNativeSnippets, ...reduxSnippets, ...testsSnippets, - ...(config.typescript ? typescriptSnippets : []), ].reduce((acc, snippet) => { - acc[snippet.key] = snippet; + const snippetBody = + typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); + acc[snippet.key] = Object.assign(snippet, { + scope: languageScopes, + body: formatSnippet(snippetBody).split('\n'), + }); return acc; }, {} as Snippets); - return replaceSnippetPlaceholders(JSON.stringify(snippets, null, 2), config); + return replaceSnippetPlaceholders(JSON.stringify(snippets, null, 2)); }; export const generateSnippets = () => diff --git a/src/helpers.ts b/src/helpers.ts index 336bc4b..509fd0b 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -4,19 +4,40 @@ import { workspace } from 'vscode'; import { SnippetPlaceholders } from './types'; export type ExtensionSettings = { + languageScopes: string; prettierEnabled: boolean; semiColons: boolean; importReactOnTop: boolean; - quotes: boolean; + singleQuote: boolean; typescript: boolean; tabWidth: number; typescriptComponentPropsStatePrefix: 'type' | 'interface'; }; -export const replaceSnippetPlaceholders = ( - snippetString: string, - extensionConfig: ExtensionSettings, -) => +let prettierConfig: prettier.Options | null; +prettier + .resolveConfig('', { editorconfig: true }) + .then((config) => (prettierConfig = config)); + +export const extensionConfig = () => + workspace.getConfiguration( + 'reactSnippets.settings', + ) as unknown as ExtensionSettings; + +const getPrettierConfig = (): Options => { + const { semiColons, singleQuote, tabWidth, prettierEnabled } = + extensionConfig(); + + return { + parser: 'typescript', + semi: semiColons, + singleQuote, + tabWidth, + ...(prettierEnabled && prettierConfig), + }; +}; + +export const replaceSnippetPlaceholders = (snippetString: string) => String(snippetString) .replace( new RegExp(SnippetPlaceholders.FileName, 'g'), @@ -25,11 +46,7 @@ export const replaceSnippetPlaceholders = ( .replace(new RegExp(SnippetPlaceholders.FirstTab, 'g'), '${1:first}') .replace(new RegExp(SnippetPlaceholders.SecondTab, 'g'), '${2:second}') .replace(new RegExp(SnippetPlaceholders.ThirdTab, 'g'), '${3:third}') - .replace(new RegExp(SnippetPlaceholders.LastTab, 'g'), '$0') - .replace( - new RegExp(SnippetPlaceholders.TypeInterface, 'g'), - extensionConfig.typescriptComponentPropsStatePrefix || 'type', - ); + .replace(new RegExp(SnippetPlaceholders.LastTab, 'g'), '$0'); export const revertSnippetPlaceholders = (snippetString: string) => String(snippetString) @@ -42,37 +59,15 @@ export const revertSnippetPlaceholders = (snippetString: string) => .replace(new RegExp(/\${3:third}/, 'g'), SnippetPlaceholders.ThirdTab) .replace(new RegExp(/\$0/, 'g'), SnippetPlaceholders.LastTab); -let prettierConfig: prettier.Options | null; - -prettier - .resolveConfig('', { editorconfig: true }) - .then((config) => (prettierConfig = config)); - -export const getPrettierConfig = (): Options => { - const settings = workspace.getConfiguration( - 'reactSnippets.settings', - ) as unknown as ExtensionSettings; - - return { - semi: settings.semiColons, - singleQuote: settings.quotes, - tabWidth: settings.tabWidth, - parser: 'typescript', - ...(settings.prettierEnabled && prettierConfig), - }; +export const formatSnippet = (string: string) => { + const prettierConfig = getPrettierConfig(); + return prettier.format(string, prettierConfig); }; -export const parseSnippet = (body: string[]) => { - const workspaceConfig = workspace.getConfiguration( - 'reactSnippets', - ) as unknown as ExtensionSettings; +export const parseSnippet = (body: string | string[]) => { const snippetBody = typeof body === 'string' ? body : body.join('\n'); - const prettierConfig = getPrettierConfig(); - const parsedBody = prettier.format( - revertSnippetPlaceholders(snippetBody), - prettierConfig, + return replaceSnippetPlaceholders( + formatSnippet(revertSnippetPlaceholders(snippetBody)), ); - - return replaceSnippetPlaceholders(parsedBody, workspaceConfig); }; diff --git a/src/index.ts b/src/index.ts index b447380..a0d26cd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,6 @@ import { commands, ConfigurationChangeEvent, ExtensionContext, - window, workspace, } from 'vscode'; @@ -12,23 +11,19 @@ import snippetSearch from './snippetSearch'; const showRestartMessage = async ({ affectsConfiguration, }: ConfigurationChangeEvent) => { - let timeoutId: NodeJS.Timeout | undefined; if (affectsConfiguration('reactSnippets')) { await generateSnippets(); - timeoutId && clearTimeout(timeoutId); - timeoutId = setTimeout(() => { - window - .showWarningMessage( - 'React Snippets: Please restart VS Code to apply snippet formatting changes', - 'Restart VS Code', - 'Ignore', - ) - .then((action?: string) => { - if (action === 'Restart VS Code') { - commands.executeCommand('workbench.action.reloadWindow'); - } - }); - }, 3000); + // window + // .showWarningMessage( + // 'React Snippets: Please restart VS Code to apply snippet formatting changes', + // 'Restart VS Code', + // 'Ignore', + // ) + // .then((action?: string) => { + // if (action === 'Restart VS Code') { + // commands.executeCommand('workbench.action.reloadWindow'); + // } + // }); } }; diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 0967ef4..0f88798 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -1 +1,1202 @@ -{} +{ + "reactArrowFunctionComponent": { + "key": "reactArrowFunctionComponent", + "prefix": "rafc", + "body": [ + "import React from 'react';", + "", + "export const ${1:${TM_FILENAME_BASE}} = () => {", + " return
$0
;", + "};", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system" + }, + "reactArrowFunctionComponentWithPropTypes": { + "key": "reactArrowFunctionComponentWithPropTypes", + "prefix": "rafcp", + "body": [ + "import React from 'react';", + "import PropTypes from 'prop-types';", + "", + "const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return
$0
;", + "};", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes" + }, + "reactArrowFunctionExportComponent": { + "key": "reactArrowFunctionExportComponent", + "prefix": "rafce", + "body": [ + "import React from 'react';", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return
$0
;", + "};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system" + }, + "reactClassComponent": { + "key": "reactClassComponent", + "prefix": "rcc", + "body": [ + "import React, { Component } from 'react';", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return
$0
;", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system" + }, + "reactClassComponentPropTypes": { + "key": "reactClassComponentPropTypes", + "prefix": "rccp", + "body": [ + "import PropTypes from 'prop-types';", + "import React, { Component } from 'react';", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {", + " ${2:second}: ${3:third},", + " };", + "", + " render() {", + " return
$0
;", + " }", + "}", + "" + ], + "description": "Creates a React component class with PropTypes and ES7 module system" + }, + "reactClassComponentRedux": { + "key": "reactClassComponentRedux", + "prefix": "rcredux", + "body": [ + "import React, { Component } from 'react';", + "import { connect } from 'react-redux';", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return
$0
;", + " }", + "}", + "", + "const mapStateToProps = (state) => ({});", + "", + "const mapDispatchToProps = {};", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", + "" + ], + "description": "Creates a React component class with connected redux and ES7 module system" + }, + "reactClassComponentReduxPropTypes": { + "key": "reactClassComponentReduxPropTypes", + "prefix": "rcreduxp", + "body": [ + "import PropTypes from 'prop-types';", + "import React, { Component } from 'react';", + "import { connect } from 'react-redux';", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {", + " ${2:second}: ${3:third},", + " };", + "", + " render() {", + " return
$0
;", + " }", + "}", + "", + "const mapStateToProps = (state) => ({});", + "", + "const mapDispatchToProps = {};", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", + "" + ], + "description": "Creates a React component class with PropTypes with connected redux and ES7 module system" + }, + "reactClassExportComponent": { + "key": "reactClassExportComponent", + "prefix": "rce", + "body": [ + "import React, { Component } from 'react';", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return
$0
;", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React component class with ES7 module system" + }, + "reactClassExportComponentWithPropTypes": { + "key": "reactClassExportComponentWithPropTypes", + "prefix": "rcep", + "body": [ + "import PropTypes from 'prop-types';", + "import React, { Component } from 'react';", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {};", + "", + " render() {", + " return
$0
;", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React component class with ES7 module system" + }, + "reactClassExportPureComponent": { + "key": "reactClassExportPureComponent", + "prefix": "rpce", + "body": [ + "import React, { PureComponent } from 'react';", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return
$0
;", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React pure component class with ES7 module system export" + }, + "reactClassPureComponent": { + "key": "reactClassPureComponent", + "prefix": "rpc", + "body": [ + "import React, { PureComponent } from 'react';", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return
$0
;", + " }", + "}", + "" + ], + "description": "Creates a React pure component class with ES7 module system" + }, + "reactClassPureComponentWithPropTypes": { + "key": "reactClassPureComponentWithPropTypes", + "prefix": "rpcp", + "body": [ + "import PropTypes from 'prop-types';", + "import React, { PureComponent } from 'react';", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " static propTypes = {};", + "", + " render() {", + " return
$0
;", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system" + }, + "reactFunctionMemoComponent": { + "key": "reactFunctionMemoComponent", + "prefix": "rmc", + "body": [ + "import React, { memo } from 'react';", + "", + "export default memo(function ${1:${TM_FILENAME_BASE}}() {", + " return
$0
;", + "});", + "" + ], + "description": "Creates a React Memo Function Component with ES7 module system" + }, + "reactFunctionMemoComponentWithPropTypes": { + "key": "reactFunctionMemoComponentWithPropTypes", + "prefix": "rmcp", + "body": [ + "import PropTypes from 'prop-types';", + "import React, { memo } from 'react';", + "", + "const ${1:${TM_FILENAME_BASE}} = memo(function ${1:${TM_FILENAME_BASE}}(props) {", + " return
$0
;", + "});", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Memo Function Component with ES7 module system with PropTypes" + }, + "reactFunctionalComponent": { + "key": "reactFunctionalComponent", + "prefix": "rfc", + "body": [ + "import React from 'react';", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return
$0
;", + "}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system" + }, + "reactFunctionalComponentRedux": { + "key": "reactFunctionalComponentRedux", + "prefix": "rfcredux", + "body": [ + "import React from 'react';", + "import { connect } from 'react-redux';", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return
$0
;", + "};", + "", + "const mapStateToProps = (state) => ({});", + "", + "const mapDispatchToProps = {};", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", + "" + ], + "description": "Creates a React functional component with connected redux and ES7 module system" + }, + "reactFunctionalComponentReduxPropTypes": { + "key": "reactFunctionalComponentReduxPropTypes", + "prefix": "rfcreduxp", + "body": [ + "import PropTypes from 'prop-types';", + "import React from 'react';", + "import { connect } from 'react-redux';", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return
$0
;", + "};", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {", + " ${2:second}: PropTypes.${3:third},", + "};", + "", + "const mapStateToProps = (state) => ({});", + "", + "const mapDispatchToProps = {};", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", + "" + ], + "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system" + }, + "reactFunctionalComponentWithPropTypes": { + "key": "reactFunctionalComponentWithPropTypes", + "prefix": "rfcp", + "body": [ + "import React from 'react';", + "import PropTypes from 'prop-types';", + "", + "function ${1:${TM_FILENAME_BASE}}(props) {", + " return
$0
;", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Functional Component with ES7 module system with PropTypes" + }, + "reactFunctionalExportComponent": { + "key": "reactFunctionalExportComponent", + "prefix": "rfce", + "body": [ + "import React from 'react';", + "", + "function ${1:${TM_FILENAME_BASE}}() {", + " return
$0
;", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Functional Component with ES7 module system" + }, + "consoleAssert": { + "key": "consoleAssert", + "prefix": "cas", + "body": ["console.assert(${1:first}, ${2:second});", ""], + "description": "If the specified expression is false, the message is written to the console along with a stack trace" + }, + "consoleClear": { + "key": "consoleClear", + "prefix": "ccl", + "body": ["console.clear();", ""], + "description": "Clears the console" + }, + "consoleCount": { + "key": "consoleCount", + "prefix": "cco", + "body": ["console.count(${1:first});", ""], + "description": "Writes the the number of times that count() has been invoked at the same line and with the same label" + }, + "consoleDir": { + "key": "consoleDir", + "prefix": "cdi", + "body": ["console.dir(${1:first});", ""], + "description": "Prints a JavaScript representation of the specified object" + }, + "consoleError": { + "key": "consoleError", + "prefix": "cer", + "body": ["console.error(${1:first});", ""], + "description": "Displays a message in the console and also includes a stack trace from where the method was called" + }, + "consoleGroup": { + "key": "consoleGroup", + "prefix": "cgr", + "body": ["console.group('${1:first}');", ""], + "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called." + }, + "consoleGroupEnd": { + "key": "consoleGroupEnd", + "prefix": "cge", + "body": ["console.groupEnd();", ""], + "description": "Closes out the corresponding console.group()." + }, + "consoleLog": { + "key": "consoleLog", + "prefix": "clg", + "body": ["console.log(${1:first});", ""], + "description": "Displays a message in the console" + }, + "consoleTrace": { + "key": "consoleTrace", + "prefix": "ctr", + "body": ["console.trace(${1:first});", ""], + "description": "Prints a stack trace from the point where the method was called" + }, + "consoleLogObject": { + "key": "consoleLogObject", + "prefix": "clo", + "body": ["console.log('${1:first}', ${1:first});", ""], + "description": "Logs property with name." + }, + "consoleLogJson": { + "key": "consoleLogJson", + "prefix": "clj", + "body": [ + "console.log('${1:first}', JSON.stringify(${1:first}, null, 2));", + "" + ], + "description": "Logs stringified JSON property with name." + }, + "consoleTime": { + "key": "consoleTime", + "prefix": "ctm", + "body": ["console.time('${1:first}');", ""], + "description": "Console time wrapper" + }, + "consoleTimeEnd": { + "key": "consoleTimeEnd", + "prefix": "cte", + "body": ["console.timeEnd('${1:first}');", ""], + "description": "Console time end wrapper" + }, + "consoleWarn": { + "key": "consoleWarn", + "prefix": "cwa", + "body": ["console.warn(${1:first});", ""], + "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message" + }, + "consoleInfo": { + "key": "consoleInfo", + "prefix": "cin", + "body": ["console.info(${1:first});", ""], + "description": "Displays a message in the console but also displays a blue information icon along with the logged message" + }, + "useEffect": { + "key": "useEffect", + "prefix": "useEffectSnippet", + "body": [ + "useEffect(() => {", + " ${1:first};", + "", + " return () => {", + " ${2:second};", + " };", + "}, [${3:third}]);", + "" + ] + }, + "useContext": { + "key": "useContext", + "prefix": "useContextSnippet", + "body": ["const ${1:first} = useContext(${2:second});", ""] + }, + "useReducer": { + "key": "useReducer", + "prefix": "useReducerSnippet", + "body": [ + "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third});", + "" + ] + }, + "useCallback": { + "key": "useCallback", + "prefix": "useCallbackSnippet", + "body": ["useCallback(() => {", " ${1:first};", "}, [${2:second}]);", ""] + }, + "useMemo": { + "key": "useMemo", + "prefix": "useMemoSnippet", + "body": ["useMemo(() => ${1:first}, ${2:second});", ""] + }, + "useRef": { + "key": "useRef", + "prefix": "useRefSnippet", + "body": ["const ${1:first} = useRef(${2:second});", ""] + }, + "useImperativeHandle": { + "key": "useImperativeHandle", + "prefix": "useImperativeHandleSnippet", + "body": [ + "useImperativeHandle(", + " ${1:first},", + " () => {", + " ${2:second};", + " },", + " [${3:third}]", + ");", + "" + ] + }, + "useLayoutEffect": { + "key": "useLayoutEffect", + "prefix": "useLayoutEffectSnippet", + "body": [ + "useLayoutEffect(() => {", + " ${1:first};", + " return () => {", + " ${2:second};", + " };", + "}, [${3:third}]);", + "" + ] + }, + "importAs": { + "key": "importAs", + "prefix": "ima", + "body": [ + "import { ${2:second} as ${3:third} } from '${1:first}';", + "$0;", + "" + ] + }, + "importBrowserRouter": { + "key": "importBrowserRouter", + "prefix": "imbr", + "body": ["import { BrowserRouter as Router } from 'react-router-dom';", ""] + }, + "importBrowserRouterWithRouteAndNavLink": { + "key": "importBrowserRouterWithRouteAndNavLink", + "prefix": "imrr", + "body": [ + "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom';", + "" + ] + }, + "importDestructing": { + "key": "importDestructing", + "prefix": "imd", + "body": ["import { ${2:second} } from '${1:first}';", "$0;", ""] + }, + "importEverything": { + "key": "importEverything", + "prefix": "ime", + "body": ["import * as ${2:second} from '${1:first}';", "$0;", ""] + }, + "importNoModuleName": { + "key": "importNoModuleName", + "prefix": "imn", + "body": ["import '${1:first}';", "$0;", ""] + }, + "importPropTypes": { + "key": "importPropTypes", + "prefix": "impt", + "body": ["import PropTypes from 'prop-types';", ""] + }, + "importReact": { + "key": "importReact", + "prefix": "imr", + "body": ["import React from 'react';", ""] + }, + "importReactDom": { + "key": "importReactDom", + "prefix": "imrd", + "body": ["import ReactDOM from 'react-dom';", ""] + }, + "importReactWithComponent": { + "key": "importReactWithComponent", + "prefix": "imrc", + "body": ["import React, { Component } from 'react';", ""] + }, + "importReactWithComponentAndPropTypes": { + "key": "importReactWithComponentAndPropTypes", + "prefix": "imrcp", + "body": [ + "import React, { Component } from 'react';", + "import PropTypes from 'prop-types';", + "" + ] + }, + "importReactWithMemo": { + "key": "importReactWithMemo", + "prefix": "imrm", + "body": ["import React, { memo } from 'react';", ""] + }, + "importReactWithMemoAndPropTypes": { + "key": "importReactWithMemoAndPropTypes", + "prefix": "imrmp", + "body": [ + "import React, { memo } from 'react';", + "import PropTypes from 'prop-types';", + "" + ] + }, + "importReactWithPureComponent": { + "key": "importReactWithPureComponent", + "prefix": "imrpc", + "body": ["import React, { PureComponent } from 'react';", ""] + }, + "importReactWithPureComponentAndPropTypes": { + "key": "importReactWithPureComponentAndPropTypes", + "prefix": "imrpcp", + "body": [ + "import React, { PureComponent } from 'react';", + "import PropTypes from 'prop-types';", + "" + ] + }, + "importRouterLink": { + "key": "importRouterLink", + "prefix": "imbrl", + "body": ["import { Link } from 'react-router-dom';", ""] + }, + "importRouterNavLink": { + "key": "importRouterNavLink", + "prefix": "imbrnl", + "body": ["import { NavLink } from 'react-router-dom';", ""] + }, + "importRouterSetup": { + "key": "importRouterSetup", + "prefix": "imbrc", + "body": [ + "import { Route, Switch, NavLink, Link } from 'react-router-dom';", + "" + ] + }, + "importRouterSwitch": { + "key": "importRouterSwitch", + "prefix": "imbrs", + "body": ["import { Switch } from 'react-router-dom';", ""] + }, + "import": { + "key": "import", + "prefix": "imp", + "body": ["import ${2:second} from '${1:first}';", "$0;", ""] + }, + "propTypeArray": { + "key": "propTypeArray", + "prefix": "pta", + "body": ["PropTypes.array;", ""], + "description": "Array prop type" + }, + "propTypeArrayRequired": { + "key": "propTypeArrayRequired", + "prefix": "ptar", + "body": ["PropTypes.array.isRequired;", ""], + "description": "Array prop type required" + }, + "propTypeBool": { + "key": "propTypeBool", + "prefix": "ptb", + "body": ["PropTypes.bool;", ""], + "description": "Bool prop type" + }, + "propTypeBoolRequired": { + "key": "propTypeBoolRequired", + "prefix": "ptbr", + "body": ["PropTypes.bool.isRequired;", ""], + "description": "Bool prop type required" + }, + "propTypeFunc": { + "key": "propTypeFunc", + "prefix": "ptf", + "body": ["PropTypes.func;", ""], + "description": "Func prop type" + }, + "propTypeFuncRequired": { + "key": "propTypeFuncRequired", + "prefix": "ptfr", + "body": ["PropTypes.func.isRequired;", ""], + "description": "Func prop type required" + }, + "propTypeNumber": { + "key": "propTypeNumber", + "prefix": "ptn", + "body": ["PropTypes.number;", ""], + "description": "Number prop type" + }, + "propTypeNumberRequired": { + "key": "propTypeNumberRequired", + "prefix": "ptnr", + "body": ["PropTypes.number.isRequired;", ""], + "description": "Number prop type required" + }, + "propTypeObject": { + "key": "propTypeObject", + "prefix": "pto", + "body": ["PropTypes.object;", ""], + "description": "Object prop type" + }, + "propTypeObjectRequired": { + "key": "propTypeObjectRequired", + "prefix": "ptor", + "body": ["PropTypes.object.isRequired;", ""], + "description": "Object prop type required" + }, + "propTypeString": { + "key": "propTypeString", + "prefix": "pts", + "body": ["PropTypes.string;", ""], + "description": "String prop type" + }, + "propTypeStringRequired": { + "key": "propTypeStringRequired", + "prefix": "ptsr", + "body": ["PropTypes.string.isRequired;", ""], + "description": "String prop type required" + }, + "propTypeNode": { + "key": "propTypeNode", + "prefix": "ptnd", + "body": ["PropTypes.node;", ""], + "description": "Anything that can be rendered: numbers, strings, elements or an array" + }, + "propTypeNodeRequired": { + "key": "propTypeNodeRequired", + "prefix": "ptndr", + "body": ["PropTypes.node.isRequired;", ""], + "description": "Anything that can be rendered: numbers, strings, elements or an array required" + }, + "propTypeElement": { + "key": "propTypeElement", + "prefix": "ptel", + "body": ["PropTypes.element;", ""], + "description": "React element prop type" + }, + "propTypeElementRequired": { + "key": "propTypeElementRequired", + "prefix": "ptelr", + "body": ["PropTypes.element.isRequired;", ""], + "description": "React element prop type required" + }, + "propTypeInstanceOf": { + "key": "propTypeInstanceOf", + "prefix": "pti", + "body": ["PropTypes.instanceOf($0);", ""], + "description": "Is an instance of a class prop type" + }, + "propTypeInstanceOfRequired": { + "key": "propTypeInstanceOfRequired", + "prefix": "ptir", + "body": ["PropTypes.instanceOf($0).isRequired;", ""], + "description": "Is an instance of a class prop type required" + }, + "propTypeEnum": { + "key": "propTypeEnum", + "prefix": "pte", + "body": ["PropTypes.oneOf(['$0']);", ""], + "description": "Prop type limited to specific values by treating it as an enum" + }, + "propTypeEnumRequired": { + "key": "propTypeEnumRequired", + "prefix": "pter", + "body": ["PropTypes.oneOf(['$0']).isRequired;", ""], + "description": "Prop type limited to specific values by treating it as an enum required" + }, + "propTypeOneOfType": { + "key": "propTypeOneOfType", + "prefix": "ptet", + "body": ["PropTypes.oneOfType([$0]);", ""], + "description": "An object that could be one of many types" + }, + "propTypeOneOfTypeRequired": { + "key": "propTypeOneOfTypeRequired", + "prefix": "ptetr", + "body": ["PropTypes.oneOfType([$0]).isRequired;", ""], + "description": "An object that could be one of many types required" + }, + "propTypeArrayOf": { + "key": "propTypeArrayOf", + "prefix": "ptao", + "body": ["PropTypes.arrayOf($0);", ""], + "description": "An array of a certain type" + }, + "propTypeArrayOfRequired": { + "key": "propTypeArrayOfRequired", + "prefix": "ptaor", + "body": ["PropTypes.arrayOf($0).isRequired;", ""], + "description": "An array of a certain type required" + }, + "propTypeObjectOf": { + "key": "propTypeObjectOf", + "prefix": "ptoo", + "body": ["PropTypes.objectOf($0);", ""], + "description": "An object with property values of a certain type" + }, + "propTypeObjectOfRequired": { + "key": "propTypeObjectOfRequired", + "prefix": "ptoor", + "body": ["PropTypes.objectOf($0).isRequired;", ""], + "description": "An object with property values of a certain type required" + }, + "propTypeShape": { + "key": "propTypeShape", + "prefix": "ptsh", + "body": ["PropTypes.shape({", " $0,", "});", ""], + "description": "An object taking on a particular shape" + }, + "propTypeShapeRequired": { + "key": "propTypeShapeRequired", + "prefix": "ptshr", + "body": ["PropTypes.shape({", " $0,", "}).isRequired;", ""], + "description": "An object taking on a particular shape required" + }, + "propTypeExact": { + "key": "propTypeExact", + "prefix": "ptex", + "body": ["PropTypes.exact({", " $0,", "});", ""], + "description": "An object with warnings on extra properties" + }, + "propTypeExactRequired": { + "key": "propTypeExactRequired", + "prefix": "ptexr", + "body": ["PropTypes.exact({", " $0,", "}).isRequired;", ""], + "description": "An object with warnings on extra properties required" + }, + "propTypeAny": { + "key": "propTypeAny", + "prefix": "ptany", + "body": ["PropTypes.any;", ""], + "description": "Any prop type" + }, + "reactNativeComponent": { + "key": "reactNativeComponent", + "prefix": "rnc", + "body": [ + "import { Text, View } from 'react-native';", + "import React, { Component } from 'react';", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " $0", + " ", + " );", + " }", + "}", + "" + ] + }, + "reactNativeComponentExport": { + "key": "reactNativeComponentExport", + "prefix": "rnce", + "body": [ + "import { Text, View } from 'react-native';", + "import React, { Component } from 'react';", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " $0", + " ", + " );", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ] + }, + "reactNativeComponentWithStyles": { + "key": "reactNativeComponentWithStyles", + "prefix": "rncs", + "body": [ + "import { Text, StyleSheet, View } from 'react-native';", + "import React, { Component } from 'react';", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " $0", + " ", + " );", + " }", + "}", + "", + "const styles = StyleSheet.create({});", + "" + ] + }, + "reactNativeFunctionalComponent": { + "key": "reactNativeFunctionalComponent", + "prefix": "rnf", + "body": [ + "import { View, Text } from 'react-native';", + "import React from 'react';", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " $0", + " ", + " );", + "}", + "" + ] + }, + "reactNativeFunctionalComponentWithStyles": { + "key": "reactNativeFunctionalComponentWithStyles", + "prefix": "rnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native';", + "import React from 'react';", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " $0", + " ", + " );", + "}", + "", + "const styles = StyleSheet.create({});", + "" + ] + }, + "reactNativeFunctionalExportComponent": { + "key": "reactNativeFunctionalExportComponent", + "prefix": "rnfe", + "body": [ + "import { View, Text } from 'react-native';", + "import React from 'react';", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " $0", + " ", + " );", + "};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ] + }, + "reactNativeFunctionalExportComponentWithStyles": { + "key": "reactNativeFunctionalExportComponentWithStyles", + "prefix": "rnfes", + "body": [ + "import { StyleSheet, Text, View } from 'react-native';", + "import React from 'react';", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " $0", + " ", + " );", + "};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "", + "const styles = StyleSheet.create({});", + "" + ] + }, + "reactNativeImport": { + "key": "reactNativeImport", + "prefix": "imrn", + "body": ["import { $0 } from 'react-native';", ""] + }, + "reactNativePureComponent": { + "key": "reactNativePureComponent", + "prefix": "rnpc", + "body": [ + "import { Text, View } from 'react-native';", + "import React, { PureComponent } from 'react';", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " $0", + " ", + " );", + " }", + "}", + "" + ] + }, + "reactNativePureComponentExport": { + "key": "reactNativePureComponentExport", + "prefix": "rnpce", + "body": [ + "import { Text, View } from 'react-native';", + "import React, { PureComponent } from 'react';", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " $0", + " ", + " );", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ] + }, + "reactNativeStyles": { + "key": "reactNativeStyles", + "prefix": "rnstyle", + "body": ["const styles = StyleSheet.create({", " $0,", "});", ""] + }, + "importReduxConnect": { + "key": "importReduxConnect", + "prefix": "redux", + "body": ["import { connect } from 'react-redux';", ""] + }, + "reduxAction": { + "key": "reduxAction", + "prefix": "rxaction", + "body": [ + "export const ${1:first} = (payload) => ({", + " type: ${2:second},", + " payload,", + "});", + "" + ] + }, + "reduxConst": { + "key": "reduxConst", + "prefix": "rxconst", + "body": ["export const ${1:first} = '${1:first}';", ""] + }, + "reduxReducer": { + "key": "reduxReducer", + "prefix": "rxreducer", + "body": [ + "const initialState = {};", + "", + "export default (state = initialState, { type, payload }) => {", + " switch (type) {", + " case ${1:first}:", + " return { ...state, ...payload };", + "", + " default:", + " return state;", + " }", + "};", + "" + ] + }, + "reduxSelector": { + "key": "reduxSelector", + "prefix": "rxselect", + "body": [ + "import { createSelector } from 'reselect';", + "", + "export const ${1:first} = (state) => state.${2:second};", + "" + ] + }, + "reduxSlice": { + "key": "reduxSlice", + "prefix": "rxslice", + "body": [ + "import { createSlice } from '@reduxjs/toolkit';", + "", + "const initialState = {};", + "", + "const ${1:${TM_FILENAME_BASE}} = createSlice({", + " name: ${2:second},", + " initialState,", + " reducers: {},", + "});", + "", + "export const {} = ${1:${TM_FILENAME_BASE}}.actions;", + "", + "export default ${1:${TM_FILENAME_BASE}}.reducer;", + "" + ] + }, + "mappingToProps": { + "key": "mappingToProps", + "prefix": "reduxmap", + "body": [ + "const mapStateToProps = (state) => ({});", + "", + "const mapDispatchToProps = {};", + "" + ] + }, + "describeBlock": { + "key": "describeBlock", + "prefix": "desc", + "body": ["describe('${1:first}', () => {", " $0;", "});", ""], + "description": "Testing `describe` block" + }, + "itAsyncBlock": { + "key": "itAsyncBlock", + "prefix": "tita", + "body": ["it('should ${1:first}', async () => {", " $0;", "});", ""], + "description": "Testing asynchronous `it` block" + }, + "itBlock": { + "key": "itBlock", + "prefix": "tit", + "body": ["it('should ${1:first}', () => {", " $0;", "});", ""], + "description": "Testing `it` block" + }, + "setupReactComponentTestWithRedux": { + "key": "setupReactComponentTestWithRedux", + "prefix": "srtest", + "body": [ + "import React from 'react';", + "import renderer from 'react-test-renderer';", + "import { Provider } from 'react-redux';", + "", + "import store from '~/store';", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}';", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {};", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ", + " );", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot();", + " });", + "});", + "" + ], + "description": "Create test component" + }, + "setupReactNativeTest": { + "key": "setupReactNativeTest", + "prefix": "sntest", + "body": [ + "import 'react-native';", + "import React from 'react';", + "import renderer from 'react-test-renderer';", + "", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}';", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {};", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />);", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot();", + " });", + "});", + "" + ] + }, + "setupReactNativeTestWithRedux": { + "key": "setupReactNativeTestWithRedux", + "prefix": "snrtest", + "body": [ + "import 'react-native';", + "import React from 'react';", + "import renderer from 'react-test-renderer';", + "import { Provider } from 'react-redux';", + "", + "import store from '~/store';", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}';", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {};", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ", + " );", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot();", + " });", + "});", + "" + ] + }, + "setupReactTest": { + "key": "setupReactTest", + "prefix": "stest", + "body": [ + "import React from 'react';", + "import renderer from 'react-test-renderer';", + "", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}';", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {};", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />);", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot();", + " });", + "});", + "" + ] + }, + "testAsyncBlock": { + "key": "testAsyncBlock", + "prefix": "testa", + "body": ["test('should ${1:first}', async () => {", " $0;", "});", ""], + "description": "Testing `asynchronous test` block" + }, + "testBlock": { + "key": "testBlock", + "prefix": "test", + "body": ["test('should ${1:first}', () => {", " $0;", "});", ""], + "description": "Testing `test` block" + } +} diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts index d9eca8f..fb024a3 100644 --- a/src/sourceSnippets/imports.ts +++ b/src/sourceSnippets/imports.ts @@ -146,8 +146,8 @@ const importSnippet: ImportsSnippet = { key: 'import', prefix: 'imp', body: [ - `import ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'${SnippetPlaceholders.LastTab}`, - '', + `import ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'`, + SnippetPlaceholders.LastTab, ], }; diff --git a/src/sourceSnippets/propTypes.ts b/src/sourceSnippets/propTypes.ts index 68924b7..3fd13cc 100644 --- a/src/sourceSnippets/propTypes.ts +++ b/src/sourceSnippets/propTypes.ts @@ -39,91 +39,91 @@ export type PropTypesSnippet = SnippetMapping; const propTypeArray: PropTypesSnippet = { key: 'propTypeArray', prefix: 'pta', - body: ['PropTypes.array,'], + body: ['PropTypes.array'], description: 'Array prop type', }; const propTypeArrayRequired: PropTypesSnippet = { key: 'propTypeArrayRequired', prefix: 'ptar', - body: ['PropTypes.array.isRequired,'], + body: ['PropTypes.array.isRequired'], description: 'Array prop type required', }; const propTypeBool: PropTypesSnippet = { key: 'propTypeBool', prefix: 'ptb', - body: ['PropTypes.bool,'], + body: ['PropTypes.bool'], description: 'Bool prop type', }; const propTypeBoolRequired: PropTypesSnippet = { key: 'propTypeBoolRequired', prefix: 'ptbr', - body: ['PropTypes.bool.isRequired,'], + body: ['PropTypes.bool.isRequired'], description: 'Bool prop type required', }; const propTypeFunc: PropTypesSnippet = { key: 'propTypeFunc', prefix: 'ptf', - body: ['PropTypes.func,'], + body: ['PropTypes.func'], description: 'Func prop type', }; const propTypeFuncRequired: PropTypesSnippet = { key: 'propTypeFuncRequired', prefix: 'ptfr', - body: ['PropTypes.func.isRequired,'], + body: ['PropTypes.func.isRequired'], description: 'Func prop type required', }; const propTypeNumber: PropTypesSnippet = { key: 'propTypeNumber', prefix: 'ptn', - body: ['PropTypes.number,'], + body: ['PropTypes.number'], description: 'Number prop type', }; const propTypeNumberRequired: PropTypesSnippet = { key: 'propTypeNumberRequired', prefix: 'ptnr', - body: ['PropTypes.number.isRequired,'], + body: ['PropTypes.number.isRequired'], description: 'Number prop type required', }; const propTypeObject: PropTypesSnippet = { key: 'propTypeObject', prefix: 'pto', - body: ['PropTypes.object,'], + body: ['PropTypes.object'], description: 'Object prop type', }; const propTypeObjectRequired: PropTypesSnippet = { key: 'propTypeObjectRequired', prefix: 'ptor', - body: ['PropTypes.object.isRequired,'], + body: ['PropTypes.object.isRequired'], description: 'Object prop type required', }; const propTypeString: PropTypesSnippet = { key: 'propTypeString', prefix: 'pts', - body: ['PropTypes.string,'], + body: ['PropTypes.string'], description: 'String prop type', }; const propTypeStringRequired: PropTypesSnippet = { key: 'propTypeStringRequired', prefix: 'ptsr', - body: ['PropTypes.string.isRequired,'], + body: ['PropTypes.string.isRequired'], description: 'String prop type required', }; const propTypeNode: PropTypesSnippet = { key: 'propTypeNode', prefix: 'ptnd', - body: ['PropTypes.node,'], + body: ['PropTypes.node'], description: 'Anything that can be rendered: numbers, strings, elements or an array', }; @@ -131,7 +131,7 @@ const propTypeNode: PropTypesSnippet = { const propTypeNodeRequired: PropTypesSnippet = { key: 'propTypeNodeRequired', prefix: 'ptndr', - body: ['PropTypes.node.isRequired,'], + body: ['PropTypes.node.isRequired'], description: 'Anything that can be rendered: numbers, strings, elements or an array required', }; @@ -139,42 +139,42 @@ const propTypeNodeRequired: PropTypesSnippet = { const propTypeElement: PropTypesSnippet = { key: 'propTypeElement', prefix: 'ptel', - body: ['PropTypes.element,'], + body: ['PropTypes.element'], description: 'React element prop type', }; const propTypeElementRequired: PropTypesSnippet = { key: 'propTypeElementRequired', prefix: 'ptelr', - body: ['PropTypes.element.isRequired,'], + body: ['PropTypes.element.isRequired'], description: 'React element prop type required', }; const propTypeInstanceOf: PropTypesSnippet = { key: 'propTypeInstanceOf', prefix: 'pti', - body: ['PropTypes.instanceOf($0),'], + body: ['PropTypes.instanceOf($0)'], description: 'Is an instance of a class prop type', }; const propTypeInstanceOfRequired: PropTypesSnippet = { key: 'propTypeInstanceOfRequired', prefix: 'ptir', - body: ['PropTypes.instanceOf($0).isRequired,'], + body: ['PropTypes.instanceOf($0).isRequired'], description: 'Is an instance of a class prop type required', }; const propTypeEnum: PropTypesSnippet = { key: 'propTypeEnum', prefix: 'pte', - body: ["PropTypes.oneOf(['$0']),"], + body: ["PropTypes.oneOf(['$0'])"], description: 'Prop type limited to specific values by treating it as an enum', }; const propTypeEnumRequired: PropTypesSnippet = { key: 'propTypeEnumRequired', prefix: 'pter', - body: ["PropTypes.oneOf(['$0']).isRequired,"], + body: ["PropTypes.oneOf(['$0']).isRequired"], description: 'Prop type limited to specific values by treating it as an enum required', }; @@ -182,77 +182,77 @@ const propTypeEnumRequired: PropTypesSnippet = { const propTypeOneOfType: PropTypesSnippet = { key: 'propTypeOneOfType', prefix: 'ptet', - body: ['PropTypes.oneOfType([', ' $0', ']),'], + body: ['PropTypes.oneOfType([', ' $0', '])'], description: 'An object that could be one of many types', }; const propTypeOneOfTypeRequired: PropTypesSnippet = { key: 'propTypeOneOfTypeRequired', prefix: 'ptetr', - body: ['PropTypes.oneOfType([', ' $0', ']).isRequired,'], + body: ['PropTypes.oneOfType([', ' $0', ']).isRequired'], description: 'An object that could be one of many types required', }; const propTypeArrayOf: PropTypesSnippet = { key: 'propTypeArrayOf', prefix: 'ptao', - body: ['PropTypes.arrayOf($0),'], + body: ['PropTypes.arrayOf($0)'], description: 'An array of a certain type', }; const propTypeArrayOfRequired: PropTypesSnippet = { key: 'propTypeArrayOfRequired', prefix: 'ptaor', - body: ['PropTypes.arrayOf($0).isRequired,'], + body: ['PropTypes.arrayOf($0).isRequired'], description: 'An array of a certain type required', }; const propTypeObjectOf: PropTypesSnippet = { key: 'propTypeObjectOf', prefix: 'ptoo', - body: ['PropTypes.objectOf($0),'], + body: ['PropTypes.objectOf($0)'], description: 'An object with property values of a certain type', }; const propTypeObjectOfRequired: PropTypesSnippet = { key: 'propTypeObjectOfRequired', prefix: 'ptoor', - body: ['PropTypes.objectOf($0).isRequired,'], + body: ['PropTypes.objectOf($0).isRequired'], description: 'An object with property values of a certain type required', }; const propTypeShape: PropTypesSnippet = { key: 'propTypeShape', prefix: 'ptsh', - body: ['PropTypes.shape({', ' $0', '}),'], + body: ['PropTypes.shape({', ' $0', '})'], description: 'An object taking on a particular shape', }; const propTypeShapeRequired: PropTypesSnippet = { key: 'propTypeShapeRequired', prefix: 'ptshr', - body: ['PropTypes.shape({', ' $0', '}).isRequired,'], + body: ['PropTypes.shape({', ' $0', '}).isRequired'], description: 'An object taking on a particular shape required', }; const propTypeExact: PropTypesSnippet = { key: 'propTypeExact', prefix: 'ptex', - body: ['PropTypes.exact({', ' $0', '}),'], + body: ['PropTypes.exact({', ' $0', '})'], description: 'An object with warnings on extra properties', }; const propTypeExactRequired: PropTypesSnippet = { key: 'propTypeExactRequired', prefix: 'ptexr', - body: ['PropTypes.exact({', ' $0', '}).isRequired,'], + body: ['PropTypes.exact({', ' $0', '}).isRequired'], description: 'An object with warnings on extra properties required', }; const propTypeAny: PropTypesSnippet = { key: 'propTypeAny', prefix: 'ptany', - body: ['PropTypes.any,'], + body: ['PropTypes.any'], description: 'Any prop type', }; diff --git a/src/sourceSnippets/sharedSnippets.ts b/src/sourceSnippets/sharedSnippets.ts index 31b3158..1240915 100644 --- a/src/sourceSnippets/sharedSnippets.ts +++ b/src/sourceSnippets/sharedSnippets.ts @@ -1,3 +1,4 @@ +import { extensionConfig } from '../helpers'; import { SnippetPlaceholders } from '../types'; export const reactComponent = ["import React, { Component } from 'react'", '']; @@ -60,16 +61,16 @@ export const exportDefault = [ '', ]; -export const propsTypeInterface = [ - `${SnippetPlaceholders.TypeInterface} Props {}`, - '', -]; -export const stateTypeInterface = [ - `${SnippetPlaceholders.TypeInterface} State {}`, - '', -]; +const typeInterfacePrefix = (name: string) => { + const { typescriptComponentPropsStatePrefix } = extensionConfig(); + return typescriptComponentPropsStatePrefix === 'type' + ? `type ${name} =` + : `interface ${name} {`; +}; + +export const propsTypeInterface = [`${typeInterfacePrefix('Props')} {}`, '']; +export const stateTypeInterface = [`${typeInterfacePrefix('State')} {}`, '']; export const propsStateInterface = [ ...propsTypeInterface, ...stateTypeInterface, - '', ]; diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts index b69789c..f91219e 100644 --- a/src/sourceSnippets/typescript.ts +++ b/src/sourceSnippets/typescript.ts @@ -44,7 +44,7 @@ const exportInterface: TypescriptSnippet = { key: 'exportInterface', prefix: 'expint', body: [ - `export exportInterface ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, + `export interface ${SnippetPlaceholders.FirstTab} {${SnippetPlaceholders.LastTab}}`, '', ], }; diff --git a/src/types.ts b/src/types.ts index 2a6673a..126dc4e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -11,5 +11,4 @@ export enum SnippetPlaceholders { SecondTab = 'SECOND_TAB', ThirdTab = 'THIRD_TAB', LastTab = 'LAST_TAB', - TypeInterface = 'TYPE_INTERFACE', } diff --git a/yarn.lock b/yarn.lock index 7ec1ffe..d7a742c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -267,11 +267,6 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - "@types/json-schema@^7.0.9": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" @@ -292,10 +287,10 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== -"@types/vscode@1.63.1": - version "1.63.1" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.63.1.tgz#b40f9f18055e2c9498ae543d18c59fbd6ef2e8a3" - integrity sha512-Z+ZqjRcnGfHP86dvx/BtSwWyZPKQ/LBdmAVImY82TphyjOw2KgTKcp7Nx92oNwCTsHzlshwexAG/WiY2JuUm3g== +"@types/vscode@1.60.0": + version "1.60.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.60.0.tgz#9330c317691b4f53441a18b598768faeeb71618a" + integrity sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow== "@typescript-eslint/eslint-plugin@5.8.1": version "5.8.1" @@ -377,20 +372,6 @@ acorn@^8.6.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== -agent-base@4, agent-base@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" - integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== - dependencies: - es6-promisify "^5.0.0" - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -488,16 +469,6 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -567,11 +538,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -commander@2.15.1: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== - commander@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" @@ -598,20 +564,6 @@ cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -619,13 +571,20 @@ debug@^2.6.9: dependencies: ms "2.0.0" -debug@^3.1.0, debug@^3.2.7: +debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== dependencies: ms "^2.1.1" +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + dependencies: + ms "2.1.2" + deep-is@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" @@ -638,11 +597,6 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -706,19 +660,7 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es6-promise@^4.0.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -1051,19 +993,7 @@ glob-parent@^6.0.1: dependencies: is-glob "^4.0.3" -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.0, glob@^7.1.2, glob@^7.1.3: +glob@^7.0.0, glob@^7.1.3: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -1099,11 +1029,6 @@ globby@^11.0.4: merge2 "^1.3.0" slash "^3.0.0" -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - has-bigints@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" @@ -1138,44 +1063,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== - dependencies: - agent-base "4" - debug "3.1.0" - -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - -https-proxy-agent@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" - integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== - dependencies: - agent-base "^4.3.0" - debug "^3.1.0" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -1413,47 +1300,18 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -minimatch@3.0.4, minimatch@^3.0.4: +minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - minimist@^1.2.0: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== - dependencies: - browser-stdout "1.3.1" - commander "2.15.1" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.5" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "5.4.0" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -1676,7 +1534,7 @@ safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -semver@^5.4.1, semver@^5.6.0: +semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -1724,24 +1582,11 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -source-map-support@^0.5.0: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map@^0.5.0: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" @@ -1775,13 +1620,6 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== - dependencies: - has-flag "^3.0.0" - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -1874,27 +1712,6 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -vscode-test@^0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/vscode-test/-/vscode-test-0.4.3.tgz#461ebf25fc4bc93d77d982aed556658a2e2b90b8" - integrity sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w== - dependencies: - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - -vscode@1.1.37: - version "1.1.37" - resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.37.tgz#c2a770bee4bb3fff765e2b72c7bcc813b8a6bb0a" - integrity sha512-vJNj6IlN7IJPdMavlQa1KoFB3Ihn06q1AiN3ZFI/HfzPNzbKZWPPuiU+XkpNOfGU5k15m4r80nxNPlM7wcc0wg== - dependencies: - glob "^7.1.2" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - mocha "^5.2.0" - semver "^5.4.1" - source-map-support "^0.5.0" - vscode-test "^0.4.1" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" From 65e4cae027e2b0988dca2aaa952e680f87753e06 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 18 Jan 2022 21:31:08 +0100 Subject: [PATCH 087/110] fix: snippets path fix --- .vscodeignore | 1 - package.json | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.vscodeignore b/.vscodeignore index ce152c9..2caa1cb 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -4,5 +4,4 @@ .gitignore .vscode/** docs/** -node_modules/** src/** diff --git a/package.json b/package.json index 344d05c..8e058d4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.0.0", + "version": "4.0.2", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", @@ -110,19 +110,19 @@ "snippets": [ { "language": "javascript", - "path": "./src/snippets/generated.json" + "path": "./lib/snippets/generated.json" }, { "language": "javascriptreact", - "path": "./src/snippets/generated.json" + "path": "./lib/snippets/generated.json" }, { "language": "typescript", - "path": "./src/snippets/generated.json" + "path": "./lib/snippets/generated.json" }, { "language": "typescriptreact", - "path": "./src/snippets/generated.json" + "path": "./lib/snippets/generated.json" } ] }, @@ -136,6 +136,9 @@ "dependencies": { "prettier": "2.5.1" }, + "peerDependencies": { + "prettier": "^2" + }, "devDependencies": { "@babel/cli": "7.16.0", "@babel/eslint-parser": "7.16.5", From 045b9aa2c60f601e49c353e422deb0edefe97118 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 19 Jan 2022 12:51:57 +0100 Subject: [PATCH 088/110] fix: add missing `others`, skip adding empty line for oneliners --- docs/Snippets.md | 2 - src/generateSnippets.ts | 29 +- src/snippets/generated.json | 1075 ++++++++++++++++++++++++++++------ src/sourceSnippets/hooks.ts | 20 +- src/sourceSnippets/others.ts | 2 +- 5 files changed, 930 insertions(+), 198 deletions(-) diff --git a/docs/Snippets.md b/docs/Snippets.md index bb30685..1b54713 100644 --- a/docs/Snippets.md +++ b/docs/Snippets.md @@ -64,8 +64,6 @@ I.E. `tsrcc` | `imrs→` | `import React, { useState } from 'react'` | | `imrse→` | `import React, { useState, useEffect } from 'react'` | | `redux→` | `import { connect } from 'react-redux'` | -| `rconst→` | `constructor(props) with this.state` | -| `rconc→` | `constructor(props, context) with this.state` | | `est→` | `this.state = { }` | | `cdm→` | `componentDidMount = () => { }` | | `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index 29ae88e..66a8682 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -11,6 +11,7 @@ import componentsSnippets, { import consoleSnippets, { ConsoleSnippet } from './sourceSnippets/console'; import hooksSnippets, { HooksSnippet } from './sourceSnippets/hooks'; import importsSnippets, { ImportsSnippet } from './sourceSnippets/imports'; +import othersSnippets, { OthersSnippet } from './sourceSnippets/others'; import propTypesSnippets, { PropTypesSnippet, } from './sourceSnippets/propTypes'; @@ -24,6 +25,7 @@ import typescriptSnippets, { } from './sourceSnippets/typescript'; export type SnippetKeys = + | OthersSnippet['key'] | HooksSnippet['key'] | ImportsSnippet['key'] | ReactNativeSnippet['key'] @@ -35,6 +37,7 @@ export type SnippetKeys = | TestsSnippet['key']; export type Snippet = + | OthersSnippet | HooksSnippet | ImportsSnippet | ReactNativeSnippet @@ -49,6 +52,19 @@ export type Snippets = { [key in SnippetKeys]: Snippet; }; +// This is array of prefixes which are currently skipped because of syntax format issues +const skippedSnippets = [ + 'pge', + 'pse', + 'gdsfp', + 'gsbu', + 'scu', + 'cwun', + 'cdm', + 'cdup', + 'rconst', +]; + const getSnippets = () => { const { typescript, languageScopes } = extensionConfig(); @@ -62,13 +78,18 @@ const getSnippets = () => { ...reactNativeSnippets, ...reduxSnippets, ...testsSnippets, + ...othersSnippets, ].reduce((acc, snippet) => { const snippetBody = typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); - acc[snippet.key] = Object.assign(snippet, { - scope: languageScopes, - body: formatSnippet(snippetBody).split('\n'), - }); + const formattedSnippet = skippedSnippets.includes(snippet.prefix) + ? snippetBody + : formatSnippet(snippetBody).split('\n'); + + const body = + snippet.body.length === 1 ? formattedSnippet[0] : formattedSnippet; + + acc[snippet.key] = Object.assign(snippet, { body, scope: languageScopes }); return acc; }, {} as Snippets); diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 0f88798..20df213 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -1,4 +1,264 @@ { + "exportType": { + "body": "export type ${1:first} = { $0 };", + "key": "exportType", + "prefix": "exptp", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportInterface": { + "key": "exportInterface", + "prefix": "expint", + "body": ["export interface ${1:first} {", " $0;", "}", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponent": { + "key": "typescriptReactClassComponent", + "prefix": "tsrcc", + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "body": [ + "import React, { Component } from 'react';", + "", + "type Props = {};", + "", + "type State = {};", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {};", + "", + " render() {", + " return
$0
;", + " }", + "}", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportComponent": { + "key": "typescriptReactClassExportComponent", + "prefix": "tsrce", + "body": [ + "import React, { Component } from 'react';", + "", + "type Props = {};", + "", + "type State = {};", + "", + "class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {};", + "", + " render() {", + " return
$0
;", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalExportComponent": { + "key": "typescriptReactFunctionalExportComponent", + "prefix": "tsrfce", + "body": [ + "import React from 'react';", + "", + "type Props = {};", + "", + "function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return
$0
;", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalComponent": { + "key": "typescriptReactFunctionalComponent", + "prefix": "tsrfc", + "body": [ + "import React from 'react';", + "", + "type Props = {};", + "", + "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return
$0
;", + "}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionExportComponent": { + "key": "typescriptReactArrowFunctionExportComponent", + "prefix": "tsrafce", + "body": [ + "import React from 'react';", + "", + "type Props = {};", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return
$0
;", + "};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionComponent": { + "key": "typescriptReactArrowFunctionComponent", + "prefix": "tsrafc", + "body": [ + "import React from 'react';", + "", + "type Props = {};", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return
$0
;", + "};", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassPureComponent": { + "key": "typescriptReactClassPureComponent", + "prefix": "tsrpc", + "body": [ + "import React, { PureComponent } from 'react';", + "", + "type Props = {};", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return
$0
;", + " }", + "}", + "" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportPureComponent": { + "key": "typescriptReactClassExportPureComponent", + "prefix": "tsrpce", + "body": [ + "import React, { PureComponent } from 'react';", + "", + "type Props = {};", + "", + "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return
$0
;", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponentRedux": { + "key": "typescriptReactClassComponentRedux", + "prefix": "tsrcredux", + "body": [ + "import { connect } from 'react-redux';", + "import React, { Component } from 'react';", + "", + "type Props = {};", + "", + "type State = {};", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {};", + "", + " render() {", + " return
$0
;", + " }", + "}", + "", + "const mapStateToProps = (state) => ({});", + "", + "const mapDispatchToProps = {};", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", + "" + ], + "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponent": { + "key": "typescriptReactNativeArrowFunctionComponent", + "prefix": "tsrnf", + "body": [ + "import { View, Text } from 'react-native';", + "import React from 'react';", + "", + "type Props = {};", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " $0", + " ", + " );", + "};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponentNamedProps": { + "key": "typescriptReactNativeArrowFunctionComponentNamedProps", + "prefix": "tsrnfi", + "body": [ + "import { View } from 'react-native';", + "import React from 'react';", + "", + "type Props = {};", + "", + "const ${1:${TM_FILENAME_BASE}}: React.FC<${1:${TM_FILENAME_BASE}}Props> = (props) => {", + " return $0;", + "};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponentWithStyles": { + "key": "typescriptReactNativeArrowFunctionComponentWithStyles", + "prefix": "tsrnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native';", + "import React from 'react';", + "", + "type Props = {};", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " $0", + " ", + " );", + "};", + "", + "export default ${1:${TM_FILENAME_BASE}};", + "", + "const styles = StyleSheet.create({});", + "" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, "reactArrowFunctionComponent": { "key": "reactArrowFunctionComponent", "prefix": "rafc", @@ -10,7 +270,8 @@ "};", "" ], - "description": "Creates a React Arrow Function Component with ES7 module system" + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactArrowFunctionComponentWithPropTypes": { "key": "reactArrowFunctionComponentWithPropTypes", @@ -28,7 +289,8 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes" + "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactArrowFunctionExportComponent": { "key": "reactArrowFunctionExportComponent", @@ -43,7 +305,8 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React Arrow Function Component with ES7 module system" + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponent": { "key": "reactClassComponent", @@ -58,7 +321,8 @@ "}", "" ], - "description": "Creates a React component class with ES7 module system" + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponentPropTypes": { "key": "reactClassComponentPropTypes", @@ -78,7 +342,8 @@ "}", "" ], - "description": "Creates a React component class with PropTypes and ES7 module system" + "description": "Creates a React component class with PropTypes and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponentRedux": { "key": "reactClassComponentRedux", @@ -100,7 +365,8 @@ "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", "" ], - "description": "Creates a React component class with connected redux and ES7 module system" + "description": "Creates a React component class with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponentReduxPropTypes": { "key": "reactClassComponentReduxPropTypes", @@ -127,7 +393,8 @@ "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", "" ], - "description": "Creates a React component class with PropTypes with connected redux and ES7 module system" + "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassExportComponent": { "key": "reactClassExportComponent", @@ -144,7 +411,8 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React component class with ES7 module system" + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassExportComponentWithPropTypes": { "key": "reactClassExportComponentWithPropTypes", @@ -164,7 +432,8 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React component class with ES7 module system" + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassExportPureComponent": { "key": "reactClassExportPureComponent", @@ -181,7 +450,8 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React pure component class with ES7 module system export" + "description": "Creates a React pure component class with ES7 module system export", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassPureComponent": { "key": "reactClassPureComponent", @@ -196,7 +466,8 @@ "}", "" ], - "description": "Creates a React pure component class with ES7 module system" + "description": "Creates a React pure component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassPureComponentWithPropTypes": { "key": "reactClassPureComponentWithPropTypes", @@ -214,7 +485,8 @@ "}", "" ], - "description": "Creates a React component class with ES7 module system" + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionMemoComponent": { "key": "reactFunctionMemoComponent", @@ -227,7 +499,8 @@ "});", "" ], - "description": "Creates a React Memo Function Component with ES7 module system" + "description": "Creates a React Memo Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionMemoComponentWithPropTypes": { "key": "reactFunctionMemoComponentWithPropTypes", @@ -245,7 +518,8 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React Memo Function Component with ES7 module system with PropTypes" + "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponent": { "key": "reactFunctionalComponent", @@ -258,7 +532,8 @@ "}", "" ], - "description": "Creates a React Functional Component with ES7 module system" + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponentRedux": { "key": "reactFunctionalComponentRedux", @@ -278,7 +553,8 @@ "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", "" ], - "description": "Creates a React functional component with connected redux and ES7 module system" + "description": "Creates a React functional component with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponentReduxPropTypes": { "key": "reactFunctionalComponentReduxPropTypes", @@ -303,7 +579,8 @@ "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", "" ], - "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system" + "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponentWithPropTypes": { "key": "reactFunctionalComponentWithPropTypes", @@ -321,7 +598,8 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React Functional Component with ES7 module system with PropTypes" + "description": "Creates a React Functional Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalExportComponent": { "key": "reactFunctionalExportComponent", @@ -336,100 +614,125 @@ "export default ${1:${TM_FILENAME_BASE}};", "" ], - "description": "Creates a React Functional Component with ES7 module system" + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleAssert": { "key": "consoleAssert", "prefix": "cas", - "body": ["console.assert(${1:first}, ${2:second});", ""], - "description": "If the specified expression is false, the message is written to the console along with a stack trace" + "body": "console.assert(${1:first}, ${2:second});", + "description": "If the specified expression is false, the message is written to the console along with a stack trace", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleClear": { "key": "consoleClear", "prefix": "ccl", - "body": ["console.clear();", ""], - "description": "Clears the console" + "body": "console.clear();", + "description": "Clears the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleCount": { "key": "consoleCount", "prefix": "cco", - "body": ["console.count(${1:first});", ""], - "description": "Writes the the number of times that count() has been invoked at the same line and with the same label" + "body": "console.count(${1:first});", + "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleDir": { "key": "consoleDir", "prefix": "cdi", - "body": ["console.dir(${1:first});", ""], - "description": "Prints a JavaScript representation of the specified object" + "body": "console.dir(${1:first});", + "description": "Prints a JavaScript representation of the specified object", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleError": { "key": "consoleError", "prefix": "cer", - "body": ["console.error(${1:first});", ""], - "description": "Displays a message in the console and also includes a stack trace from where the method was called" + "body": "console.error(${1:first});", + "description": "Displays a message in the console and also includes a stack trace from where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleGroup": { "key": "consoleGroup", "prefix": "cgr", - "body": ["console.group('${1:first}');", ""], - "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called." + "body": "console.group('${1:first}');", + "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleGroupEnd": { "key": "consoleGroupEnd", "prefix": "cge", - "body": ["console.groupEnd();", ""], - "description": "Closes out the corresponding console.group()." + "body": "console.groupEnd();", + "description": "Closes out the corresponding console.group().", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleLog": { "key": "consoleLog", "prefix": "clg", - "body": ["console.log(${1:first});", ""], - "description": "Displays a message in the console" + "body": "console.log(${1:first});", + "description": "Displays a message in the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleTrace": { "key": "consoleTrace", "prefix": "ctr", - "body": ["console.trace(${1:first});", ""], - "description": "Prints a stack trace from the point where the method was called" + "body": "console.trace(${1:first});", + "description": "Prints a stack trace from the point where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleLogObject": { "key": "consoleLogObject", "prefix": "clo", - "body": ["console.log('${1:first}', ${1:first});", ""], - "description": "Logs property with name." + "body": "console.log('${1:first}', ${1:first});", + "description": "Logs property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleLogJson": { "key": "consoleLogJson", "prefix": "clj", - "body": [ - "console.log('${1:first}', JSON.stringify(${1:first}, null, 2));", - "" - ], - "description": "Logs stringified JSON property with name." + "body": "console.log('${1:first}', JSON.stringify(${1:first}, null, 2));", + "description": "Logs stringified JSON property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleTime": { "key": "consoleTime", "prefix": "ctm", - "body": ["console.time('${1:first}');", ""], - "description": "Console time wrapper" + "body": "console.time('${1:first}');", + "description": "Console time wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleTimeEnd": { "key": "consoleTimeEnd", "prefix": "cte", - "body": ["console.timeEnd('${1:first}');", ""], - "description": "Console time end wrapper" + "body": "console.timeEnd('${1:first}');", + "description": "Console time end wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleWarn": { "key": "consoleWarn", "prefix": "cwa", - "body": ["console.warn(${1:first});", ""], - "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message" + "body": "console.warn(${1:first});", + "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleInfo": { "key": "consoleInfo", "prefix": "cin", - "body": ["console.info(${1:first});", ""], - "description": "Displays a message in the console but also displays a blue information icon along with the logged message" + "body": "console.info(${1:first});", + "description": "Displays a message in the console but also displays a blue information icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useCallback": { + "key": "useCallback", + "prefix": "useCallbackSnippet", + "body": ["useCallback(() => {", " ${1:first};", "}, [${2:second}]);", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useContext": { + "key": "useContext", + "prefix": "useContextSnippet", + "body": "const ${1:first} = useContext(${2:second});", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useEffect": { "key": "useEffect", @@ -443,35 +746,8 @@ " };", "}, [${3:third}]);", "" - ] - }, - "useContext": { - "key": "useContext", - "prefix": "useContextSnippet", - "body": ["const ${1:first} = useContext(${2:second});", ""] - }, - "useReducer": { - "key": "useReducer", - "prefix": "useReducerSnippet", - "body": [ - "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third});", - "" - ] - }, - "useCallback": { - "key": "useCallback", - "prefix": "useCallbackSnippet", - "body": ["useCallback(() => {", " ${1:first};", "}, [${2:second}]);", ""] - }, - "useMemo": { - "key": "useMemo", - "prefix": "useMemoSnippet", - "body": ["useMemo(() => ${1:first}, ${2:second});", ""] - }, - "useRef": { - "key": "useRef", - "prefix": "useRefSnippet", - "body": ["const ${1:first} = useRef(${2:second});", ""] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useImperativeHandle": { "key": "useImperativeHandle", @@ -485,7 +761,8 @@ " [${3:third}]", ");", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useLayoutEffect": { "key": "useLayoutEffect", @@ -498,7 +775,32 @@ " };", "}, [${3:third}]);", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useMemo": { + "key": "useMemo", + "prefix": "useMemoSnippet", + "body": "useMemo(() => ${1:first}, ${2:second});", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useReducer": { + "key": "useReducer", + "prefix": "useReducerSnippet", + "body": "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third});", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useRef": { + "key": "useRef", + "prefix": "useRefSnippet", + "body": "const ${1:first} = useRef(${2:second});", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useState": { + "key": "useState", + "prefix": "useStateSnippet", + "body": "const [${1:first}, set${1:first}] = useState(${2:second});", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importAs": { "key": "importAs", @@ -507,12 +809,14 @@ "import { ${2:second} as ${3:third} } from '${1:first}';", "$0;", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importBrowserRouter": { "key": "importBrowserRouter", "prefix": "imbr", - "body": ["import { BrowserRouter as Router } from 'react-router-dom';", ""] + "body": ["import { BrowserRouter as Router } from 'react-router-dom';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importBrowserRouterWithRouteAndNavLink": { "key": "importBrowserRouterWithRouteAndNavLink", @@ -520,42 +824,50 @@ "body": [ "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom';", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importDestructing": { "key": "importDestructing", "prefix": "imd", - "body": ["import { ${2:second} } from '${1:first}';", "$0;", ""] + "body": ["import { ${2:second} } from '${1:first}';", "$0;", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importEverything": { "key": "importEverything", "prefix": "ime", - "body": ["import * as ${2:second} from '${1:first}';", "$0;", ""] + "body": ["import * as ${2:second} from '${1:first}';", "$0;", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importNoModuleName": { "key": "importNoModuleName", "prefix": "imn", - "body": ["import '${1:first}';", "$0;", ""] + "body": ["import '${1:first}';", "$0;", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importPropTypes": { "key": "importPropTypes", "prefix": "impt", - "body": ["import PropTypes from 'prop-types';", ""] + "body": ["import PropTypes from 'prop-types';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReact": { "key": "importReact", "prefix": "imr", - "body": ["import React from 'react';", ""] + "body": ["import React from 'react';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactDom": { "key": "importReactDom", "prefix": "imrd", - "body": ["import ReactDOM from 'react-dom';", ""] + "body": ["import ReactDOM from 'react-dom';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithComponent": { "key": "importReactWithComponent", "prefix": "imrc", - "body": ["import React, { Component } from 'react';", ""] + "body": ["import React, { Component } from 'react';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithComponentAndPropTypes": { "key": "importReactWithComponentAndPropTypes", @@ -564,12 +876,14 @@ "import React, { Component } from 'react';", "import PropTypes from 'prop-types';", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithMemo": { "key": "importReactWithMemo", "prefix": "imrm", - "body": ["import React, { memo } from 'react';", ""] + "body": ["import React, { memo } from 'react';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithMemoAndPropTypes": { "key": "importReactWithMemoAndPropTypes", @@ -578,12 +892,14 @@ "import React, { memo } from 'react';", "import PropTypes from 'prop-types';", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithPureComponent": { "key": "importReactWithPureComponent", "prefix": "imrpc", - "body": ["import React, { PureComponent } from 'react';", ""] + "body": ["import React, { PureComponent } from 'react';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithPureComponentAndPropTypes": { "key": "importReactWithPureComponentAndPropTypes", @@ -592,17 +908,20 @@ "import React, { PureComponent } from 'react';", "import PropTypes from 'prop-types';", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterLink": { "key": "importRouterLink", "prefix": "imbrl", - "body": ["import { Link } from 'react-router-dom';", ""] + "body": ["import { Link } from 'react-router-dom';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterNavLink": { "key": "importRouterNavLink", "prefix": "imbrnl", - "body": ["import { NavLink } from 'react-router-dom';", ""] + "body": ["import { NavLink } from 'react-router-dom';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterSetup": { "key": "importRouterSetup", @@ -610,203 +929,237 @@ "body": [ "import { Route, Switch, NavLink, Link } from 'react-router-dom';", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterSwitch": { "key": "importRouterSwitch", "prefix": "imbrs", - "body": ["import { Switch } from 'react-router-dom';", ""] + "body": ["import { Switch } from 'react-router-dom';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "import": { "key": "import", "prefix": "imp", - "body": ["import ${2:second} from '${1:first}';", "$0;", ""] + "body": ["import ${2:second} from '${1:first}';", "$0;", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArray": { "key": "propTypeArray", "prefix": "pta", - "body": ["PropTypes.array;", ""], - "description": "Array prop type" + "body": "PropTypes.array;", + "description": "Array prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArrayRequired": { "key": "propTypeArrayRequired", "prefix": "ptar", - "body": ["PropTypes.array.isRequired;", ""], - "description": "Array prop type required" + "body": "PropTypes.array.isRequired;", + "description": "Array prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeBool": { "key": "propTypeBool", "prefix": "ptb", - "body": ["PropTypes.bool;", ""], - "description": "Bool prop type" + "body": "PropTypes.bool;", + "description": "Bool prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeBoolRequired": { "key": "propTypeBoolRequired", "prefix": "ptbr", - "body": ["PropTypes.bool.isRequired;", ""], - "description": "Bool prop type required" + "body": "PropTypes.bool.isRequired;", + "description": "Bool prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeFunc": { "key": "propTypeFunc", "prefix": "ptf", - "body": ["PropTypes.func;", ""], - "description": "Func prop type" + "body": "PropTypes.func;", + "description": "Func prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeFuncRequired": { "key": "propTypeFuncRequired", "prefix": "ptfr", - "body": ["PropTypes.func.isRequired;", ""], - "description": "Func prop type required" + "body": "PropTypes.func.isRequired;", + "description": "Func prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNumber": { "key": "propTypeNumber", "prefix": "ptn", - "body": ["PropTypes.number;", ""], - "description": "Number prop type" + "body": "PropTypes.number;", + "description": "Number prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNumberRequired": { "key": "propTypeNumberRequired", "prefix": "ptnr", - "body": ["PropTypes.number.isRequired;", ""], - "description": "Number prop type required" + "body": "PropTypes.number.isRequired;", + "description": "Number prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObject": { "key": "propTypeObject", "prefix": "pto", - "body": ["PropTypes.object;", ""], - "description": "Object prop type" + "body": "PropTypes.object;", + "description": "Object prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObjectRequired": { "key": "propTypeObjectRequired", "prefix": "ptor", - "body": ["PropTypes.object.isRequired;", ""], - "description": "Object prop type required" + "body": "PropTypes.object.isRequired;", + "description": "Object prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeString": { "key": "propTypeString", "prefix": "pts", - "body": ["PropTypes.string;", ""], - "description": "String prop type" + "body": "PropTypes.string;", + "description": "String prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeStringRequired": { "key": "propTypeStringRequired", "prefix": "ptsr", - "body": ["PropTypes.string.isRequired;", ""], - "description": "String prop type required" + "body": "PropTypes.string.isRequired;", + "description": "String prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNode": { "key": "propTypeNode", "prefix": "ptnd", - "body": ["PropTypes.node;", ""], - "description": "Anything that can be rendered: numbers, strings, elements or an array" + "body": "PropTypes.node;", + "description": "Anything that can be rendered: numbers, strings, elements or an array", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNodeRequired": { "key": "propTypeNodeRequired", "prefix": "ptndr", - "body": ["PropTypes.node.isRequired;", ""], - "description": "Anything that can be rendered: numbers, strings, elements or an array required" + "body": "PropTypes.node.isRequired;", + "description": "Anything that can be rendered: numbers, strings, elements or an array required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeElement": { "key": "propTypeElement", "prefix": "ptel", - "body": ["PropTypes.element;", ""], - "description": "React element prop type" + "body": "PropTypes.element;", + "description": "React element prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeElementRequired": { "key": "propTypeElementRequired", "prefix": "ptelr", - "body": ["PropTypes.element.isRequired;", ""], - "description": "React element prop type required" + "body": "PropTypes.element.isRequired;", + "description": "React element prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeInstanceOf": { "key": "propTypeInstanceOf", "prefix": "pti", - "body": ["PropTypes.instanceOf($0);", ""], - "description": "Is an instance of a class prop type" + "body": "PropTypes.instanceOf($0);", + "description": "Is an instance of a class prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeInstanceOfRequired": { "key": "propTypeInstanceOfRequired", "prefix": "ptir", - "body": ["PropTypes.instanceOf($0).isRequired;", ""], - "description": "Is an instance of a class prop type required" + "body": "PropTypes.instanceOf($0).isRequired;", + "description": "Is an instance of a class prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeEnum": { "key": "propTypeEnum", "prefix": "pte", - "body": ["PropTypes.oneOf(['$0']);", ""], - "description": "Prop type limited to specific values by treating it as an enum" + "body": "PropTypes.oneOf(['$0']);", + "description": "Prop type limited to specific values by treating it as an enum", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeEnumRequired": { "key": "propTypeEnumRequired", "prefix": "pter", - "body": ["PropTypes.oneOf(['$0']).isRequired;", ""], - "description": "Prop type limited to specific values by treating it as an enum required" + "body": "PropTypes.oneOf(['$0']).isRequired;", + "description": "Prop type limited to specific values by treating it as an enum required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeOneOfType": { "key": "propTypeOneOfType", "prefix": "ptet", "body": ["PropTypes.oneOfType([$0]);", ""], - "description": "An object that could be one of many types" + "description": "An object that could be one of many types", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeOneOfTypeRequired": { "key": "propTypeOneOfTypeRequired", "prefix": "ptetr", "body": ["PropTypes.oneOfType([$0]).isRequired;", ""], - "description": "An object that could be one of many types required" + "description": "An object that could be one of many types required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArrayOf": { "key": "propTypeArrayOf", "prefix": "ptao", - "body": ["PropTypes.arrayOf($0);", ""], - "description": "An array of a certain type" + "body": "PropTypes.arrayOf($0);", + "description": "An array of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArrayOfRequired": { "key": "propTypeArrayOfRequired", "prefix": "ptaor", - "body": ["PropTypes.arrayOf($0).isRequired;", ""], - "description": "An array of a certain type required" + "body": "PropTypes.arrayOf($0).isRequired;", + "description": "An array of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObjectOf": { "key": "propTypeObjectOf", "prefix": "ptoo", - "body": ["PropTypes.objectOf($0);", ""], - "description": "An object with property values of a certain type" + "body": "PropTypes.objectOf($0);", + "description": "An object with property values of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObjectOfRequired": { "key": "propTypeObjectOfRequired", "prefix": "ptoor", - "body": ["PropTypes.objectOf($0).isRequired;", ""], - "description": "An object with property values of a certain type required" + "body": "PropTypes.objectOf($0).isRequired;", + "description": "An object with property values of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeShape": { "key": "propTypeShape", "prefix": "ptsh", "body": ["PropTypes.shape({", " $0,", "});", ""], - "description": "An object taking on a particular shape" + "description": "An object taking on a particular shape", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeShapeRequired": { "key": "propTypeShapeRequired", "prefix": "ptshr", "body": ["PropTypes.shape({", " $0,", "}).isRequired;", ""], - "description": "An object taking on a particular shape required" + "description": "An object taking on a particular shape required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeExact": { "key": "propTypeExact", "prefix": "ptex", "body": ["PropTypes.exact({", " $0,", "});", ""], - "description": "An object with warnings on extra properties" + "description": "An object with warnings on extra properties", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeExactRequired": { "key": "propTypeExactRequired", "prefix": "ptexr", "body": ["PropTypes.exact({", " $0,", "}).isRequired;", ""], - "description": "An object with warnings on extra properties required" + "description": "An object with warnings on extra properties required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeAny": { "key": "propTypeAny", "prefix": "ptany", - "body": ["PropTypes.any;", ""], - "description": "Any prop type" + "body": "PropTypes.any;", + "description": "Any prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeComponent": { "key": "reactNativeComponent", @@ -825,7 +1178,8 @@ " }", "}", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeComponentExport": { "key": "reactNativeComponentExport", @@ -846,7 +1200,8 @@ "", "export default ${1:${TM_FILENAME_BASE}};", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeComponentWithStyles": { "key": "reactNativeComponentWithStyles", @@ -867,7 +1222,8 @@ "", "const styles = StyleSheet.create({});", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalComponent": { "key": "reactNativeFunctionalComponent", @@ -884,7 +1240,8 @@ " );", "}", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalComponentWithStyles": { "key": "reactNativeFunctionalComponentWithStyles", @@ -903,7 +1260,8 @@ "", "const styles = StyleSheet.create({});", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalExportComponent": { "key": "reactNativeFunctionalExportComponent", @@ -922,7 +1280,8 @@ "", "export default ${1:${TM_FILENAME_BASE}};", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalExportComponentWithStyles": { "key": "reactNativeFunctionalExportComponentWithStyles", @@ -943,12 +1302,14 @@ "", "const styles = StyleSheet.create({});", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeImport": { "key": "reactNativeImport", "prefix": "imrn", - "body": ["import { $0 } from 'react-native';", ""] + "body": ["import { $0 } from 'react-native';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativePureComponent": { "key": "reactNativePureComponent", @@ -967,7 +1328,8 @@ " }", "}", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativePureComponentExport": { "key": "reactNativePureComponentExport", @@ -988,17 +1350,20 @@ "", "export default ${1:${TM_FILENAME_BASE}};", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeStyles": { "key": "reactNativeStyles", "prefix": "rnstyle", - "body": ["const styles = StyleSheet.create({", " $0,", "});", ""] + "body": ["const styles = StyleSheet.create({", " $0,", "});", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReduxConnect": { "key": "importReduxConnect", "prefix": "redux", - "body": ["import { connect } from 'react-redux';", ""] + "body": ["import { connect } from 'react-redux';", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxAction": { "key": "reduxAction", @@ -1009,12 +1374,14 @@ " payload,", "});", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxConst": { "key": "reduxConst", "prefix": "rxconst", - "body": ["export const ${1:first} = '${1:first}';", ""] + "body": "export const ${1:first} = '${1:first}';", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxReducer": { "key": "reduxReducer", @@ -1032,7 +1399,8 @@ " }", "};", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxSelector": { "key": "reduxSelector", @@ -1042,7 +1410,8 @@ "", "export const ${1:first} = (state) => state.${2:second};", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxSlice": { "key": "reduxSlice", @@ -1062,7 +1431,8 @@ "", "export default ${1:${TM_FILENAME_BASE}}.reducer;", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "mappingToProps": { "key": "mappingToProps", @@ -1072,25 +1442,29 @@ "", "const mapDispatchToProps = {};", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "describeBlock": { "key": "describeBlock", "prefix": "desc", "body": ["describe('${1:first}', () => {", " $0;", "});", ""], - "description": "Testing `describe` block" + "description": "Testing `describe` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "itAsyncBlock": { "key": "itAsyncBlock", "prefix": "tita", "body": ["it('should ${1:first}', async () => {", " $0;", "});", ""], - "description": "Testing asynchronous `it` block" + "description": "Testing asynchronous `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "itBlock": { "key": "itBlock", "prefix": "tit", "body": ["it('should ${1:first}', () => {", " $0;", "});", ""], - "description": "Testing `it` block" + "description": "Testing `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactComponentTestWithRedux": { "key": "setupReactComponentTestWithRedux", @@ -1117,7 +1491,8 @@ "});", "" ], - "description": "Create test component" + "description": "Create test component", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactNativeTest": { "key": "setupReactNativeTest", @@ -1138,7 +1513,8 @@ " });", "});", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactNativeTestWithRedux": { "key": "setupReactNativeTestWithRedux", @@ -1165,7 +1541,8 @@ " });", "});", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactTest": { "key": "setupReactTest", @@ -1185,18 +1562,344 @@ " });", "});", "" - ] + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "testAsyncBlock": { "key": "testAsyncBlock", "prefix": "testa", "body": ["test('should ${1:first}', async () => {", " $0;", "});", ""], - "description": "Testing `asynchronous test` block" + "description": "Testing `asynchronous test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "testBlock": { "key": "testBlock", "prefix": "test", "body": ["test('should ${1:first}', () => {", " $0;", "});", ""], - "description": "Testing `test` block" + "description": "Testing `test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefault": { + "key": "exportDefault", + "prefix": "exp", + "body": ["export default $0;", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDestructing": { + "key": "exportDestructing", + "prefix": "exd", + "body": ["export { ${2:second} } from '${1:first}';", "$0;", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportAs": { + "key": "exportAs", + "prefix": "exa", + "body": [ + "export { ${2:second} as ${3:third} } from '${1:first}';", + "$0;", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportNamedFunction": { + "key": "exportNamedFunction", + "prefix": "enf", + "body": ["export const ${1:first} = (${2:second}) => {", " $0;", "};", ""], + "description": "Export named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultFunction": { + "key": "exportDefaultFunction", + "prefix": "edf", + "body": ["export default (${1:first}) => {", " $0;", "};", ""], + "description": "Export default function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultNamedFunction": { + "key": "exportDefaultNamedFunction", + "prefix": "ednf", + "body": [ + "export default function ${1:first}(${2:second}) {", + " $0;", + "}", + "" + ], + "description": "Export default named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "method": { + "key": "method", + "prefix": "met", + "body": ["${1:first} = (${2:second}) => {", " $0;", "};", ""], + "description": "Creates a method inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertyGet": { + "key": "propertyGet", + "prefix": "pge", + "body": "get ${1:first}() {\n return this.$0\n}\n", + "description": "Creates a getter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertySet": { + "key": "propertySet", + "prefix": "pse", + "body": "set ${1:first}(${2:second}) {$0}\n", + "description": "Creates a setter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forEach": { + "key": "forEach", + "prefix": "fre", + "body": ["${1:first}.forEach((${2:second}) => {", " $0;", "});", ""], + "description": "Creates a forEach statement", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forOf": { + "key": "forOf", + "prefix": "fof", + "body": ["for (let ${1:first} of ${2:second}) {", " $0;", "}", ""], + "description": "Iterating over property names of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forIn": { + "key": "forIn", + "prefix": "fin", + "body": ["for (let ${1:first} in ${2:second}) {", " $0;", "}", ""], + "description": "Iterating over property values of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "anonymousFunction": { + "key": "anonymousFunction", + "prefix": "anfn", + "body": ["(${1:first}) => {", " ${2:second};", "};", ""], + "description": "Creates an anonymous function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "namedFunction": { + "key": "namedFunction", + "prefix": "nfn", + "body": [ + "const ${1:first} = (${2:second}) => {", + " ${3:third};", + "};", + "" + ], + "description": "Creates a named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingObject": { + "key": "destructingObject", + "prefix": "dob", + "body": ["const { ${2:second} } = ${1:first};", ""], + "description": "Creates and assigns a local variable using object destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingArray": { + "key": "destructingArray", + "prefix": "dar", + "body": ["const [${2:second}] = ${1:first};", ""], + "description": "Creates and assigns a local variable using array destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setInterval": { + "key": "setInterval", + "prefix": "sti", + "body": ["setInterval(() => {", " ${2:second};", "}, $0);", ""], + "description": "Executes the given function at specified intervals", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setTimeOut": { + "key": "setTimeOut", + "prefix": "sto", + "body": ["setTimeout(() => {", " ${2:second};", "}, ${1:first});", ""], + "description": "Executes the given function after the specified delay", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "promise": { + "key": "promise", + "prefix": "prom", + "body": ["return new Promise((resolve, reject) => {", " $0;", "});", ""], + "description": "Creates and returns a new Promise in the standard ES7 syntax", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructProps": { + "key": "destructProps", + "prefix": "cp", + "body": ["const { $0 } = this.props;", ""], + "description": "Creates and assigns a local variable using props destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructState": { + "key": "destructState", + "prefix": "cs", + "body": ["const { $0 } = this.state;", ""], + "description": "Creates and assigns a local variable using state destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "classConstructor": { + "key": "classConstructor", + "prefix": "rconst", + "body": "constructor(props) {\n super(props)\n\n this.state = {\n $0\n }\n}\n", + "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "emptyState": { + "key": "emptyState", + "prefix": "est", + "body": ["state = {", " $0,", "};", ""], + "description": "Creates empty state object. To be used in a constructor.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidMount": { + "key": "componentDidMount", + "prefix": "cdm", + "body": "componentDidMount() {\n $0\n}\n", + "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "shouldComponentUpdate": { + "key": "shouldComponentUpdate", + "prefix": "scu", + "body": "shouldComponentUpdate(nextProps, nextState) {\n $0\n}\n", + "description": "Invoked before rendering when new props or state are being received. ", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidUpdate": { + "key": "componentDidUpdate", + "prefix": "cdup", + "body": "componentDidUpdate(prevProps, prevState) {\n $0\n}\n", + "description": "Invoked immediately after the component's updates are flushed to the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentWillUnmount": { + "key": "componentWillUnmount", + "prefix": "cwun", + "body": "componentWillUnmount() {\n $0\n}\n", + "description": "Invoked immediately before a component is unmounted from the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getDerivedStateFromProps": { + "key": "getDerivedStateFromProps", + "prefix": "gdsfp", + "body": "static getDerivedStateFromProps(props, state) {\n $0\n}", + "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getSnapshotBeforeUpdate": { + "key": "getSnapshotBeforeUpdate", + "prefix": "gsbu", + "body": "getSnapshotBeforeUpdate = (prevProps, prevState) => {\n $0\n}\n", + "description": "Called right before mutations are made (e.g. before the DOM is updated)", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createContext": { + "key": "createContext", + "prefix": "rcontext", + "body": ["const $0 = React.createContext();", ""], + "description": "Create React context", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createRef": { + "key": "createRef", + "prefix": "cref", + "body": ["this.$0Ref = React.createRef();", ""], + "description": "Create ref statement used inside constructor", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateObject": { + "key": "componentSetStateObject", + "prefix": "sst", + "body": ["this.setState({ $0 });", ""], + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateFunc": { + "key": "componentSetStateFunc", + "prefix": "ssf", + "body": [ + "this.setState((state, props) => {", + " return { $0 };", + "});", + "" + ], + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentProps": { + "key": "componentProps", + "prefix": "props", + "body": ["this.props.$0;", ""], + "description": "Access component's props", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentState": { + "key": "componentState", + "prefix": "state", + "body": ["this.state.$0;", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "bindThis": { + "key": "bindThis", + "prefix": "bnd", + "body": ["this.${1:first} = this.${1:first}.bind(this);", ""], + "description": "Binds this to a method", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "commentBigBlock": { + "key": "commentBigBlock", + "prefix": "cmmb", + "body": ["/**", " * $0", " */", ""], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponentWithRedux": { + "key": "hocComponentWithRedux", + "prefix": "hocredux", + "body": [ + "import React from 'react';", + "import { connect } from 'react-redux';", + "import PropTypes from 'prop-types';", + "", + "export const mapStateToProps = (state) => ({});", + "", + "export const mapDispatchToProps = {};", + "", + "export const ${1:first} = (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ;", + "", + " hocComponent.propTypes = {};", + "", + " return hocComponent;", + "};", + "", + "export default (WrapperComponent) =>", + " connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent));", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponent": { + "key": "hocComponent", + "prefix": "hoc", + "body": [ + "import React from 'react';", + "import PropTypes from 'prop-types';", + "", + "export default (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ;", + "", + " hocComponent.propTypes = {};", + "", + " return hocComponent;", + "};", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typeofSnippet": { + "key": "typeofSnippet", + "prefix": "tpf", + "body": "typeof $0;", + "scope": "typescript,typescriptreact,javascript,javascriptreact" } } diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts index c4c6252..ffc689e 100644 --- a/src/sourceSnippets/hooks.ts +++ b/src/sourceSnippets/hooks.ts @@ -1,6 +1,7 @@ import { SnippetMapping, SnippetPlaceholders } from '../types'; type HookMappings = { + useState: 'useStateSnippet'; useCallback: 'useCallbackSnippet'; useContext: 'useContextSnippet'; useEffect: 'useEffectSnippet'; @@ -36,6 +37,14 @@ const useContext: HooksSnippet = { ], }; +const useState: HooksSnippet = { + key: 'useState', + prefix: 'useStateSnippet', + body: [ + `const [${SnippetPlaceholders.FirstTab}, set${SnippetPlaceholders.FirstTab}] = useState(${SnippetPlaceholders.SecondTab})`, + ], +}; + const useReducer: HooksSnippet = { key: 'useReducer', prefix: 'useReducerSnippet', @@ -102,12 +111,13 @@ const useLayoutEffect: HooksSnippet = { }; export default [ - useEffect, - useContext, - useReducer, useCallback, - useMemo, - useRef, + useContext, + useEffect, useImperativeHandle, useLayoutEffect, + useMemo, + useReducer, + useRef, + useState, ]; diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts index bdd76c4..9fb88d1 100644 --- a/src/sourceSnippets/others.ts +++ b/src/sourceSnippets/others.ts @@ -404,7 +404,7 @@ const bindThis: OthersSnippet = { key: 'bindThis', prefix: 'bnd', body: [ - `this.${SnippetPlaceholders.FirstTab} = this.${SnippetPlaceholders.FirstTab}.bind(this)${SnippetPlaceholders.LastTab}`, + `this.${SnippetPlaceholders.FirstTab} = this.${SnippetPlaceholders.FirstTab}.bind(this)`, '', ], description: 'Binds this to a method', From 6bc8ec96c24beea7e54f21c9fe2476e73d669cd7 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 19 Jan 2022 12:52:12 +0100 Subject: [PATCH 089/110] 4.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e058d4..c3c11aa 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.0.2", + "version": "4.0.3", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", From 783fbc2cc18bbbd59ce3bfd39da1611ec261eb4a Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 19 Jan 2022 17:50:28 +0100 Subject: [PATCH 090/110] chore: add importReactOnTop setting handle --- package.json | 2 +- src/generateSnippets.ts | 29 +++------------- src/helpers.ts | 76 ++++++++++++++++++++++++++++++++++++++--- src/index.ts | 25 ++++++++------ 4 files changed, 91 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index c3c11aa..467c39a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.0.3", + "version": "4.0.4", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", diff --git a/src/generateSnippets.ts b/src/generateSnippets.ts index 66a8682..6a165b3 100644 --- a/src/generateSnippets.ts +++ b/src/generateSnippets.ts @@ -2,7 +2,7 @@ import { writeFile } from 'fs'; import { extensionConfig, - formatSnippet, + parseSnippetToBody, replaceSnippetPlaceholders, } from './helpers'; import componentsSnippets, { @@ -52,19 +52,6 @@ export type Snippets = { [key in SnippetKeys]: Snippet; }; -// This is array of prefixes which are currently skipped because of syntax format issues -const skippedSnippets = [ - 'pge', - 'pse', - 'gdsfp', - 'gsbu', - 'scu', - 'cwun', - 'cdm', - 'cdup', - 'rconst', -]; - const getSnippets = () => { const { typescript, languageScopes } = extensionConfig(); @@ -80,16 +67,10 @@ const getSnippets = () => { ...testsSnippets, ...othersSnippets, ].reduce((acc, snippet) => { - const snippetBody = - typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); - const formattedSnippet = skippedSnippets.includes(snippet.prefix) - ? snippetBody - : formatSnippet(snippetBody).split('\n'); - - const body = - snippet.body.length === 1 ? formattedSnippet[0] : formattedSnippet; - - acc[snippet.key] = Object.assign(snippet, { body, scope: languageScopes }); + acc[snippet.key] = Object.assign(snippet, { + body: parseSnippetToBody(snippet), + scope: languageScopes, + }); return acc; }, {} as Snippets); diff --git a/src/helpers.ts b/src/helpers.ts index 509fd0b..4a8fafe 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,6 +1,7 @@ import prettier, { Options } from 'prettier'; import { workspace } from 'vscode'; +import { Snippet } from './generateSnippets'; import { SnippetPlaceholders } from './types'; export type ExtensionSettings = { @@ -37,6 +38,11 @@ const getPrettierConfig = (): Options => { }; }; +const formatSnippet = (string: string) => { + const prettierConfig = getPrettierConfig(); + return prettier.format(string, prettierConfig); +}; + export const replaceSnippetPlaceholders = (snippetString: string) => String(snippetString) .replace( @@ -59,11 +65,6 @@ export const revertSnippetPlaceholders = (snippetString: string) => .replace(new RegExp(/\${3:third}/, 'g'), SnippetPlaceholders.ThirdTab) .replace(new RegExp(/\$0/, 'g'), SnippetPlaceholders.LastTab); -export const formatSnippet = (string: string) => { - const prettierConfig = getPrettierConfig(); - return prettier.format(string, prettierConfig); -}; - export const parseSnippet = (body: string | string[]) => { const snippetBody = typeof body === 'string' ? body : body.join('\n'); @@ -71,3 +72,68 @@ export const parseSnippet = (body: string | string[]) => { formatSnippet(revertSnippetPlaceholders(snippetBody)), ); }; + +// This is array of prefixes which are currently skipped because of syntax format issues +const skippedSnippets = [ + 'pge', + 'pse', + 'gdsfp', + 'gsbu', + 'scu', + 'cwun', + 'cdm', + 'cdup', + 'rconst', +]; + +const withReactImport = [ + 'rfce', + 'rfc', + 'rfcp', + 'rafce', + 'rafc', + 'rafcp', + 'rnfe', + 'rnfes', + 'rnf', + 'rnfs', + 'stest', + 'sntest', + 'srtest', + 'snrtest', + 'hocredux', + 'hoc', +]; + +const replaceOrRemoveReactImport = (snippetBody: string[]) => { + const reactImportIndex = snippetBody.findIndex((line) => + line.match(new RegExp(/import React/, 'g')), + ); + + if (reactImportIndex !== -1) { + const line = snippetBody[reactImportIndex]; + snippetBody[reactImportIndex] = line + .replace(new RegExp(/^import React .*$/, 'g'), '') + .replace(new RegExp(/^import React, /, 'g'), 'import '); + } + + return snippetBody.join('\n'); +}; + +export const parseSnippetToBody = (snippet: Snippet) => { + const { importReactOnTop } = extensionConfig(); + const body = + typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); + + const snippetBody = importReactOnTop + ? body + : withReactImport.includes(snippet.prefix) + ? replaceOrRemoveReactImport(snippet.body) + : body; + + const formattedSnippet = skippedSnippets.includes(snippet.prefix) + ? snippetBody + : formatSnippet(snippetBody).split('\n'); + + return snippet.body.length === 1 ? formattedSnippet[0] : formattedSnippet; +}; diff --git a/src/index.ts b/src/index.ts index a0d26cd..6fe07ab 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { commands, ConfigurationChangeEvent, ExtensionContext, + window, workspace, } from 'vscode'; @@ -13,17 +14,19 @@ const showRestartMessage = async ({ }: ConfigurationChangeEvent) => { if (affectsConfiguration('reactSnippets')) { await generateSnippets(); - // window - // .showWarningMessage( - // 'React Snippets: Please restart VS Code to apply snippet formatting changes', - // 'Restart VS Code', - // 'Ignore', - // ) - // .then((action?: string) => { - // if (action === 'Restart VS Code') { - // commands.executeCommand('workbench.action.reloadWindow'); - // } - // }); + setTimeout(() => { + window + .showWarningMessage( + 'React Snippets: Please restart VS Code to apply snippet formatting changes', + 'Restart VS Code', + 'Ignore', + ) + .then((action?: string) => { + if (action === 'Restart VS Code') { + commands.executeCommand('workbench.action.reloadWindow'); + } + }); + }, 1000); } }; From 3a624f7c44da5c0207568e3b364d0a463d724954 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 20 Jan 2022 14:14:11 +0100 Subject: [PATCH 091/110] feat: add type/interface recognition, add capitalize to useState --- README.md | 11 +++ package.json | 6 +- src/helpers.ts | 53 ++++++++---- src/snippets/generated.json | 24 +----- src/sourceSnippets/components.ts | 54 ++++++------- src/sourceSnippets/console.ts | 32 ++++---- src/sourceSnippets/hooks.ts | 38 ++++----- src/sourceSnippets/imports.ts | 23 +++--- src/sourceSnippets/others.ts | 115 ++++++++++++--------------- src/sourceSnippets/reactNative.ts | 26 +++--- src/sourceSnippets/redux.ts | 22 +++-- src/sourceSnippets/sharedSnippets.ts | 22 ++--- src/sourceSnippets/tests.ts | 46 +++++------ src/sourceSnippets/typescript.ts | 38 +++++---- src/types.ts | 30 +++++-- 15 files changed, 265 insertions(+), 275 deletions(-) diff --git a/README.md b/README.md index 2751c7f..7391cc4 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,17 @@ Paste the following command and press `Enter`: ext install dsznajder.es7-react-js-snippets ``` +## Options + +From version 4 extension provides options to customize the behavior of the snippets: + +| Option | Description | +| ---------------: | ---------------------------------------------------------------------------- | +| languageScopes | list of supported languages / files recognition | +| prettierEnabled | determines if snippets should be parsed with project prettier config | +| importReactOnTop | If disabled, snippets won't contain `import React` on top. React 17+ support | +| typescript | adds additional typescript snippets | + # Sponsors


diff --git a/package.json b/package.json index 467c39a..4892d71 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.0.4", + "version": "4.1.0", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", @@ -74,7 +74,7 @@ "reactSnippets.settings.typescript": { "type": "boolean", "markdownDescription": "Controls if React components have typescript Props typing.", - "default": false + "default": true }, "reactSnippets.settings.semiColons": { "type": "boolean", @@ -96,7 +96,7 @@ "markdownDescription": "defines the language scopes for which the snippets will be available.\nUse comma separated values.\nFor example: `typescript,typescriptreact,javascript,javascriptreact`", "default": "typescript,typescriptreact,javascript,javascriptreact" }, - "reactSnippets.settings.typescriptComponentPropsStatePrefix": { + "reactSnippets.settings.typescriptPropsStatePrefix": { "type": "string", "markdownDescription": "Controls which prefix for typescript snippets should use for props/state.", "default": "type", diff --git a/src/helpers.ts b/src/helpers.ts index 4a8fafe..cb55ac9 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -2,7 +2,7 @@ import prettier, { Options } from 'prettier'; import { workspace } from 'vscode'; import { Snippet } from './generateSnippets'; -import { SnippetPlaceholders } from './types'; +import { Mappings, Placeholders } from './types'; export type ExtensionSettings = { languageScopes: string; @@ -12,7 +12,7 @@ export type ExtensionSettings = { singleQuote: boolean; typescript: boolean; tabWidth: number; - typescriptComponentPropsStatePrefix: 'type' | 'interface'; + typescriptPropsStatePrefix: 'type' | 'interface'; }; let prettierConfig: prettier.Options | null; @@ -43,27 +43,46 @@ const formatSnippet = (string: string) => { return prettier.format(string, prettierConfig); }; -export const replaceSnippetPlaceholders = (snippetString: string) => - String(snippetString) +export const replaceSnippetPlaceholders = (snippetString: string) => { + const { typescriptPropsStatePrefix } = extensionConfig(); + const propsPlaceholder = + typescriptPropsStatePrefix === 'type' + ? Mappings.TypeProps + : Mappings.InterfaceProps; + const statePlaceholder = + typescriptPropsStatePrefix === 'type' + ? Mappings.TypeState + : Mappings.InterfaceState; + + return String(snippetString) + .replace(new RegExp(Placeholders.FileName, 'g'), '${1:${TM_FILENAME_BASE}}') + .replace(new RegExp(Placeholders.FirstTab, 'g'), '${1:first}') + .replace(new RegExp(Placeholders.SecondTab, 'g'), '${2:second}') + .replace(new RegExp(Placeholders.ThirdTab, 'g'), '${3:third}') + .replace(new RegExp(Placeholders.LastTab, 'g'), '$0') .replace( - new RegExp(SnippetPlaceholders.FileName, 'g'), - '${1:${TM_FILENAME_BASE}}', + new RegExp(Placeholders.Capitalize, 'g'), + '${1/(.*)/${1:/capitalize}/}', ) - .replace(new RegExp(SnippetPlaceholders.FirstTab, 'g'), '${1:first}') - .replace(new RegExp(SnippetPlaceholders.SecondTab, 'g'), '${2:second}') - .replace(new RegExp(SnippetPlaceholders.ThirdTab, 'g'), '${3:third}') - .replace(new RegExp(SnippetPlaceholders.LastTab, 'g'), '$0'); + .replace(new RegExp(Placeholders.TypeProps, 'g'), propsPlaceholder) + .replace(new RegExp(Placeholders.TypeState, 'g'), statePlaceholder); +}; -export const revertSnippetPlaceholders = (snippetString: string) => - String(snippetString) +export const revertSnippetPlaceholders = (snippetString: string) => { + return String(snippetString) .replace( new RegExp(/\${1:\${TM_FILENAME_BASE}}/, 'g'), - SnippetPlaceholders.FileName, + Placeholders.FileName, ) - .replace(new RegExp(/\${1:first}/, 'g'), SnippetPlaceholders.FirstTab) - .replace(new RegExp(/\${2:second}/, 'g'), SnippetPlaceholders.SecondTab) - .replace(new RegExp(/\${3:third}/, 'g'), SnippetPlaceholders.ThirdTab) - .replace(new RegExp(/\$0/, 'g'), SnippetPlaceholders.LastTab); + .replace(new RegExp(/\${1:first}/, 'g'), Placeholders.FirstTab) + .replace(new RegExp(/\${2:second}/, 'g'), Placeholders.SecondTab) + .replace(new RegExp(/\${3:third}/, 'g'), Placeholders.ThirdTab) + .replace(new RegExp(/\$0/, 'g'), Placeholders.LastTab) + .replace( + new RegExp(/\${1\/(.*)\/${1:\/capitalize}\/}/, 'g'), + Placeholders.Capitalize, + ); +}; export const parseSnippet = (body: string | string[]) => { const snippetBody = typeof body === 'string' ? body : body.join('\n'); diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 20df213..7be8183 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -263,8 +263,6 @@ "key": "reactArrowFunctionComponent", "prefix": "rafc", "body": [ - "import React from 'react';", - "", "export const ${1:${TM_FILENAME_BASE}} = () => {", " return

$0
;", "};", @@ -277,7 +275,6 @@ "key": "reactArrowFunctionComponentWithPropTypes", "prefix": "rafcp", "body": [ - "import React from 'react';", "import PropTypes from 'prop-types';", "", "const ${1:${TM_FILENAME_BASE}} = (props) => {", @@ -296,8 +293,6 @@ "key": "reactArrowFunctionExportComponent", "prefix": "rafce", "body": [ - "import React from 'react';", - "", "const ${1:${TM_FILENAME_BASE}} = () => {", " return
$0
;", "};", @@ -525,8 +520,6 @@ "key": "reactFunctionalComponent", "prefix": "rfc", "body": [ - "import React from 'react';", - "", "export default function ${1:${TM_FILENAME_BASE}}() {", " return
$0
;", "}", @@ -586,7 +579,6 @@ "key": "reactFunctionalComponentWithPropTypes", "prefix": "rfcp", "body": [ - "import React from 'react';", "import PropTypes from 'prop-types';", "", "function ${1:${TM_FILENAME_BASE}}(props) {", @@ -605,8 +597,6 @@ "key": "reactFunctionalExportComponent", "prefix": "rfce", "body": [ - "import React from 'react';", - "", "function ${1:${TM_FILENAME_BASE}}() {", " return
$0
;", "}", @@ -799,7 +789,7 @@ "useState": { "key": "useState", "prefix": "useStateSnippet", - "body": "const [${1:first}, set${1:first}] = useState(${2:second});", + "body": "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second});", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importAs": { @@ -1230,7 +1220,6 @@ "prefix": "rnf", "body": [ "import { View, Text } from 'react-native';", - "import React from 'react';", "", "export default function ${1:${TM_FILENAME_BASE}}() {", " return (", @@ -1248,7 +1237,6 @@ "prefix": "rnfs", "body": [ "import { StyleSheet, Text, View } from 'react-native';", - "import React from 'react';", "", "export default function ${1:${TM_FILENAME_BASE}}() {", " return (", @@ -1268,7 +1256,6 @@ "prefix": "rnfe", "body": [ "import { View, Text } from 'react-native';", - "import React from 'react';", "", "const ${1:${TM_FILENAME_BASE}} = () => {", " return (", @@ -1288,7 +1275,6 @@ "prefix": "rnfes", "body": [ "import { StyleSheet, Text, View } from 'react-native';", - "import React from 'react';", "", "const ${1:${TM_FILENAME_BASE}} = () => {", " return (", @@ -1470,7 +1456,6 @@ "key": "setupReactComponentTestWithRedux", "prefix": "srtest", "body": [ - "import React from 'react';", "import renderer from 'react-test-renderer';", "import { Provider } from 'react-redux';", "", @@ -1499,7 +1484,7 @@ "prefix": "sntest", "body": [ "import 'react-native';", - "import React from 'react';", + "", "import renderer from 'react-test-renderer';", "", "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}';", @@ -1521,7 +1506,7 @@ "prefix": "snrtest", "body": [ "import 'react-native';", - "import React from 'react';", + "", "import renderer from 'react-test-renderer';", "import { Provider } from 'react-redux';", "", @@ -1548,7 +1533,6 @@ "key": "setupReactTest", "prefix": "stest", "body": [ - "import React from 'react';", "import renderer from 'react-test-renderer';", "", "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}';", @@ -1856,7 +1840,6 @@ "key": "hocComponentWithRedux", "prefix": "hocredux", "body": [ - "import React from 'react';", "import { connect } from 'react-redux';", "import PropTypes from 'prop-types';", "", @@ -1882,7 +1865,6 @@ "key": "hocComponent", "prefix": "hoc", "body": [ - "import React from 'react';", "import PropTypes from 'prop-types';", "", "export default (WrappedComponent) => {", diff --git a/src/sourceSnippets/components.ts b/src/sourceSnippets/components.ts index 778914e..a67fc0f 100644 --- a/src/sourceSnippets/components.ts +++ b/src/sourceSnippets/components.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; import { exportDefault, @@ -43,7 +43,7 @@ const reactClassComponent: ComponentsSnippet = { prefix: 'rcc', body: [ ...reactComponent, - `export default class ${SnippetPlaceholders.FileName} extends Component {`, + `export default class ${Placeholders.FileName} extends Component {`, ...innerComponentReturn, '}', '', @@ -56,7 +56,7 @@ const reactClassExportComponent: ComponentsSnippet = { prefix: 'rce', body: [ ...reactComponent, - `export class ${SnippetPlaceholders.FileName} extends Component {`, + `export class ${Placeholders.FileName} extends Component {`, ...innerComponentReturn, '}', ...exportDefault, @@ -69,7 +69,7 @@ const reactFunctionalExportComponent: ComponentsSnippet = { prefix: 'rfce', body: [ ...react, - `function ${SnippetPlaceholders.FileName}() {`, + `function ${Placeholders.FileName}() {`, ...innerComponent, '}', ...exportDefault, @@ -82,7 +82,7 @@ const reactFunctionalComponent: ComponentsSnippet = { prefix: 'rfc', body: [ ...react, - `export default function ${SnippetPlaceholders.FileName}() {`, + `export default function ${Placeholders.FileName}() {`, ...innerComponent, '}', '', @@ -95,11 +95,11 @@ const reactFunctionalComponentWithPropTypes: ComponentsSnippet = { prefix: 'rfcp', body: [ ...reactPropTypes, - `function ${SnippetPlaceholders.FileName}(props) {`, + `function ${Placeholders.FileName}(props) {`, ...innerComponent, '}', '', - `${SnippetPlaceholders.FileName}.propTypes = {}`, + `${Placeholders.FileName}.propTypes = {}`, ...exportDefault, '', ], @@ -112,7 +112,7 @@ const reactArrowFunctionExportComponent: ComponentsSnippet = { prefix: 'rafce', body: [ ...react, - `const ${SnippetPlaceholders.FileName} = () => {`, + `const ${Placeholders.FileName} = () => {`, ...innerComponent, '}', ...exportDefault, @@ -126,7 +126,7 @@ const reactArrowFunctionComponent: ComponentsSnippet = { prefix: 'rafc', body: [ ...react, - `export const ${SnippetPlaceholders.FileName} = () => {`, + `export const ${Placeholders.FileName} = () => {`, ...innerComponent, '}', '', @@ -140,11 +140,11 @@ const reactArrowFunctionComponentWithPropTypes: ComponentsSnippet = { prefix: 'rafcp', body: [ ...reactPropTypes, - `const ${SnippetPlaceholders.FileName} = props => {`, + `const ${Placeholders.FileName} = props => {`, ...innerComponent, '}', '', - `${SnippetPlaceholders.FileName}.propTypes = {}`, + `${Placeholders.FileName}.propTypes = {}`, ...exportDefault, ], description: @@ -157,7 +157,7 @@ const reactClassExportComponentWithPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactComponent, - `export class ${SnippetPlaceholders.FileName} extends Component {`, + `export class ${Placeholders.FileName} extends Component {`, ' static propTypes = {}', '', ...innerComponentReturn, @@ -172,7 +172,7 @@ const reactClassPureComponent: ComponentsSnippet = { prefix: 'rpc', body: [ ...reactPureComponent, - `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + `export default class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, '}', '', @@ -185,7 +185,7 @@ const reactClassExportPureComponent: ComponentsSnippet = { prefix: 'rpce', body: [ ...reactPureComponent, - `export class ${SnippetPlaceholders.FileName} extends PureComponent {`, + `export class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, '}', ...exportDefault, @@ -200,7 +200,7 @@ const reactClassPureComponentWithPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactPureComponent, - `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + `export default class ${Placeholders.FileName} extends PureComponent {`, ' static propTypes = {}', '', ...innerComponentReturn, @@ -216,7 +216,7 @@ const reactFunctionMemoComponent: ComponentsSnippet = { body: [ "import React, { memo } from 'react'", '', - `export default memo(function ${SnippetPlaceholders.FileName}() {`, + `export default memo(function ${Placeholders.FileName}() {`, ...innerComponent, '})', '', @@ -230,11 +230,11 @@ const reactFunctionMemoComponentWithPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactWithMemo, - `const ${SnippetPlaceholders.FileName} = memo(function ${SnippetPlaceholders.FileName}(props) {`, + `const ${Placeholders.FileName} = memo(function ${Placeholders.FileName}(props) {`, ...innerComponent, '})', '', - `${SnippetPlaceholders.FileName}.propTypes = {}`, + `${Placeholders.FileName}.propTypes = {}`, ...exportDefault, ], description: @@ -247,9 +247,9 @@ const reactClassComponentPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactComponent, - `export default class ${SnippetPlaceholders.FileName} extends Component {`, + `export default class ${Placeholders.FileName} extends Component {`, ' static propTypes = {', - ` ${SnippetPlaceholders.SecondTab}: ${SnippetPlaceholders.ThirdTab}`, + ` ${Placeholders.SecondTab}: ${Placeholders.ThirdTab}`, ' }', '', ...innerComponentReturn, @@ -265,7 +265,7 @@ const reactClassComponentRedux: ComponentsSnippet = { prefix: 'rcredux', body: [ ...reactComponentWithReduxConnect, - `export class ${SnippetPlaceholders.FileName} extends Component {`, + `export class ${Placeholders.FileName} extends Component {`, ...innerComponentReturn, '}', ...reduxComponentExport, @@ -280,9 +280,9 @@ const reactClassComponentReduxPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactComponentWithReduxConnect, - `export class ${SnippetPlaceholders.FileName} extends Component {`, + `export class ${Placeholders.FileName} extends Component {`, ' static propTypes = {', - ` ${SnippetPlaceholders.SecondTab}: ${SnippetPlaceholders.ThirdTab}`, + ` ${Placeholders.SecondTab}: ${Placeholders.ThirdTab}`, ' }', '', ...innerComponentReturn, @@ -298,7 +298,7 @@ const reactFunctionalComponentRedux: ComponentsSnippet = { prefix: 'rfcredux', body: [ ...reactWithReduxConnect, - `export const ${SnippetPlaceholders.FileName} = (props) => {`, + `export const ${Placeholders.FileName} = (props) => {`, ...innerComponent, '}', ...reduxComponentExport, @@ -313,12 +313,12 @@ const reactFunctionalComponentReduxPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactWithReduxConnect, - `export const ${SnippetPlaceholders.FileName} = (props) => {`, + `export const ${Placeholders.FileName} = (props) => {`, ...innerComponent, '}', '', - `${SnippetPlaceholders.FileName}.propTypes = {`, - ` ${SnippetPlaceholders.SecondTab}: PropTypes.${SnippetPlaceholders.ThirdTab}`, + `${Placeholders.FileName}.propTypes = {`, + ` ${Placeholders.SecondTab}: PropTypes.${Placeholders.ThirdTab}`, '}', ...reduxComponentExport, ], diff --git a/src/sourceSnippets/console.ts b/src/sourceSnippets/console.ts index bb243a3..30fc540 100644 --- a/src/sourceSnippets/console.ts +++ b/src/sourceSnippets/console.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; type ConsoleMapping = { consoleAssert: 'cas'; @@ -23,9 +23,7 @@ export type ConsoleSnippet = SnippetMapping; const consoleAssert: ConsoleSnippet = { key: 'consoleAssert', prefix: 'cas', - body: [ - `console.assert(${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab})`, - ], + body: [`console.assert(${Placeholders.FirstTab}, ${Placeholders.SecondTab})`], description: 'If the specified expression is false, the message is written to the console along with a stack trace', }; @@ -40,7 +38,7 @@ const consoleClear: ConsoleSnippet = { const consoleCount: ConsoleSnippet = { key: 'consoleCount', prefix: 'cco', - body: [`console.count(${SnippetPlaceholders.FirstTab})`], + body: [`console.count(${Placeholders.FirstTab})`], description: 'Writes the the number of times that count() has been invoked at the same line and with the same label', }; @@ -48,14 +46,14 @@ const consoleCount: ConsoleSnippet = { const consoleDir: ConsoleSnippet = { key: 'consoleDir', prefix: 'cdi', - body: [`console.dir(${SnippetPlaceholders.FirstTab})`], + body: [`console.dir(${Placeholders.FirstTab})`], description: 'Prints a JavaScript representation of the specified object', }; const consoleError: ConsoleSnippet = { key: 'consoleError', prefix: 'cer', - body: [`console.error(${SnippetPlaceholders.FirstTab})`], + body: [`console.error(${Placeholders.FirstTab})`], description: 'Displays a message in the console and also includes a stack trace from where the method was called', }; @@ -63,7 +61,7 @@ const consoleError: ConsoleSnippet = { const consoleGroup: ConsoleSnippet = { key: 'consoleGroup', prefix: 'cgr', - body: [`console.group('${SnippetPlaceholders.FirstTab}')`], + body: [`console.group('${Placeholders.FirstTab}')`], description: 'Groups and indents all following output by an additional level, until console.groupEnd() is called.', }; @@ -78,14 +76,14 @@ const consoleGroupEnd: ConsoleSnippet = { const consoleLog: ConsoleSnippet = { key: 'consoleLog', prefix: 'clg', - body: [`console.log(${SnippetPlaceholders.FirstTab})`], + body: [`console.log(${Placeholders.FirstTab})`], description: 'Displays a message in the console', }; const consoleTrace: ConsoleSnippet = { key: 'consoleTrace', prefix: 'ctr', - body: [`console.trace(${SnippetPlaceholders.FirstTab})`], + body: [`console.trace(${Placeholders.FirstTab})`], description: 'Prints a stack trace from the point where the method was called', }; @@ -93,9 +91,7 @@ const consoleTrace: ConsoleSnippet = { const consoleLogObject: ConsoleSnippet = { key: 'consoleLogObject', prefix: 'clo', - body: [ - `console.log('${SnippetPlaceholders.FirstTab}', ${SnippetPlaceholders.FirstTab})`, - ], + body: [`console.log('${Placeholders.FirstTab}', ${Placeholders.FirstTab})`], description: 'Logs property with name.', }; @@ -103,7 +99,7 @@ const consoleLogJson: ConsoleSnippet = { key: 'consoleLogJson', prefix: 'clj', body: [ - `console.log('${SnippetPlaceholders.FirstTab}', JSON.stringify(${SnippetPlaceholders.FirstTab}, null, 2))`, + `console.log('${Placeholders.FirstTab}', JSON.stringify(${Placeholders.FirstTab}, null, 2))`, ], description: 'Logs stringified JSON property with name.', }; @@ -111,21 +107,21 @@ const consoleLogJson: ConsoleSnippet = { const consoleTime: ConsoleSnippet = { key: 'consoleTime', prefix: 'ctm', - body: [`console.time('${SnippetPlaceholders.FirstTab}')`], + body: [`console.time('${Placeholders.FirstTab}')`], description: 'Console time wrapper', }; const consoleTimeEnd: ConsoleSnippet = { key: 'consoleTimeEnd', prefix: 'cte', - body: [`console.timeEnd('${SnippetPlaceholders.FirstTab}')`], + body: [`console.timeEnd('${Placeholders.FirstTab}')`], description: 'Console time end wrapper', }; const consoleWarn: ConsoleSnippet = { key: 'consoleWarn', prefix: 'cwa', - body: [`console.warn(${SnippetPlaceholders.FirstTab})`], + body: [`console.warn(${Placeholders.FirstTab})`], description: 'Displays a message in the console but also displays a yellow warning icon along with the logged message', }; @@ -133,7 +129,7 @@ const consoleWarn: ConsoleSnippet = { const consoleInfo: ConsoleSnippet = { key: 'consoleInfo', prefix: 'cin', - body: [`console.info(${SnippetPlaceholders.FirstTab})`], + body: [`console.info(${Placeholders.FirstTab})`], description: 'Displays a message in the console but also displays a blue information icon along with the logged message', }; diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts index ffc689e..bdbc674 100644 --- a/src/sourceSnippets/hooks.ts +++ b/src/sourceSnippets/hooks.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; type HookMappings = { useState: 'useStateSnippet'; @@ -19,12 +19,12 @@ const useEffect: HooksSnippet = { prefix: 'useEffectSnippet', body: [ 'useEffect(() => {', - ` ${SnippetPlaceholders.FirstTab}`, + ` ${Placeholders.FirstTab}`, '', ' return () => {', - ` ${SnippetPlaceholders.SecondTab}`, + ` ${Placeholders.SecondTab}`, ' }', - `}, [${SnippetPlaceholders.ThirdTab}])`, + `}, [${Placeholders.ThirdTab}])`, '', ], }; @@ -33,7 +33,7 @@ const useContext: HooksSnippet = { key: 'useContext', prefix: 'useContextSnippet', body: [ - `const ${SnippetPlaceholders.FirstTab} = useContext(${SnippetPlaceholders.SecondTab})`, + `const ${Placeholders.FirstTab} = useContext(${Placeholders.SecondTab})`, ], }; @@ -41,7 +41,7 @@ const useState: HooksSnippet = { key: 'useState', prefix: 'useStateSnippet', body: [ - `const [${SnippetPlaceholders.FirstTab}, set${SnippetPlaceholders.FirstTab}] = useState(${SnippetPlaceholders.SecondTab})`, + `const [${Placeholders.FirstTab}, set${Placeholders.Capitalize}] = useState(${Placeholders.SecondTab})`, ], }; @@ -49,7 +49,7 @@ const useReducer: HooksSnippet = { key: 'useReducer', prefix: 'useReducerSnippet', body: [ - `const [state, dispatch] = useReducer(${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab}, ${SnippetPlaceholders.ThirdTab})`, + `const [state, dispatch] = useReducer(${Placeholders.FirstTab}, ${Placeholders.SecondTab}, ${Placeholders.ThirdTab})`, ], }; @@ -59,9 +59,9 @@ const useCallback: HooksSnippet = { body: [ 'useCallback(', ' () => {', - ` ${SnippetPlaceholders.FirstTab}`, + ` ${Placeholders.FirstTab}`, ' },', - ` [${SnippetPlaceholders.SecondTab}],`, + ` [${Placeholders.SecondTab}],`, ')', '', ], @@ -70,17 +70,13 @@ const useCallback: HooksSnippet = { const useMemo: HooksSnippet = { key: 'useMemo', prefix: 'useMemoSnippet', - body: [ - `useMemo(() => ${SnippetPlaceholders.FirstTab}, ${SnippetPlaceholders.SecondTab})`, - ], + body: [`useMemo(() => ${Placeholders.FirstTab}, ${Placeholders.SecondTab})`], }; const useRef: HooksSnippet = { key: 'useRef', prefix: 'useRefSnippet', - body: [ - `const ${SnippetPlaceholders.FirstTab} = useRef(${SnippetPlaceholders.SecondTab})`, - ], + body: [`const ${Placeholders.FirstTab} = useRef(${Placeholders.SecondTab})`], }; const useImperativeHandle: HooksSnippet = { @@ -88,11 +84,11 @@ const useImperativeHandle: HooksSnippet = { prefix: 'useImperativeHandleSnippet', body: [ 'useImperativeHandle(', - ` ${SnippetPlaceholders.FirstTab},`, + ` ${Placeholders.FirstTab},`, ' () => {', - ` ${SnippetPlaceholders.SecondTab}`, + ` ${Placeholders.SecondTab}`, ' },', - ` [${SnippetPlaceholders.ThirdTab}],`, + ` [${Placeholders.ThirdTab}],`, ')', ], }; @@ -102,11 +98,11 @@ const useLayoutEffect: HooksSnippet = { prefix: 'useLayoutEffectSnippet', body: [ 'useLayoutEffect(() => {', - ` ${SnippetPlaceholders.FirstTab}`, + ` ${Placeholders.FirstTab}`, ' return () => {', - ` ${SnippetPlaceholders.SecondTab}`, + ` ${Placeholders.SecondTab}`, ' };', - `}, [${SnippetPlaceholders.ThirdTab}])`, + `}, [${Placeholders.ThirdTab}])`, ], }; diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts index fb024a3..ba042ca 100644 --- a/src/sourceSnippets/imports.ts +++ b/src/sourceSnippets/imports.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; type ImportsMappings = { import: 'imp'; @@ -146,26 +146,23 @@ const importSnippet: ImportsSnippet = { key: 'import', prefix: 'imp', body: [ - `import ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'`, - SnippetPlaceholders.LastTab, + `import ${Placeholders.SecondTab} from '${Placeholders.FirstTab}'`, + Placeholders.LastTab, ], }; const importNoModuleName: ImportsSnippet = { key: 'importNoModuleName', prefix: 'imn', - body: [ - `import '${SnippetPlaceholders.FirstTab}'`, - SnippetPlaceholders.LastTab, - ], + body: [`import '${Placeholders.FirstTab}'`, Placeholders.LastTab], }; const importDestructing: ImportsSnippet = { key: 'importDestructing', prefix: 'imd', body: [ - `import { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'`, - SnippetPlaceholders.LastTab, + `import { ${Placeholders.SecondTab} } from '${Placeholders.FirstTab}'`, + Placeholders.LastTab, ], }; @@ -173,8 +170,8 @@ const importEverything: ImportsSnippet = { key: 'importEverything', prefix: 'ime', body: [ - `import * as ${SnippetPlaceholders.SecondTab} from '${SnippetPlaceholders.FirstTab}'`, - SnippetPlaceholders.LastTab, + `import * as ${Placeholders.SecondTab} from '${Placeholders.FirstTab}'`, + Placeholders.LastTab, ], }; @@ -182,8 +179,8 @@ const importAs: ImportsSnippet = { key: 'importAs', prefix: 'ima', body: [ - `import { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'`, - SnippetPlaceholders.LastTab, + `import { ${Placeholders.SecondTab} as ${Placeholders.ThirdTab} } from '${Placeholders.FirstTab}'`, + Placeholders.LastTab, ], }; diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts index 9fb88d1..04acde8 100644 --- a/src/sourceSnippets/others.ts +++ b/src/sourceSnippets/others.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; type OthersMapping = { commentBigBlock: 'cmmb'; @@ -48,15 +48,15 @@ export type OthersSnippet = SnippetMapping; const exportDefault: OthersSnippet = { key: 'exportDefault', prefix: 'exp', - body: [`export default ${SnippetPlaceholders.LastTab}`, ''], + body: [`export default ${Placeholders.LastTab}`, ''], }; const exportDestructing: OthersSnippet = { key: 'exportDestructing', prefix: 'exd', body: [ - `export { ${SnippetPlaceholders.SecondTab} } from '${SnippetPlaceholders.FirstTab}'`, - SnippetPlaceholders.LastTab, + `export { ${Placeholders.SecondTab} } from '${Placeholders.FirstTab}'`, + Placeholders.LastTab, ], }; @@ -64,8 +64,8 @@ const exportAs: OthersSnippet = { key: 'exportAs', prefix: 'exa', body: [ - `export { ${SnippetPlaceholders.SecondTab} as ${SnippetPlaceholders.ThirdTab} } from '${SnippetPlaceholders.FirstTab}'`, - SnippetPlaceholders.LastTab, + `export { ${Placeholders.SecondTab} as ${Placeholders.ThirdTab} } from '${Placeholders.FirstTab}'`, + Placeholders.LastTab, ], }; @@ -73,7 +73,7 @@ const exportNamedFunction: OthersSnippet = { key: 'exportNamedFunction', prefix: 'enf', body: [ - `export const ${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {${SnippetPlaceholders.LastTab}}`, + `export const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.LastTab}}`, '', ], description: 'Export named function', @@ -83,7 +83,7 @@ const exportDefaultFunction: OthersSnippet = { key: 'exportDefaultFunction', prefix: 'edf', body: [ - `export default (${SnippetPlaceholders.FirstTab}) => {${SnippetPlaceholders.LastTab}}`, + `export default (${Placeholders.FirstTab}) => {${Placeholders.LastTab}}`, '', ], description: 'Export default function', @@ -93,7 +93,7 @@ const exportDefaultNamedFunction: OthersSnippet = { key: 'exportDefaultNamedFunction', prefix: 'ednf', body: [ - `export default function ${SnippetPlaceholders.FirstTab}(${SnippetPlaceholders.SecondTab}) {${SnippetPlaceholders.LastTab}}`, + `export default function ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, '', ], description: 'Export default named function', @@ -103,7 +103,7 @@ const method: OthersSnippet = { key: 'method', prefix: 'met', body: [ - `${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {${SnippetPlaceholders.LastTab}}`, + `${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.LastTab}}`, '', ], description: 'Creates a method inside a class', @@ -113,8 +113,8 @@ const propertyGet: OthersSnippet = { key: 'propertyGet', prefix: 'pge', body: [ - `get ${SnippetPlaceholders.FirstTab}() {`, - ` return this.${SnippetPlaceholders.LastTab}`, + `get ${Placeholders.FirstTab}() {`, + ` return this.${Placeholders.LastTab}`, '}', '', ], @@ -125,7 +125,7 @@ const propertySet: OthersSnippet = { key: 'propertySet', prefix: 'pse', body: [ - `set ${SnippetPlaceholders.FirstTab}(${SnippetPlaceholders.SecondTab}) {${SnippetPlaceholders.LastTab}}`, + `set ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, '', ], description: 'Creates a setter property inside a class', @@ -135,8 +135,8 @@ const forEach: OthersSnippet = { key: 'forEach', prefix: 'fre', body: [ - `${SnippetPlaceholders.FirstTab}.forEach(${SnippetPlaceholders.SecondTab} => {`, - ` ${SnippetPlaceholders.LastTab}`, + `${Placeholders.FirstTab}.forEach(${Placeholders.SecondTab} => {`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -147,8 +147,8 @@ const forOf: OthersSnippet = { key: 'forOf', prefix: 'fof', body: [ - `for(let ${SnippetPlaceholders.FirstTab} of ${SnippetPlaceholders.SecondTab}) {`, - ` ${SnippetPlaceholders.LastTab}`, + `for(let ${Placeholders.FirstTab} of ${Placeholders.SecondTab}) {`, + ` ${Placeholders.LastTab}`, '}', '', ], @@ -159,8 +159,8 @@ const forIn: OthersSnippet = { key: 'forIn', prefix: 'fin', body: [ - `for(let ${SnippetPlaceholders.FirstTab} in ${SnippetPlaceholders.SecondTab}) {`, - ` ${SnippetPlaceholders.LastTab}`, + `for(let ${Placeholders.FirstTab} in ${Placeholders.SecondTab}) {`, + ` ${Placeholders.LastTab}`, '}', '', ], @@ -170,11 +170,7 @@ const forIn: OthersSnippet = { const anonymousFunction: OthersSnippet = { key: 'anonymousFunction', prefix: 'anfn', - body: [ - `(${SnippetPlaceholders.FirstTab}) => {`, - ` ${SnippetPlaceholders.SecondTab}`, - '}', - ], + body: [`(${Placeholders.FirstTab}) => {`, ` ${Placeholders.SecondTab}`, '}'], description: 'Creates an anonymous function', }; @@ -182,8 +178,8 @@ const namedFunction: OthersSnippet = { key: 'namedFunction', prefix: 'nfn', body: [ - `const ${SnippetPlaceholders.FirstTab} = (${SnippetPlaceholders.SecondTab}) => {`, - ` ${SnippetPlaceholders.ThirdTab}`, + `const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {`, + ` ${Placeholders.ThirdTab}`, '}', '', ], @@ -193,20 +189,14 @@ const namedFunction: OthersSnippet = { const destructingObject: OthersSnippet = { key: 'destructingObject', prefix: 'dob', - body: [ - `const {${SnippetPlaceholders.SecondTab}} = ${SnippetPlaceholders.FirstTab}`, - '', - ], + body: [`const {${Placeholders.SecondTab}} = ${Placeholders.FirstTab}`, ''], description: 'Creates and assigns a local variable using object destructing', }; const destructingArray: OthersSnippet = { key: 'destructingArray', prefix: 'dar', - body: [ - `const [${SnippetPlaceholders.SecondTab}] = ${SnippetPlaceholders.FirstTab}`, - '', - ], + body: [`const [${Placeholders.SecondTab}] = ${Placeholders.FirstTab}`, ''], description: 'Creates and assigns a local variable using array destructing', }; @@ -215,8 +205,8 @@ const setInterval: OthersSnippet = { prefix: 'sti', body: [ 'setInterval(() => {', - ` ${SnippetPlaceholders.SecondTab}`, - `}, ${SnippetPlaceholders.LastTab})`, + ` ${Placeholders.SecondTab}`, + `}, ${Placeholders.LastTab})`, '', ], description: 'Executes the given function at specified intervals', @@ -227,8 +217,8 @@ const setTimeOut: OthersSnippet = { prefix: 'sto', body: [ 'setTimeout(() => {', - ` ${SnippetPlaceholders.SecondTab}`, - `}, ${SnippetPlaceholders.FirstTab})`, + ` ${Placeholders.SecondTab}`, + `}, ${Placeholders.FirstTab})`, '', ], description: 'Executes the given function after the specified delay', @@ -239,7 +229,7 @@ const promise: OthersSnippet = { prefix: 'prom', body: [ 'return new Promise((resolve, reject) => {', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -249,14 +239,14 @@ const promise: OthersSnippet = { const destructProps: OthersSnippet = { key: 'destructProps', prefix: 'cp', - body: [`const { ${SnippetPlaceholders.LastTab} } = this.props`, ''], + body: [`const { ${Placeholders.LastTab} } = this.props`, ''], description: 'Creates and assigns a local variable using props destructing', }; const destructState: OthersSnippet = { key: 'destructState', prefix: 'cs', - body: [`const { ${SnippetPlaceholders.LastTab} } = this.state`, ''], + body: [`const { ${Placeholders.LastTab} } = this.state`, ''], description: 'Creates and assigns a local variable using state destructing', }; @@ -268,7 +258,7 @@ const classConstructor: OthersSnippet = { ' super(props)', '', ' this.state = {', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, ' }', '}', '', @@ -280,14 +270,14 @@ const classConstructor: OthersSnippet = { const emptyState: OthersSnippet = { key: 'emptyState', prefix: 'est', - body: ['state = {', ` ${SnippetPlaceholders.LastTab}`, '}', ''], + body: ['state = {', ` ${Placeholders.LastTab}`, '}', ''], description: 'Creates empty state object. To be used in a constructor.', }; const componentDidMount: OthersSnippet = { key: 'componentDidMount', prefix: 'cdm', - body: ['componentDidMount() {', ` ${SnippetPlaceholders.LastTab}`, '}', ''], + body: ['componentDidMount() {', ` ${Placeholders.LastTab}`, '}', ''], description: 'Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.', }; @@ -297,7 +287,7 @@ const shouldComponentUpdate: OthersSnippet = { prefix: 'scu', body: [ 'shouldComponentUpdate(nextProps, nextState) {', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '}', '', ], @@ -310,7 +300,7 @@ const componentDidUpdate: OthersSnippet = { prefix: 'cdup', body: [ 'componentDidUpdate(prevProps, prevState) {', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '}', '', ], @@ -321,12 +311,7 @@ const componentDidUpdate: OthersSnippet = { const componentWillUnmount: OthersSnippet = { key: 'componentWillUnmount', prefix: 'cwun', - body: [ - 'componentWillUnmount() {', - ` ${SnippetPlaceholders.LastTab}`, - '}', - '', - ], + body: ['componentWillUnmount() {', ` ${Placeholders.LastTab}`, '}', ''], description: 'Invoked immediately before a component is unmounted from the DOM.', }; @@ -336,7 +321,7 @@ const getDerivedStateFromProps: OthersSnippet = { prefix: 'gdsfp', body: [ 'static getDerivedStateFromProps(props, state) {', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '}', ], description: @@ -348,7 +333,7 @@ const getSnapshotBeforeUpdate: OthersSnippet = { prefix: 'gsbu', body: [ 'getSnapshotBeforeUpdate = (prevProps, prevState) => {', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '}', '', ], @@ -359,21 +344,21 @@ const getSnapshotBeforeUpdate: OthersSnippet = { const createContext: OthersSnippet = { key: 'createContext', prefix: 'rcontext', - body: [`const ${SnippetPlaceholders.LastTab} = React.createContext()`, ''], + body: [`const ${Placeholders.LastTab} = React.createContext()`, ''], description: 'Create React context', }; const createRef: OthersSnippet = { key: 'createRef', prefix: 'cref', - body: [`this.${SnippetPlaceholders.LastTab}Ref = React.createRef()`, ''], + body: [`this.${Placeholders.LastTab}Ref = React.createRef()`, ''], description: 'Create ref statement used inside constructor', }; const componentSetStateObject: OthersSnippet = { key: 'componentSetStateObject', prefix: 'sst', - body: [`this.setState({${SnippetPlaceholders.LastTab}})`, ''], + body: [`this.setState({${Placeholders.LastTab}})`, ''], description: 'Performs a shallow merge of nextState into current state', }; @@ -381,7 +366,7 @@ const componentSetStateFunc: OthersSnippet = { key: 'componentSetStateFunc', prefix: 'ssf', body: [ - `this.setState((state, props) => { return { ${SnippetPlaceholders.LastTab} }})`, + `this.setState((state, props) => { return { ${Placeholders.LastTab} }})`, '', ], description: 'Performs a shallow merge of nextState into current state', @@ -390,21 +375,21 @@ const componentSetStateFunc: OthersSnippet = { const componentProps: OthersSnippet = { key: 'componentProps', prefix: 'props', - body: [`this.props.${SnippetPlaceholders.LastTab}`, ''], + body: [`this.props.${Placeholders.LastTab}`, ''], description: "Access component's props", }; const componentState: OthersSnippet = { key: 'componentState', prefix: 'state', - body: [`this.state.${SnippetPlaceholders.LastTab}`, ''], + body: [`this.state.${Placeholders.LastTab}`, ''], }; const bindThis: OthersSnippet = { key: 'bindThis', prefix: 'bnd', body: [ - `this.${SnippetPlaceholders.FirstTab} = this.${SnippetPlaceholders.FirstTab}.bind(this)`, + `this.${Placeholders.FirstTab} = this.${Placeholders.FirstTab}.bind(this)`, '', ], description: 'Binds this to a method', @@ -413,7 +398,7 @@ const bindThis: OthersSnippet = { const commentBigBlock: OthersSnippet = { key: 'commentBigBlock', prefix: 'cmmb', - body: ['/**', ` * ${SnippetPlaceholders.LastTab}`, ' */'], + body: ['/**', ` * ${Placeholders.LastTab}`, ' */'], }; const hocComponentWithRedux: OthersSnippet = { @@ -428,7 +413,7 @@ const hocComponentWithRedux: OthersSnippet = { '', 'export const mapDispatchToProps = {}', '', - `export const ${SnippetPlaceholders.FirstTab} = (WrappedComponent) => {`, + `export const ${Placeholders.FirstTab} = (WrappedComponent) => {`, ' const hocComponent = ({ ...props }) => ', '', ' hocComponent.propTypes = {}', @@ -436,7 +421,7 @@ const hocComponentWithRedux: OthersSnippet = { ' return hocComponent', '}', '', - `export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FirstTab}(WrapperComponent))`, + `export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${Placeholders.FirstTab}(WrapperComponent))`, '', ], }; @@ -462,7 +447,7 @@ const hocComponent: OthersSnippet = { const typeofSnippet: OthersSnippet = { key: 'typeofSnippet', prefix: 'tpf', - body: [`typeof ${SnippetPlaceholders.LastTab}`], + body: [`typeof ${Placeholders.LastTab}`], }; export default [ diff --git a/src/sourceSnippets/reactNative.ts b/src/sourceSnippets/reactNative.ts index 03dc035..d881900 100644 --- a/src/sourceSnippets/reactNative.ts +++ b/src/sourceSnippets/reactNative.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; import { exportDefault, @@ -28,7 +28,7 @@ const reactNativeComponentReturn = [ ' render() {', ' return (', ' ', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, ' ', ' )', ' }', @@ -45,7 +45,7 @@ const reactNativeReturn = [ const reactNativeImport: ReactNativeSnippet = { key: 'reactNativeImport', prefix: 'imrn', - body: [`import { ${SnippetPlaceholders.LastTab} } from 'react-native'`, ''], + body: [`import { ${Placeholders.LastTab} } from 'react-native'`, ''], }; const reactNativeStyles: ReactNativeSnippet = { @@ -53,7 +53,7 @@ const reactNativeStyles: ReactNativeSnippet = { prefix: 'rnstyle', body: [ 'const styles = StyleSheet.create({', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -65,7 +65,7 @@ const reactNativeComponent: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactComponent, - `export default class ${SnippetPlaceholders.FileName} extends Component {`, + `export default class ${Placeholders.FileName} extends Component {`, ...reactNativeComponentReturn, '}', '', @@ -78,7 +78,7 @@ const reactNativeComponentWithStyles: ReactNativeSnippet = { body: [ "import { Text, StyleSheet, View } from 'react-native'", ...reactComponent, - `export default class ${SnippetPlaceholders.FileName} extends Component {`, + `export default class ${Placeholders.FileName} extends Component {`, ...reactNativeComponentReturn, '}', '', @@ -92,7 +92,7 @@ const reactNativeComponentExport: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactComponent, - `export class ${SnippetPlaceholders.FileName} extends Component {`, + `export class ${Placeholders.FileName} extends Component {`, ...reactNativeComponentReturn, '}', ...exportDefault, @@ -105,7 +105,7 @@ const reactNativePureComponent: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactPureComponent, - `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + `export default class ${Placeholders.FileName} extends PureComponent {`, ...reactNativeComponentReturn, '}', '', @@ -118,7 +118,7 @@ const reactNativePureComponentExport: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactPureComponent, - `export class ${SnippetPlaceholders.FileName} extends PureComponent {`, + `export class ${Placeholders.FileName} extends PureComponent {`, ...reactNativeComponentReturn, '}', ...exportDefault, @@ -131,7 +131,7 @@ const reactNativeFunctionalExportComponent: ReactNativeSnippet = { body: [ "import { View, Text } from 'react-native'", ...react, - `const ${SnippetPlaceholders.FileName} = () => {`, + `const ${Placeholders.FileName} = () => {`, ...reactNativeReturn, '}', ...exportDefault, @@ -144,7 +144,7 @@ const reactNativeFunctionalExportComponentWithStyles: ReactNativeSnippet = { body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, - `const ${SnippetPlaceholders.FileName} = () => {`, + `const ${Placeholders.FileName} = () => {`, ...reactNativeReturn, '}', ...exportDefault, @@ -159,7 +159,7 @@ const reactNativeFunctionalComponent: ReactNativeSnippet = { body: [ "import { View, Text } from 'react-native'", ...react, - `export default function ${SnippetPlaceholders.FileName}() {`, + `export default function ${Placeholders.FileName}() {`, ...reactNativeReturn, '}', '', @@ -172,7 +172,7 @@ const reactNativeFunctionalComponentWithStyles: ReactNativeSnippet = { body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, - `export default function ${SnippetPlaceholders.FileName}() {`, + `export default function ${Placeholders.FileName}() {`, ...reactNativeReturn, '}', '', diff --git a/src/sourceSnippets/redux.ts b/src/sourceSnippets/redux.ts index c39a691..c77b148 100644 --- a/src/sourceSnippets/redux.ts +++ b/src/sourceSnippets/redux.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; type HookMappings = { importReduxConnect: 'redux'; @@ -22,8 +22,8 @@ const reduxAction: ReduxSnippet = { key: 'reduxAction', prefix: 'rxaction', body: [ - `export const ${SnippetPlaceholders.FirstTab} = (payload) => ({`, - ` type: ${SnippetPlaceholders.SecondTab},`, + `export const ${Placeholders.FirstTab} = (payload) => ({`, + ` type: ${Placeholders.SecondTab},`, ' payload', '})', '', @@ -33,9 +33,7 @@ const reduxAction: ReduxSnippet = { const reduxConst: ReduxSnippet = { key: 'reduxConst', prefix: 'rxconst', - body: [ - `export const ${SnippetPlaceholders.FirstTab} = '${SnippetPlaceholders.FirstTab}'`, - ], + body: [`export const ${Placeholders.FirstTab} = '${Placeholders.FirstTab}'`], }; const reduxReducer: ReduxSnippet = { @@ -47,7 +45,7 @@ const reduxReducer: ReduxSnippet = { 'export default (state = initialState, { type, payload }) => {', ' switch (type) {', '', - ` case ${SnippetPlaceholders.FirstTab}:`, + ` case ${Placeholders.FirstTab}:`, ' return { ...state, ...payload }', '', ' default:', @@ -64,7 +62,7 @@ const reduxSelector: ReduxSnippet = { body: [ "import { createSelector } from 'reselect'", '', - `export const ${SnippetPlaceholders.FirstTab} = state => state.${SnippetPlaceholders.SecondTab}`, + `export const ${Placeholders.FirstTab} = state => state.${Placeholders.SecondTab}`, '', ], }; @@ -79,15 +77,15 @@ const reduxSlice: ReduxSnippet = { '', '}', '', - `const ${SnippetPlaceholders.FileName} = createSlice({`, - ` name: ${SnippetPlaceholders.SecondTab},`, + `const ${Placeholders.FileName} = createSlice({`, + ` name: ${Placeholders.SecondTab},`, ' initialState,', ' reducers: {}', '});', '', - `export const {} = ${SnippetPlaceholders.FileName}.actions`, + `export const {} = ${Placeholders.FileName}.actions`, '', - `export default ${SnippetPlaceholders.FileName}.reducer`, + `export default ${Placeholders.FileName}.reducer`, ], }; diff --git a/src/sourceSnippets/sharedSnippets.ts b/src/sourceSnippets/sharedSnippets.ts index 1240915..3f9e367 100644 --- a/src/sourceSnippets/sharedSnippets.ts +++ b/src/sourceSnippets/sharedSnippets.ts @@ -1,5 +1,4 @@ -import { extensionConfig } from '../helpers'; -import { SnippetPlaceholders } from '../types'; +import { Placeholders } from '../types'; export const reactComponent = ["import React, { Component } from 'react'", '']; export const react = ["import React from 'react'", '']; @@ -33,14 +32,14 @@ export const reduxComponentExport = [ '', 'const mapDispatchToProps = {}', '', - `export default connect(mapStateToProps, mapDispatchToProps)(${SnippetPlaceholders.FileName})`, + `export default connect(mapStateToProps, mapDispatchToProps)(${Placeholders.FileName})`, '', ]; export const innerComponent = [ ' return (', '
', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '
', ' )', ]; @@ -49,7 +48,7 @@ export const innerComponentReturn = [ ' render() {', ' return (', '
', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, '
', ' )', ' }', @@ -57,19 +56,12 @@ export const innerComponentReturn = [ export const exportDefault = [ '', - `export default ${SnippetPlaceholders.FileName}`, + `export default ${Placeholders.FileName}`, '', ]; -const typeInterfacePrefix = (name: string) => { - const { typescriptComponentPropsStatePrefix } = extensionConfig(); - return typescriptComponentPropsStatePrefix === 'type' - ? `type ${name} =` - : `interface ${name} {`; -}; - -export const propsTypeInterface = [`${typeInterfacePrefix('Props')} {}`, '']; -export const stateTypeInterface = [`${typeInterfacePrefix('State')} {}`, '']; +export const propsTypeInterface = [Placeholders.TypeProps, '']; +export const stateTypeInterface = [Placeholders.TypeState, '']; export const propsStateInterface = [ ...propsTypeInterface, ...stateTypeInterface, diff --git a/src/sourceSnippets/tests.ts b/src/sourceSnippets/tests.ts index bbee965..1a9612c 100644 --- a/src/sourceSnippets/tests.ts +++ b/src/sourceSnippets/tests.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; type TestMapping = { describeBlock: 'desc'; @@ -18,8 +18,8 @@ const describeBlock: TestsSnippet = { key: 'describeBlock', prefix: 'desc', body: [ - `describe('${SnippetPlaceholders.FirstTab}', () => {`, - ` ${SnippetPlaceholders.LastTab}`, + `describe('${Placeholders.FirstTab}', () => {`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -29,8 +29,8 @@ const testBlock: TestsSnippet = { key: 'testBlock', prefix: 'test', body: [ - `test('should ${SnippetPlaceholders.FirstTab}', () => {`, - ` ${SnippetPlaceholders.LastTab}`, + `test('should ${Placeholders.FirstTab}', () => {`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -40,8 +40,8 @@ const testAsyncBlock: TestsSnippet = { key: 'testAsyncBlock', prefix: 'testa', body: [ - `test('should ${SnippetPlaceholders.FirstTab}', async () => {`, - ` ${SnippetPlaceholders.LastTab}`, + `test('should ${Placeholders.FirstTab}', async () => {`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -51,8 +51,8 @@ const itBlock: TestsSnippet = { key: 'itBlock', prefix: 'tit', body: [ - `it('should ${SnippetPlaceholders.FirstTab}', () => {`, - ` ${SnippetPlaceholders.LastTab}`, + `it('should ${Placeholders.FirstTab}', () => {`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -62,8 +62,8 @@ const itAsyncBlock: TestsSnippet = { key: 'itAsyncBlock', prefix: 'tita', body: [ - `it('should ${SnippetPlaceholders.FirstTab}', async () => {`, - ` ${SnippetPlaceholders.LastTab}`, + `it('should ${Placeholders.FirstTab}', async () => {`, + ` ${Placeholders.LastTab}`, '})', '', ], @@ -76,11 +76,11 @@ const setupReactTest: TestsSnippet = { "import React from 'react'", "import renderer from 'react-test-renderer'", '', - `import { ${SnippetPlaceholders.FileName} } from '../${SnippetPlaceholders.FileName}'`, + `import { ${Placeholders.FileName} } from '../${Placeholders.FileName}'`, '', - `describe('<${SnippetPlaceholders.FileName} />', () => {`, + `describe('<${Placeholders.FileName} />', () => {`, ' const defaultProps = {}', - ` const wrapper = renderer.create(<${SnippetPlaceholders.FileName} {...defaultProps} />)`, + ` const wrapper = renderer.create(<${Placeholders.FileName} {...defaultProps} />)`, '', " test('render', () => {", ' expect(wrapper).toMatchSnapshot()', @@ -97,11 +97,11 @@ const setupReactNativeTest: TestsSnippet = { "import React from 'react'", "import renderer from 'react-test-renderer'", '', - `import ${SnippetPlaceholders.FileName} from '../${SnippetPlaceholders.FileName}'`, + `import ${Placeholders.FileName} from '../${Placeholders.FileName}'`, '', - `describe('<${SnippetPlaceholders.FileName} />', () => {`, + `describe('<${Placeholders.FileName} />', () => {`, ' const defaultProps = {}', - ` const wrapper = renderer.create(<${SnippetPlaceholders.FileName} {...defaultProps} />)`, + ` const wrapper = renderer.create(<${Placeholders.FileName} {...defaultProps} />)`, '', " test('render', () => {", ' expect(wrapper).toMatchSnapshot()', @@ -119,13 +119,13 @@ const setupReactComponentTestWithRedux: TestsSnippet = { "import { Provider } from 'react-redux'", '', "import store from '~/store'", - `import { ${SnippetPlaceholders.FileName} } from '../${SnippetPlaceholders.FileName}'`, + `import { ${Placeholders.FileName} } from '../${Placeholders.FileName}'`, '', - `describe('<${SnippetPlaceholders.FileName} />', () => {`, + `describe('<${Placeholders.FileName} />', () => {`, ' const defaultProps = {}', ' const wrapper = renderer.create(', ' ', - ` <${SnippetPlaceholders.FileName} {...defaultProps} />`, + ` <${Placeholders.FileName} {...defaultProps} />`, ' ,', ' )', '', @@ -147,13 +147,13 @@ const setupReactNativeTestWithRedux: TestsSnippet = { "import { Provider } from 'react-redux'", '', "import store from '~/store'", - `import ${SnippetPlaceholders.FileName} from '../${SnippetPlaceholders.FileName}'`, + `import ${Placeholders.FileName} from '../${Placeholders.FileName}'`, '', - `describe('<${SnippetPlaceholders.FileName} />', () => {`, + `describe('<${Placeholders.FileName} />', () => {`, ' const defaultProps = {}', ' const wrapper = renderer.create(', ' ', - ` <${SnippetPlaceholders.FileName} {...defaultProps} />`, + ` <${Placeholders.FileName} {...defaultProps} />`, ' ,', ' )', '', diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts index f91219e..cfa07d3 100644 --- a/src/sourceSnippets/typescript.ts +++ b/src/sourceSnippets/typescript.ts @@ -1,4 +1,4 @@ -import { SnippetMapping, SnippetPlaceholders } from '../types'; +import { Placeholders, SnippetMapping } from '../types'; import { exportDefault, @@ -33,9 +33,7 @@ type TypescriptMappings = { export type TypescriptSnippet = SnippetMapping; const exportType: TypescriptSnippet = { - body: [ - `export type ${SnippetPlaceholders.FirstTab} = {${SnippetPlaceholders.LastTab}}`, - ], + body: [`export type ${Placeholders.FirstTab} = {${Placeholders.LastTab}}`], key: 'exportType', prefix: 'exptp', }; @@ -44,7 +42,7 @@ const exportInterface: TypescriptSnippet = { key: 'exportInterface', prefix: 'expint', body: [ - `export interface ${SnippetPlaceholders.FirstTab} {${SnippetPlaceholders.LastTab}}`, + `export interface ${Placeholders.FirstTab} {${Placeholders.LastTab}}`, '', ], }; @@ -57,7 +55,7 @@ const typescriptReactClassComponent: TypescriptSnippet = { body: [ ...reactComponent, ...propsStateInterface, - `export default class ${SnippetPlaceholders.FileName} extends Component {`, + `export default class ${Placeholders.FileName} extends Component {`, ' state = {}', '', ...innerComponentReturn, @@ -72,7 +70,7 @@ const typescriptReactClassExportComponent: TypescriptSnippet = { body: [ ...reactComponent, ...propsStateInterface, - `class ${SnippetPlaceholders.FileName} extends Component {`, + `class ${Placeholders.FileName} extends Component {`, ' state = {}', '', ...innerComponentReturn, @@ -89,7 +87,7 @@ const typescriptReactFunctionalExportComponent: TypescriptSnippet = { body: [ ...react, ...propsTypeInterface, - `function ${SnippetPlaceholders.FileName}({}: Props) {`, + `function ${Placeholders.FileName}({}: Props) {`, ...innerComponent, '}', ...exportDefault, @@ -104,7 +102,7 @@ const typescriptReactFunctionalComponent: TypescriptSnippet = { body: [ ...react, ...propsTypeInterface, - `export default function ${SnippetPlaceholders.FileName}({}: Props) {`, + `export default function ${Placeholders.FileName}({}: Props) {`, ...innerComponent, '}', '', @@ -119,7 +117,7 @@ const typescriptReactArrowFunctionExportComponent: TypescriptSnippet = { body: [ ...react, ...propsTypeInterface, - `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + `const ${Placeholders.FileName} = (props: Props) => {`, ...innerComponent, '}', ...exportDefault, @@ -134,7 +132,7 @@ const typescriptReactArrowFunctionComponent: TypescriptSnippet = { body: [ ...react, ...propsTypeInterface, - `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + `const ${Placeholders.FileName} = (props: Props) => {`, ...innerComponent, '}', '', @@ -149,7 +147,7 @@ const typescriptReactClassPureComponent: TypescriptSnippet = { body: [ ...reactPureComponent, ...propsTypeInterface, - `export default class ${SnippetPlaceholders.FileName} extends PureComponent {`, + `export default class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, '}', '', @@ -164,7 +162,7 @@ const typescriptReactClassExportPureComponent: TypescriptSnippet = { body: [ ...reactPureComponent, ...propsTypeInterface, - `class ${SnippetPlaceholders.FileName} extends PureComponent {`, + `class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, '}', ...exportDefault, @@ -180,7 +178,7 @@ const typescriptReactClassComponentRedux: TypescriptSnippet = { "import { connect } from 'react-redux'", ...reactComponent, ...propsStateInterface, - `export class ${SnippetPlaceholders.FileName} extends Component {`, + `export class ${Placeholders.FileName} extends Component {`, ' state = {}', '', ...innerComponentReturn, @@ -198,10 +196,10 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = { "import { View, Text } from 'react-native'", ...react, ...propsTypeInterface, - `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + `const ${Placeholders.FileName} = (props: Props) => {`, ' return (', ' ', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, ' ', ' )', '}', @@ -219,10 +217,10 @@ const typescriptReactNativeArrowFunctionComponentNamedProps: TypescriptSnippet = "import { View } from 'react-native'", ...react, ...propsTypeInterface, - `const ${SnippetPlaceholders.FileName}: React.FC<${SnippetPlaceholders.FileName}Props> = (props) => {`, + `const ${Placeholders.FileName}: React.FC<${Placeholders.FileName}Props> = (props) => {`, ' return (', ' ', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, ' ', ' )', '}', @@ -240,10 +238,10 @@ const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = "import { StyleSheet, Text, View } from 'react-native'", ...react, ...propsTypeInterface, - `const ${SnippetPlaceholders.FileName} = (props: Props) => {`, + `const ${Placeholders.FileName} = (props: Props) => {`, ' return (', ' ', - ` ${SnippetPlaceholders.LastTab}`, + ` ${Placeholders.LastTab}`, ' ', ' )', '}', diff --git a/src/types.ts b/src/types.ts index 126dc4e..7d48458 100644 --- a/src/types.ts +++ b/src/types.ts @@ -5,10 +5,26 @@ export type SnippetMapping = { description?: string; }; -export enum SnippetPlaceholders { - FileName = 'FILE_NAME', - FirstTab = 'FIRST_TAB', - SecondTab = 'SECOND_TAB', - ThirdTab = 'THIRD_TAB', - LastTab = 'LAST_TAB', -} +export const Placeholders = { + FileName: 'FILE_NAME', + FirstTab: 'FIRST_TAB', + SecondTab: 'SECOND_TAB', + ThirdTab: 'THIRD_TAB', + LastTab: 'LAST_TAB', + Capitalize: 'CAPITALIZE', + TypeProps: 'TYPE_PROPS', + TypeState: 'TYPE_STATE', +} as const; + +export const Mappings = { + FileName: '${1:${TM_FILENAME_BASE}}', + FirstTab: '${1:first}', + SecondTab: '${2:second}', + ThirdTab: '${3:third}', + LastTab: '$0', + Capitalize: '${1/(.*)/${1:/capitalize}/}', + TypeProps: 'type Props = {}', + TypeState: 'type State = {}', + InterfaceProps: 'interface Props {}', + InterfaceState: 'interface State {}', +} as const; From 85ef897c22715a1f5e1c67559f2ceff7ba914c11 Mon Sep 17 00:00:00 2001 From: SallesCosta Date: Sun, 30 Jan 2022 10:05:19 +0100 Subject: [PATCH 092/110] command for Packer --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 7391cc4..726bb92 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,20 @@ Note: This example uses `vim-plug` as a package manager, feel free to use some o
+### Packer + +For use with packer the syntax is a little different. Just add in your `init.vim` or `init.lua`: + +```shell +use {'dsznajder/vscode-es7-javascript-react-snippets', +run = 'yarn install --frozen-lockfile && yarn compile' +} +``` + +When saving the file, the update will be done ( `:w` ) + +
+ ## Search command You can search through snippets with `ES7 snippet search` command which can be run with `CMD + Shift + P` or just use `CMD + Shift + R` (`CTRL + ALT + R` for Windows & Linux) keybinding. From 03f0f622cf2ee660e3bb783351ef7d361d469d12 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 00:33:37 +0100 Subject: [PATCH 093/110] fix: a lot of stuff related to prettier auto formatting --- .eslintrc.js | 6 +- package.json | 2 +- src/helpers.ts | 158 -- src/helpers/extensionConfig.ts | 19 + src/helpers/formatters.ts | 22 + src/{ => helpers}/generateSnippets.ts | 49 +- src/helpers/getPrettierConfig.ts | 23 + src/helpers/parseSnippetToBody.ts | 56 + src/helpers/replaceOrRemoveReactImport.ts | 16 + src/helpers/revertSnippetPlaceholders.ts | 0 src/helpers/snippetPlaceholders.ts | 45 + src/{ => helpers}/snippetSearch.ts | 5 +- src/index.ts | 4 +- src/snippets/generated.json | 1888 +-------------------- src/sourceSnippets/imports.ts | 32 +- src/sourceSnippets/others.ts | 84 +- src/sourceSnippets/reactNative.ts | 23 +- src/sourceSnippets/redux.ts | 4 +- src/sourceSnippets/sharedSnippets.ts | 25 +- src/sourceSnippets/tests.ts | 9 - src/sourceSnippets/typescript.ts | 11 +- tsconfig.json | 5 - 22 files changed, 279 insertions(+), 2207 deletions(-) delete mode 100644 src/helpers.ts create mode 100644 src/helpers/extensionConfig.ts create mode 100644 src/helpers/formatters.ts rename src/{ => helpers}/generateSnippets.ts (59%) create mode 100644 src/helpers/getPrettierConfig.ts create mode 100644 src/helpers/parseSnippetToBody.ts create mode 100644 src/helpers/replaceOrRemoveReactImport.ts create mode 100644 src/helpers/revertSnippetPlaceholders.ts create mode 100644 src/helpers/snippetPlaceholders.ts rename src/{ => helpers}/snippetSearch.ts (89%) diff --git a/.eslintrc.js b/.eslintrc.js index 9ad9f12..10b3143 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -125,10 +125,7 @@ module.exports = { 'import/no-unresolved': [ 'error', - { - caseSensitive: false, - ignore: ['vscode'], - }, + { caseSensitive: false, ignore: ['vscode'] }, ], 'prettier/prettier': [ 'error', @@ -203,7 +200,6 @@ module.exports = { '@typescript-eslint/prefer-optional-chain': 'error', '@typescript-eslint/triple-slash-reference': 'error', '@typescript-eslint/unified-signatures': 'error', - 'default-case': 'off', 'no-dupe-class-members': 'off', 'no-undef': 'off', diff --git a/package.json b/package.json index 4892d71..904f013 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "reactSnippets.settings.semiColons": { "type": "boolean", "markdownDescription": "Controls if snippets should use semi colons.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", - "default": true + "default": false }, "reactSnippets.settings.singleQuote": { "type": "boolean", diff --git a/src/helpers.ts b/src/helpers.ts deleted file mode 100644 index cb55ac9..0000000 --- a/src/helpers.ts +++ /dev/null @@ -1,158 +0,0 @@ -import prettier, { Options } from 'prettier'; -import { workspace } from 'vscode'; - -import { Snippet } from './generateSnippets'; -import { Mappings, Placeholders } from './types'; - -export type ExtensionSettings = { - languageScopes: string; - prettierEnabled: boolean; - semiColons: boolean; - importReactOnTop: boolean; - singleQuote: boolean; - typescript: boolean; - tabWidth: number; - typescriptPropsStatePrefix: 'type' | 'interface'; -}; - -let prettierConfig: prettier.Options | null; -prettier - .resolveConfig('', { editorconfig: true }) - .then((config) => (prettierConfig = config)); - -export const extensionConfig = () => - workspace.getConfiguration( - 'reactSnippets.settings', - ) as unknown as ExtensionSettings; - -const getPrettierConfig = (): Options => { - const { semiColons, singleQuote, tabWidth, prettierEnabled } = - extensionConfig(); - - return { - parser: 'typescript', - semi: semiColons, - singleQuote, - tabWidth, - ...(prettierEnabled && prettierConfig), - }; -}; - -const formatSnippet = (string: string) => { - const prettierConfig = getPrettierConfig(); - return prettier.format(string, prettierConfig); -}; - -export const replaceSnippetPlaceholders = (snippetString: string) => { - const { typescriptPropsStatePrefix } = extensionConfig(); - const propsPlaceholder = - typescriptPropsStatePrefix === 'type' - ? Mappings.TypeProps - : Mappings.InterfaceProps; - const statePlaceholder = - typescriptPropsStatePrefix === 'type' - ? Mappings.TypeState - : Mappings.InterfaceState; - - return String(snippetString) - .replace(new RegExp(Placeholders.FileName, 'g'), '${1:${TM_FILENAME_BASE}}') - .replace(new RegExp(Placeholders.FirstTab, 'g'), '${1:first}') - .replace(new RegExp(Placeholders.SecondTab, 'g'), '${2:second}') - .replace(new RegExp(Placeholders.ThirdTab, 'g'), '${3:third}') - .replace(new RegExp(Placeholders.LastTab, 'g'), '$0') - .replace( - new RegExp(Placeholders.Capitalize, 'g'), - '${1/(.*)/${1:/capitalize}/}', - ) - .replace(new RegExp(Placeholders.TypeProps, 'g'), propsPlaceholder) - .replace(new RegExp(Placeholders.TypeState, 'g'), statePlaceholder); -}; - -export const revertSnippetPlaceholders = (snippetString: string) => { - return String(snippetString) - .replace( - new RegExp(/\${1:\${TM_FILENAME_BASE}}/, 'g'), - Placeholders.FileName, - ) - .replace(new RegExp(/\${1:first}/, 'g'), Placeholders.FirstTab) - .replace(new RegExp(/\${2:second}/, 'g'), Placeholders.SecondTab) - .replace(new RegExp(/\${3:third}/, 'g'), Placeholders.ThirdTab) - .replace(new RegExp(/\$0/, 'g'), Placeholders.LastTab) - .replace( - new RegExp(/\${1\/(.*)\/${1:\/capitalize}\/}/, 'g'), - Placeholders.Capitalize, - ); -}; - -export const parseSnippet = (body: string | string[]) => { - const snippetBody = typeof body === 'string' ? body : body.join('\n'); - - return replaceSnippetPlaceholders( - formatSnippet(revertSnippetPlaceholders(snippetBody)), - ); -}; - -// This is array of prefixes which are currently skipped because of syntax format issues -const skippedSnippets = [ - 'pge', - 'pse', - 'gdsfp', - 'gsbu', - 'scu', - 'cwun', - 'cdm', - 'cdup', - 'rconst', -]; - -const withReactImport = [ - 'rfce', - 'rfc', - 'rfcp', - 'rafce', - 'rafc', - 'rafcp', - 'rnfe', - 'rnfes', - 'rnf', - 'rnfs', - 'stest', - 'sntest', - 'srtest', - 'snrtest', - 'hocredux', - 'hoc', -]; - -const replaceOrRemoveReactImport = (snippetBody: string[]) => { - const reactImportIndex = snippetBody.findIndex((line) => - line.match(new RegExp(/import React/, 'g')), - ); - - if (reactImportIndex !== -1) { - const line = snippetBody[reactImportIndex]; - snippetBody[reactImportIndex] = line - .replace(new RegExp(/^import React .*$/, 'g'), '') - .replace(new RegExp(/^import React, /, 'g'), 'import '); - } - - return snippetBody.join('\n'); -}; - -export const parseSnippetToBody = (snippet: Snippet) => { - const { importReactOnTop } = extensionConfig(); - const body = - typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); - - const snippetBody = importReactOnTop - ? body - : withReactImport.includes(snippet.prefix) - ? replaceOrRemoveReactImport(snippet.body) - : body; - - const formattedSnippet = skippedSnippets.includes(snippet.prefix) - ? snippetBody - : formatSnippet(snippetBody).split('\n'); - - return snippet.body.length === 1 ? formattedSnippet[0] : formattedSnippet; -}; diff --git a/src/helpers/extensionConfig.ts b/src/helpers/extensionConfig.ts new file mode 100644 index 0000000..96d0a67 --- /dev/null +++ b/src/helpers/extensionConfig.ts @@ -0,0 +1,19 @@ +import { workspace } from 'vscode'; + +export type ExtensionSettings = { + languageScopes: string; + prettierEnabled: boolean; + semiColons: boolean; + importReactOnTop: boolean; + singleQuote: boolean; + typescript: boolean; + tabWidth: number; + typescriptPropsStatePrefix: 'type' | 'interface'; +}; + +const extensionConfig = () => + workspace.getConfiguration( + 'reactSnippets.settings', + ) as unknown as ExtensionSettings; + +export default extensionConfig; diff --git a/src/helpers/formatters.ts b/src/helpers/formatters.ts new file mode 100644 index 0000000..6188083 --- /dev/null +++ b/src/helpers/formatters.ts @@ -0,0 +1,22 @@ +import prettier from 'prettier'; + +import extensionConfig from './extensionConfig'; +import getPrettierConfig from './getPrettierConfig'; +import { + replaceSnippetPlaceholders, + revertSnippetPlaceholders, +} from './snippetPlaceholders'; + +export const formatSnippet = (snippetString: string) => { + return extensionConfig().prettierEnabled + ? prettier.format(snippetString, getPrettierConfig()) + : snippetString; +}; + +export const parseSnippet = (body: string | string[]) => { + const snippetBody = typeof body === 'string' ? body : body.join('\n'); + + return replaceSnippetPlaceholders( + formatSnippet(revertSnippetPlaceholders(snippetBody)), + ); +}; diff --git a/src/generateSnippets.ts b/src/helpers/generateSnippets.ts similarity index 59% rename from src/generateSnippets.ts rename to src/helpers/generateSnippets.ts index 6a165b3..579dbde 100644 --- a/src/generateSnippets.ts +++ b/src/helpers/generateSnippets.ts @@ -1,28 +1,27 @@ import { writeFile } from 'fs'; -import { - extensionConfig, - parseSnippetToBody, - replaceSnippetPlaceholders, -} from './helpers'; import componentsSnippets, { ComponentsSnippet, -} from './sourceSnippets/components'; -import consoleSnippets, { ConsoleSnippet } from './sourceSnippets/console'; -import hooksSnippets, { HooksSnippet } from './sourceSnippets/hooks'; -import importsSnippets, { ImportsSnippet } from './sourceSnippets/imports'; -import othersSnippets, { OthersSnippet } from './sourceSnippets/others'; +} from '../sourceSnippets/components'; +import consoleSnippets, { ConsoleSnippet } from '../sourceSnippets/console'; +import hooksSnippets, { HooksSnippet } from '../sourceSnippets/hooks'; +import importsSnippets, { ImportsSnippet } from '../sourceSnippets/imports'; +import othersSnippets, { OthersSnippet } from '../sourceSnippets/others'; import propTypesSnippets, { PropTypesSnippet, -} from './sourceSnippets/propTypes'; +} from '../sourceSnippets/propTypes'; import reactNativeSnippets, { ReactNativeSnippet, -} from './sourceSnippets/reactNative'; -import reduxSnippets, { ReduxSnippet } from './sourceSnippets/redux'; -import testsSnippets, { TestsSnippet } from './sourceSnippets/tests'; +} from '../sourceSnippets/reactNative'; +import reduxSnippets, { ReduxSnippet } from '../sourceSnippets/redux'; +import testsSnippets, { TestsSnippet } from '../sourceSnippets/tests'; import typescriptSnippets, { TypescriptSnippet, -} from './sourceSnippets/typescript'; +} from '../sourceSnippets/typescript'; + +import extensionConfig from './extensionConfig'; +import parseSnippetToBody from './parseSnippetToBody'; +import { replaceSnippetPlaceholders } from './snippetPlaceholders'; export type SnippetKeys = | OthersSnippet['key'] @@ -77,13 +76,19 @@ const getSnippets = () => { return replaceSnippetPlaceholders(JSON.stringify(snippets, null, 2)); }; -export const generateSnippets = () => +const generateSnippets = () => new Promise((resolve) => { const jsonSnippets = getSnippets(); - writeFile(__dirname + '/snippets/generated.json', jsonSnippets, (error) => { - if (error) { - console.error(error); - } - return resolve(true); - }); + writeFile( + __dirname + '/../snippets/generated.json', + jsonSnippets, + (error) => { + if (error) { + console.error(error); + } + return resolve(true); + }, + ); }); + +export default generateSnippets; diff --git a/src/helpers/getPrettierConfig.ts b/src/helpers/getPrettierConfig.ts new file mode 100644 index 0000000..1b99d72 --- /dev/null +++ b/src/helpers/getPrettierConfig.ts @@ -0,0 +1,23 @@ +import prettier, { Options } from 'prettier'; + +import extensionConfig from './extensionConfig'; + +let prettierConfig: prettier.Options | null; +prettier + .resolveConfig('', { editorconfig: true }) + .then((config) => (prettierConfig = config)); + +const getPrettierConfig = (): Options => { + const { semiColons, singleQuote, tabWidth, prettierEnabled } = + extensionConfig(); + + return { + parser: 'typescript', + semi: semiColons, + singleQuote, + tabWidth, + ...(prettierEnabled && prettierConfig), + }; +}; + +export default getPrettierConfig; diff --git a/src/helpers/parseSnippetToBody.ts b/src/helpers/parseSnippetToBody.ts new file mode 100644 index 0000000..7f99e34 --- /dev/null +++ b/src/helpers/parseSnippetToBody.ts @@ -0,0 +1,56 @@ +import extensionConfig from './extensionConfig'; +import { formatSnippet } from './formatters'; +import { Snippet } from './generateSnippets'; +import replaceOrRemoveReactImport from './replaceOrRemoveReactImport'; + +// This is array of prefixes which are currently skipped because of syntax format issues +const skippedSnippets = [ + 'pge', + 'pse', + 'gdsfp', + 'gsbu', + 'scu', + 'cwun', + 'cdm', + 'cdup', + 'rconst', +]; + +const withReactImport = [ + 'rfce', + 'rfc', + 'rfcp', + 'rafce', + 'rafc', + 'rafcp', + 'rnfe', + 'rnfes', + 'rnf', + 'rnfs', + 'stest', + 'sntest', + 'srtest', + 'snrtest', + 'hocredux', + 'hoc', +]; + +const parseSnippetToBody = (snippet: Snippet) => { + const { importReactOnTop } = extensionConfig(); + const body = + typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); + + const snippetBody = importReactOnTop + ? body + : withReactImport.includes(snippet.prefix) + ? replaceOrRemoveReactImport(snippet.body) + : body; + + const formattedSnippet = skippedSnippets.includes(snippet.prefix) + ? snippetBody + : formatSnippet(snippetBody).split('\n'); + + return snippet.body.length === 1 ? formattedSnippet[0] : formattedSnippet; +}; + +export default parseSnippetToBody; diff --git a/src/helpers/replaceOrRemoveReactImport.ts b/src/helpers/replaceOrRemoveReactImport.ts new file mode 100644 index 0000000..b8a699f --- /dev/null +++ b/src/helpers/replaceOrRemoveReactImport.ts @@ -0,0 +1,16 @@ +const replaceOrRemoveReactImport = (snippetBody: string[]) => { + const reactImportIndex = snippetBody.findIndex((line) => + line.match(new RegExp(/import React/, 'g')), + ); + + if (reactImportIndex !== -1) { + const line = snippetBody[reactImportIndex]; + snippetBody[reactImportIndex] = line + .replace(new RegExp(/^import React .*$/, 'g'), '') + .replace(new RegExp(/^import React, /, 'g'), 'import '); + } + + return snippetBody.join('\n'); +}; + +export default replaceOrRemoveReactImport; diff --git a/src/helpers/revertSnippetPlaceholders.ts b/src/helpers/revertSnippetPlaceholders.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/helpers/snippetPlaceholders.ts b/src/helpers/snippetPlaceholders.ts new file mode 100644 index 0000000..72595ff --- /dev/null +++ b/src/helpers/snippetPlaceholders.ts @@ -0,0 +1,45 @@ +import { Mappings, Placeholders } from '../types'; + +import extensionConfig from './extensionConfig'; + +export const replaceSnippetPlaceholders = (snippetString: string) => { + const { typescriptPropsStatePrefix } = extensionConfig(); + const propsPlaceholder = + typescriptPropsStatePrefix === 'type' + ? Mappings.TypeProps + : Mappings.InterfaceProps; + const statePlaceholder = + typescriptPropsStatePrefix === 'type' + ? Mappings.TypeState + : Mappings.InterfaceState; + + return String(snippetString) + .replace(new RegExp(Placeholders.FileName, 'g'), '${1:${TM_FILENAME_BASE}}') + .replace(new RegExp(Placeholders.FirstTab, 'g'), '${1:first}') + .replace(new RegExp(Placeholders.SecondTab, 'g'), '${2:second}') + .replace(new RegExp(Placeholders.ThirdTab, 'g'), '${3:third}') + .replace(new RegExp(Placeholders.LastTab, 'g'), '$0') + .replace( + new RegExp(Placeholders.Capitalize, 'g'), + '${1/(.*)/${1:/capitalize}/}', + ) + .replace(new RegExp(Placeholders.TypeProps, 'g'), propsPlaceholder) + .replace(new RegExp(Placeholders.TypeState, 'g'), statePlaceholder); +}; + +export const revertSnippetPlaceholders = (snippetString: string) => { + return String(snippetString) + .replace( + new RegExp(/\${1:\${TM_FILENAME_BASE}}/, 'g'), + Placeholders.FileName, + ) + .replace(new RegExp(/\${1:first}/, 'g'), Placeholders.FirstTab) + .replace(new RegExp(/\${2:second}/, 'g'), Placeholders.SecondTab) + .replace(new RegExp(/\${3:third}/, 'g'), Placeholders.ThirdTab) + .replace(new RegExp(/\$0/, 'g'), Placeholders.LastTab) + .replace( + new RegExp(/\${1\/(.*)\/${1:\/capitalize}\/}/, 'g'), + Placeholders.Capitalize, + ); +}; +export default revertSnippetPlaceholders; diff --git a/src/snippetSearch.ts b/src/helpers/snippetSearch.ts similarity index 89% rename from src/snippetSearch.ts rename to src/helpers/snippetSearch.ts index aad6db0..95c70df 100644 --- a/src/snippetSearch.ts +++ b/src/helpers/snippetSearch.ts @@ -1,8 +1,9 @@ import { SnippetString, window } from 'vscode'; +import snippets from '../snippets/generated.json'; + +import { parseSnippet } from './formatters'; import { Snippet } from './generateSnippets'; -import { parseSnippet } from './helpers'; -import snippets from './snippets/generated.json'; const snippetSearch = async () => { const { showQuickPick, activeTextEditor } = window; diff --git a/src/index.ts b/src/index.ts index 6fe07ab..11a020a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,8 +6,8 @@ import { workspace, } from 'vscode'; -import { generateSnippets } from './generateSnippets'; -import snippetSearch from './snippetSearch'; +import generateSnippets from './helpers/generateSnippets'; +import snippetSearch from './helpers/snippetSearch'; const showRestartMessage = async ({ affectsConfiguration, diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 7be8183..0967ef4 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -1,1887 +1 @@ -{ - "exportType": { - "body": "export type ${1:first} = { $0 };", - "key": "exportType", - "prefix": "exptp", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportInterface": { - "key": "exportInterface", - "prefix": "expint", - "body": ["export interface ${1:first} {", " $0;", "}", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassComponent": { - "key": "typescriptReactClassComponent", - "prefix": "tsrcc", - "description": "Creates a React component class with ES7 module system and TypeScript interfaces", - "body": [ - "import React, { Component } from 'react';", - "", - "type Props = {};", - "", - "type State = {};", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {};", - "", - " render() {", - " return
$0
;", - " }", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassExportComponent": { - "key": "typescriptReactClassExportComponent", - "prefix": "tsrce", - "body": [ - "import React, { Component } from 'react';", - "", - "type Props = {};", - "", - "type State = {};", - "", - "class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {};", - "", - " render() {", - " return
$0
;", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React component class with ES7 module system and TypeScript interfaces", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactFunctionalExportComponent": { - "key": "typescriptReactFunctionalExportComponent", - "prefix": "tsrfce", - "body": [ - "import React from 'react';", - "", - "type Props = {};", - "", - "function ${1:${TM_FILENAME_BASE}}({}: Props) {", - " return
$0
;", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactFunctionalComponent": { - "key": "typescriptReactFunctionalComponent", - "prefix": "tsrfc", - "body": [ - "import React from 'react';", - "", - "type Props = {};", - "", - "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", - " return
$0
;", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactArrowFunctionExportComponent": { - "key": "typescriptReactArrowFunctionExportComponent", - "prefix": "tsrafce", - "body": [ - "import React from 'react';", - "", - "type Props = {};", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return
$0
;", - "};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactArrowFunctionComponent": { - "key": "typescriptReactArrowFunctionComponent", - "prefix": "tsrafc", - "body": [ - "import React from 'react';", - "", - "type Props = {};", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return
$0
;", - "};", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassPureComponent": { - "key": "typescriptReactClassPureComponent", - "prefix": "tsrpc", - "body": [ - "import React, { PureComponent } from 'react';", - "", - "type Props = {};", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return
$0
;", - " }", - "}", - "" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassExportPureComponent": { - "key": "typescriptReactClassExportPureComponent", - "prefix": "tsrpce", - "body": [ - "import React, { PureComponent } from 'react';", - "", - "type Props = {};", - "", - "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return
$0
;", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassComponentRedux": { - "key": "typescriptReactClassComponentRedux", - "prefix": "tsrcredux", - "body": [ - "import { connect } from 'react-redux';", - "import React, { Component } from 'react';", - "", - "type Props = {};", - "", - "type State = {};", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {};", - "", - " render() {", - " return
$0
;", - " }", - "}", - "", - "const mapStateToProps = (state) => ({});", - "", - "const mapDispatchToProps = {};", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", - "" - ], - "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactNativeArrowFunctionComponent": { - "key": "typescriptReactNativeArrowFunctionComponent", - "prefix": "tsrnf", - "body": [ - "import { View, Text } from 'react-native';", - "import React from 'react';", - "", - "type Props = {};", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - " ", - " $0", - " ", - " );", - "};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactNativeArrowFunctionComponentNamedProps": { - "key": "typescriptReactNativeArrowFunctionComponentNamedProps", - "prefix": "tsrnfi", - "body": [ - "import { View } from 'react-native';", - "import React from 'react';", - "", - "type Props = {};", - "", - "const ${1:${TM_FILENAME_BASE}}: React.FC<${1:${TM_FILENAME_BASE}}Props> = (props) => {", - " return $0;", - "};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactNativeArrowFunctionComponentWithStyles": { - "key": "typescriptReactNativeArrowFunctionComponentWithStyles", - "prefix": "tsrnfs", - "body": [ - "import { StyleSheet, Text, View } from 'react-native';", - "import React from 'react';", - "", - "type Props = {};", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - " ", - " $0", - " ", - " );", - "};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "", - "const styles = StyleSheet.create({});", - "" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionComponent": { - "key": "reactArrowFunctionComponent", - "prefix": "rafc", - "body": [ - "export const ${1:${TM_FILENAME_BASE}} = () => {", - " return
$0
;", - "};", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionComponentWithPropTypes": { - "key": "reactArrowFunctionComponentWithPropTypes", - "prefix": "rafcp", - "body": [ - "import PropTypes from 'prop-types';", - "", - "const ${1:${TM_FILENAME_BASE}} = (props) => {", - " return
$0
;", - "};", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionExportComponent": { - "key": "reactArrowFunctionExportComponent", - "prefix": "rafce", - "body": [ - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return
$0
;", - "};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponent": { - "key": "reactClassComponent", - "prefix": "rcc", - "body": [ - "import React, { Component } from 'react';", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return
$0
;", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentPropTypes": { - "key": "reactClassComponentPropTypes", - "prefix": "rccp", - "body": [ - "import PropTypes from 'prop-types';", - "import React, { Component } from 'react';", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {", - " ${2:second}: ${3:third},", - " };", - "", - " render() {", - " return
$0
;", - " }", - "}", - "" - ], - "description": "Creates a React component class with PropTypes and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentRedux": { - "key": "reactClassComponentRedux", - "prefix": "rcredux", - "body": [ - "import React, { Component } from 'react';", - "import { connect } from 'react-redux';", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return
$0
;", - " }", - "}", - "", - "const mapStateToProps = (state) => ({});", - "", - "const mapDispatchToProps = {};", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", - "" - ], - "description": "Creates a React component class with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentReduxPropTypes": { - "key": "reactClassComponentReduxPropTypes", - "prefix": "rcreduxp", - "body": [ - "import PropTypes from 'prop-types';", - "import React, { Component } from 'react';", - "import { connect } from 'react-redux';", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {", - " ${2:second}: ${3:third},", - " };", - "", - " render() {", - " return
$0
;", - " }", - "}", - "", - "const mapStateToProps = (state) => ({});", - "", - "const mapDispatchToProps = {};", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", - "" - ], - "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportComponent": { - "key": "reactClassExportComponent", - "prefix": "rce", - "body": [ - "import React, { Component } from 'react';", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return
$0
;", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportComponentWithPropTypes": { - "key": "reactClassExportComponentWithPropTypes", - "prefix": "rcep", - "body": [ - "import PropTypes from 'prop-types';", - "import React, { Component } from 'react';", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {};", - "", - " render() {", - " return
$0
;", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportPureComponent": { - "key": "reactClassExportPureComponent", - "prefix": "rpce", - "body": [ - "import React, { PureComponent } from 'react';", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return
$0
;", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React pure component class with ES7 module system export", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassPureComponent": { - "key": "reactClassPureComponent", - "prefix": "rpc", - "body": [ - "import React, { PureComponent } from 'react';", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return
$0
;", - " }", - "}", - "" - ], - "description": "Creates a React pure component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassPureComponentWithPropTypes": { - "key": "reactClassPureComponentWithPropTypes", - "prefix": "rpcp", - "body": [ - "import PropTypes from 'prop-types';", - "import React, { PureComponent } from 'react';", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " static propTypes = {};", - "", - " render() {", - " return
$0
;", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionMemoComponent": { - "key": "reactFunctionMemoComponent", - "prefix": "rmc", - "body": [ - "import React, { memo } from 'react';", - "", - "export default memo(function ${1:${TM_FILENAME_BASE}}() {", - " return
$0
;", - "});", - "" - ], - "description": "Creates a React Memo Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionMemoComponentWithPropTypes": { - "key": "reactFunctionMemoComponentWithPropTypes", - "prefix": "rmcp", - "body": [ - "import PropTypes from 'prop-types';", - "import React, { memo } from 'react';", - "", - "const ${1:${TM_FILENAME_BASE}} = memo(function ${1:${TM_FILENAME_BASE}}(props) {", - " return
$0
;", - "});", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponent": { - "key": "reactFunctionalComponent", - "prefix": "rfc", - "body": [ - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return
$0
;", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentRedux": { - "key": "reactFunctionalComponentRedux", - "prefix": "rfcredux", - "body": [ - "import React from 'react';", - "import { connect } from 'react-redux';", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - " return
$0
;", - "};", - "", - "const mapStateToProps = (state) => ({});", - "", - "const mapDispatchToProps = {};", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", - "" - ], - "description": "Creates a React functional component with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentReduxPropTypes": { - "key": "reactFunctionalComponentReduxPropTypes", - "prefix": "rfcreduxp", - "body": [ - "import PropTypes from 'prop-types';", - "import React from 'react';", - "import { connect } from 'react-redux';", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - " return
$0
;", - "};", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - " ${2:second}: PropTypes.${3:third},", - "};", - "", - "const mapStateToProps = (state) => ({});", - "", - "const mapDispatchToProps = {};", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}});", - "" - ], - "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentWithPropTypes": { - "key": "reactFunctionalComponentWithPropTypes", - "prefix": "rfcp", - "body": [ - "import PropTypes from 'prop-types';", - "", - "function ${1:${TM_FILENAME_BASE}}(props) {", - " return
$0
;", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Functional Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalExportComponent": { - "key": "reactFunctionalExportComponent", - "prefix": "rfce", - "body": [ - "function ${1:${TM_FILENAME_BASE}}() {", - " return
$0
;", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "description": "Creates a React Functional Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleAssert": { - "key": "consoleAssert", - "prefix": "cas", - "body": "console.assert(${1:first}, ${2:second});", - "description": "If the specified expression is false, the message is written to the console along with a stack trace", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleClear": { - "key": "consoleClear", - "prefix": "ccl", - "body": "console.clear();", - "description": "Clears the console", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleCount": { - "key": "consoleCount", - "prefix": "cco", - "body": "console.count(${1:first});", - "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleDir": { - "key": "consoleDir", - "prefix": "cdi", - "body": "console.dir(${1:first});", - "description": "Prints a JavaScript representation of the specified object", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleError": { - "key": "consoleError", - "prefix": "cer", - "body": "console.error(${1:first});", - "description": "Displays a message in the console and also includes a stack trace from where the method was called", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleGroup": { - "key": "consoleGroup", - "prefix": "cgr", - "body": "console.group('${1:first}');", - "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleGroupEnd": { - "key": "consoleGroupEnd", - "prefix": "cge", - "body": "console.groupEnd();", - "description": "Closes out the corresponding console.group().", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLog": { - "key": "consoleLog", - "prefix": "clg", - "body": "console.log(${1:first});", - "description": "Displays a message in the console", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTrace": { - "key": "consoleTrace", - "prefix": "ctr", - "body": "console.trace(${1:first});", - "description": "Prints a stack trace from the point where the method was called", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLogObject": { - "key": "consoleLogObject", - "prefix": "clo", - "body": "console.log('${1:first}', ${1:first});", - "description": "Logs property with name.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLogJson": { - "key": "consoleLogJson", - "prefix": "clj", - "body": "console.log('${1:first}', JSON.stringify(${1:first}, null, 2));", - "description": "Logs stringified JSON property with name.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTime": { - "key": "consoleTime", - "prefix": "ctm", - "body": "console.time('${1:first}');", - "description": "Console time wrapper", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTimeEnd": { - "key": "consoleTimeEnd", - "prefix": "cte", - "body": "console.timeEnd('${1:first}');", - "description": "Console time end wrapper", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleWarn": { - "key": "consoleWarn", - "prefix": "cwa", - "body": "console.warn(${1:first});", - "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleInfo": { - "key": "consoleInfo", - "prefix": "cin", - "body": "console.info(${1:first});", - "description": "Displays a message in the console but also displays a blue information icon along with the logged message", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useCallback": { - "key": "useCallback", - "prefix": "useCallbackSnippet", - "body": ["useCallback(() => {", " ${1:first};", "}, [${2:second}]);", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useContext": { - "key": "useContext", - "prefix": "useContextSnippet", - "body": "const ${1:first} = useContext(${2:second});", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useEffect": { - "key": "useEffect", - "prefix": "useEffectSnippet", - "body": [ - "useEffect(() => {", - " ${1:first};", - "", - " return () => {", - " ${2:second};", - " };", - "}, [${3:third}]);", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useImperativeHandle": { - "key": "useImperativeHandle", - "prefix": "useImperativeHandleSnippet", - "body": [ - "useImperativeHandle(", - " ${1:first},", - " () => {", - " ${2:second};", - " },", - " [${3:third}]", - ");", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useLayoutEffect": { - "key": "useLayoutEffect", - "prefix": "useLayoutEffectSnippet", - "body": [ - "useLayoutEffect(() => {", - " ${1:first};", - " return () => {", - " ${2:second};", - " };", - "}, [${3:third}]);", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useMemo": { - "key": "useMemo", - "prefix": "useMemoSnippet", - "body": "useMemo(() => ${1:first}, ${2:second});", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useReducer": { - "key": "useReducer", - "prefix": "useReducerSnippet", - "body": "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third});", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useRef": { - "key": "useRef", - "prefix": "useRefSnippet", - "body": "const ${1:first} = useRef(${2:second});", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useState": { - "key": "useState", - "prefix": "useStateSnippet", - "body": "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second});", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importAs": { - "key": "importAs", - "prefix": "ima", - "body": [ - "import { ${2:second} as ${3:third} } from '${1:first}';", - "$0;", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importBrowserRouter": { - "key": "importBrowserRouter", - "prefix": "imbr", - "body": ["import { BrowserRouter as Router } from 'react-router-dom';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importBrowserRouterWithRouteAndNavLink": { - "key": "importBrowserRouterWithRouteAndNavLink", - "prefix": "imrr", - "body": [ - "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom';", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importDestructing": { - "key": "importDestructing", - "prefix": "imd", - "body": ["import { ${2:second} } from '${1:first}';", "$0;", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importEverything": { - "key": "importEverything", - "prefix": "ime", - "body": ["import * as ${2:second} from '${1:first}';", "$0;", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importNoModuleName": { - "key": "importNoModuleName", - "prefix": "imn", - "body": ["import '${1:first}';", "$0;", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importPropTypes": { - "key": "importPropTypes", - "prefix": "impt", - "body": ["import PropTypes from 'prop-types';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReact": { - "key": "importReact", - "prefix": "imr", - "body": ["import React from 'react';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactDom": { - "key": "importReactDom", - "prefix": "imrd", - "body": ["import ReactDOM from 'react-dom';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithComponent": { - "key": "importReactWithComponent", - "prefix": "imrc", - "body": ["import React, { Component } from 'react';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithComponentAndPropTypes": { - "key": "importReactWithComponentAndPropTypes", - "prefix": "imrcp", - "body": [ - "import React, { Component } from 'react';", - "import PropTypes from 'prop-types';", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithMemo": { - "key": "importReactWithMemo", - "prefix": "imrm", - "body": ["import React, { memo } from 'react';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithMemoAndPropTypes": { - "key": "importReactWithMemoAndPropTypes", - "prefix": "imrmp", - "body": [ - "import React, { memo } from 'react';", - "import PropTypes from 'prop-types';", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithPureComponent": { - "key": "importReactWithPureComponent", - "prefix": "imrpc", - "body": ["import React, { PureComponent } from 'react';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithPureComponentAndPropTypes": { - "key": "importReactWithPureComponentAndPropTypes", - "prefix": "imrpcp", - "body": [ - "import React, { PureComponent } from 'react';", - "import PropTypes from 'prop-types';", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterLink": { - "key": "importRouterLink", - "prefix": "imbrl", - "body": ["import { Link } from 'react-router-dom';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterNavLink": { - "key": "importRouterNavLink", - "prefix": "imbrnl", - "body": ["import { NavLink } from 'react-router-dom';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterSetup": { - "key": "importRouterSetup", - "prefix": "imbrc", - "body": [ - "import { Route, Switch, NavLink, Link } from 'react-router-dom';", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterSwitch": { - "key": "importRouterSwitch", - "prefix": "imbrs", - "body": ["import { Switch } from 'react-router-dom';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "import": { - "key": "import", - "prefix": "imp", - "body": ["import ${2:second} from '${1:first}';", "$0;", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArray": { - "key": "propTypeArray", - "prefix": "pta", - "body": "PropTypes.array;", - "description": "Array prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayRequired": { - "key": "propTypeArrayRequired", - "prefix": "ptar", - "body": "PropTypes.array.isRequired;", - "description": "Array prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeBool": { - "key": "propTypeBool", - "prefix": "ptb", - "body": "PropTypes.bool;", - "description": "Bool prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeBoolRequired": { - "key": "propTypeBoolRequired", - "prefix": "ptbr", - "body": "PropTypes.bool.isRequired;", - "description": "Bool prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeFunc": { - "key": "propTypeFunc", - "prefix": "ptf", - "body": "PropTypes.func;", - "description": "Func prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeFuncRequired": { - "key": "propTypeFuncRequired", - "prefix": "ptfr", - "body": "PropTypes.func.isRequired;", - "description": "Func prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNumber": { - "key": "propTypeNumber", - "prefix": "ptn", - "body": "PropTypes.number;", - "description": "Number prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNumberRequired": { - "key": "propTypeNumberRequired", - "prefix": "ptnr", - "body": "PropTypes.number.isRequired;", - "description": "Number prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObject": { - "key": "propTypeObject", - "prefix": "pto", - "body": "PropTypes.object;", - "description": "Object prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectRequired": { - "key": "propTypeObjectRequired", - "prefix": "ptor", - "body": "PropTypes.object.isRequired;", - "description": "Object prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeString": { - "key": "propTypeString", - "prefix": "pts", - "body": "PropTypes.string;", - "description": "String prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeStringRequired": { - "key": "propTypeStringRequired", - "prefix": "ptsr", - "body": "PropTypes.string.isRequired;", - "description": "String prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNode": { - "key": "propTypeNode", - "prefix": "ptnd", - "body": "PropTypes.node;", - "description": "Anything that can be rendered: numbers, strings, elements or an array", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNodeRequired": { - "key": "propTypeNodeRequired", - "prefix": "ptndr", - "body": "PropTypes.node.isRequired;", - "description": "Anything that can be rendered: numbers, strings, elements or an array required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeElement": { - "key": "propTypeElement", - "prefix": "ptel", - "body": "PropTypes.element;", - "description": "React element prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeElementRequired": { - "key": "propTypeElementRequired", - "prefix": "ptelr", - "body": "PropTypes.element.isRequired;", - "description": "React element prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeInstanceOf": { - "key": "propTypeInstanceOf", - "prefix": "pti", - "body": "PropTypes.instanceOf($0);", - "description": "Is an instance of a class prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeInstanceOfRequired": { - "key": "propTypeInstanceOfRequired", - "prefix": "ptir", - "body": "PropTypes.instanceOf($0).isRequired;", - "description": "Is an instance of a class prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeEnum": { - "key": "propTypeEnum", - "prefix": "pte", - "body": "PropTypes.oneOf(['$0']);", - "description": "Prop type limited to specific values by treating it as an enum", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeEnumRequired": { - "key": "propTypeEnumRequired", - "prefix": "pter", - "body": "PropTypes.oneOf(['$0']).isRequired;", - "description": "Prop type limited to specific values by treating it as an enum required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeOneOfType": { - "key": "propTypeOneOfType", - "prefix": "ptet", - "body": ["PropTypes.oneOfType([$0]);", ""], - "description": "An object that could be one of many types", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeOneOfTypeRequired": { - "key": "propTypeOneOfTypeRequired", - "prefix": "ptetr", - "body": ["PropTypes.oneOfType([$0]).isRequired;", ""], - "description": "An object that could be one of many types required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayOf": { - "key": "propTypeArrayOf", - "prefix": "ptao", - "body": "PropTypes.arrayOf($0);", - "description": "An array of a certain type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayOfRequired": { - "key": "propTypeArrayOfRequired", - "prefix": "ptaor", - "body": "PropTypes.arrayOf($0).isRequired;", - "description": "An array of a certain type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectOf": { - "key": "propTypeObjectOf", - "prefix": "ptoo", - "body": "PropTypes.objectOf($0);", - "description": "An object with property values of a certain type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectOfRequired": { - "key": "propTypeObjectOfRequired", - "prefix": "ptoor", - "body": "PropTypes.objectOf($0).isRequired;", - "description": "An object with property values of a certain type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeShape": { - "key": "propTypeShape", - "prefix": "ptsh", - "body": ["PropTypes.shape({", " $0,", "});", ""], - "description": "An object taking on a particular shape", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeShapeRequired": { - "key": "propTypeShapeRequired", - "prefix": "ptshr", - "body": ["PropTypes.shape({", " $0,", "}).isRequired;", ""], - "description": "An object taking on a particular shape required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeExact": { - "key": "propTypeExact", - "prefix": "ptex", - "body": ["PropTypes.exact({", " $0,", "});", ""], - "description": "An object with warnings on extra properties", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeExactRequired": { - "key": "propTypeExactRequired", - "prefix": "ptexr", - "body": ["PropTypes.exact({", " $0,", "}).isRequired;", ""], - "description": "An object with warnings on extra properties required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeAny": { - "key": "propTypeAny", - "prefix": "ptany", - "body": "PropTypes.any;", - "description": "Any prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponent": { - "key": "reactNativeComponent", - "prefix": "rnc", - "body": [ - "import { Text, View } from 'react-native';", - "import React, { Component } from 'react';", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " $0", - " ", - " );", - " }", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponentExport": { - "key": "reactNativeComponentExport", - "prefix": "rnce", - "body": [ - "import { Text, View } from 'react-native';", - "import React, { Component } from 'react';", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " $0", - " ", - " );", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponentWithStyles": { - "key": "reactNativeComponentWithStyles", - "prefix": "rncs", - "body": [ - "import { Text, StyleSheet, View } from 'react-native';", - "import React, { Component } from 'react';", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " $0", - " ", - " );", - " }", - "}", - "", - "const styles = StyleSheet.create({});", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalComponent": { - "key": "reactNativeFunctionalComponent", - "prefix": "rnf", - "body": [ - "import { View, Text } from 'react-native';", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - " ", - " $0", - " ", - " );", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalComponentWithStyles": { - "key": "reactNativeFunctionalComponentWithStyles", - "prefix": "rnfs", - "body": [ - "import { StyleSheet, Text, View } from 'react-native';", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - " ", - " $0", - " ", - " );", - "}", - "", - "const styles = StyleSheet.create({});", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalExportComponent": { - "key": "reactNativeFunctionalExportComponent", - "prefix": "rnfe", - "body": [ - "import { View, Text } from 'react-native';", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - " ", - " $0", - " ", - " );", - "};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalExportComponentWithStyles": { - "key": "reactNativeFunctionalExportComponentWithStyles", - "prefix": "rnfes", - "body": [ - "import { StyleSheet, Text, View } from 'react-native';", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - " ", - " $0", - " ", - " );", - "};", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "", - "const styles = StyleSheet.create({});", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeImport": { - "key": "reactNativeImport", - "prefix": "imrn", - "body": ["import { $0 } from 'react-native';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativePureComponent": { - "key": "reactNativePureComponent", - "prefix": "rnpc", - "body": [ - "import { Text, View } from 'react-native';", - "import React, { PureComponent } from 'react';", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - " ", - " $0", - " ", - " );", - " }", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativePureComponentExport": { - "key": "reactNativePureComponentExport", - "prefix": "rnpce", - "body": [ - "import { Text, View } from 'react-native';", - "import React, { PureComponent } from 'react';", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - " ", - " $0", - " ", - " );", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}};", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeStyles": { - "key": "reactNativeStyles", - "prefix": "rnstyle", - "body": ["const styles = StyleSheet.create({", " $0,", "});", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReduxConnect": { - "key": "importReduxConnect", - "prefix": "redux", - "body": ["import { connect } from 'react-redux';", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxAction": { - "key": "reduxAction", - "prefix": "rxaction", - "body": [ - "export const ${1:first} = (payload) => ({", - " type: ${2:second},", - " payload,", - "});", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxConst": { - "key": "reduxConst", - "prefix": "rxconst", - "body": "export const ${1:first} = '${1:first}';", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxReducer": { - "key": "reduxReducer", - "prefix": "rxreducer", - "body": [ - "const initialState = {};", - "", - "export default (state = initialState, { type, payload }) => {", - " switch (type) {", - " case ${1:first}:", - " return { ...state, ...payload };", - "", - " default:", - " return state;", - " }", - "};", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxSelector": { - "key": "reduxSelector", - "prefix": "rxselect", - "body": [ - "import { createSelector } from 'reselect';", - "", - "export const ${1:first} = (state) => state.${2:second};", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxSlice": { - "key": "reduxSlice", - "prefix": "rxslice", - "body": [ - "import { createSlice } from '@reduxjs/toolkit';", - "", - "const initialState = {};", - "", - "const ${1:${TM_FILENAME_BASE}} = createSlice({", - " name: ${2:second},", - " initialState,", - " reducers: {},", - "});", - "", - "export const {} = ${1:${TM_FILENAME_BASE}}.actions;", - "", - "export default ${1:${TM_FILENAME_BASE}}.reducer;", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "mappingToProps": { - "key": "mappingToProps", - "prefix": "reduxmap", - "body": [ - "const mapStateToProps = (state) => ({});", - "", - "const mapDispatchToProps = {};", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "describeBlock": { - "key": "describeBlock", - "prefix": "desc", - "body": ["describe('${1:first}', () => {", " $0;", "});", ""], - "description": "Testing `describe` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "itAsyncBlock": { - "key": "itAsyncBlock", - "prefix": "tita", - "body": ["it('should ${1:first}', async () => {", " $0;", "});", ""], - "description": "Testing asynchronous `it` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "itBlock": { - "key": "itBlock", - "prefix": "tit", - "body": ["it('should ${1:first}', () => {", " $0;", "});", ""], - "description": "Testing `it` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactComponentTestWithRedux": { - "key": "setupReactComponentTestWithRedux", - "prefix": "srtest", - "body": [ - "import renderer from 'react-test-renderer';", - "import { Provider } from 'react-redux';", - "", - "import store from '~/store';", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}';", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {};", - " const wrapper = renderer.create(", - " ", - " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - " ", - " );", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot();", - " });", - "});", - "" - ], - "description": "Create test component", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactNativeTest": { - "key": "setupReactNativeTest", - "prefix": "sntest", - "body": [ - "import 'react-native';", - "", - "import renderer from 'react-test-renderer';", - "", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}';", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {};", - " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />);", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot();", - " });", - "});", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactNativeTestWithRedux": { - "key": "setupReactNativeTestWithRedux", - "prefix": "snrtest", - "body": [ - "import 'react-native';", - "", - "import renderer from 'react-test-renderer';", - "import { Provider } from 'react-redux';", - "", - "import store from '~/store';", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}';", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {};", - " const wrapper = renderer.create(", - " ", - " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - " ", - " );", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot();", - " });", - "});", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactTest": { - "key": "setupReactTest", - "prefix": "stest", - "body": [ - "import renderer from 'react-test-renderer';", - "", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}';", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {};", - " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />);", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot();", - " });", - "});", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "testAsyncBlock": { - "key": "testAsyncBlock", - "prefix": "testa", - "body": ["test('should ${1:first}', async () => {", " $0;", "});", ""], - "description": "Testing `asynchronous test` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "testBlock": { - "key": "testBlock", - "prefix": "test", - "body": ["test('should ${1:first}', () => {", " $0;", "});", ""], - "description": "Testing `test` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefault": { - "key": "exportDefault", - "prefix": "exp", - "body": ["export default $0;", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDestructing": { - "key": "exportDestructing", - "prefix": "exd", - "body": ["export { ${2:second} } from '${1:first}';", "$0;", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportAs": { - "key": "exportAs", - "prefix": "exa", - "body": [ - "export { ${2:second} as ${3:third} } from '${1:first}';", - "$0;", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportNamedFunction": { - "key": "exportNamedFunction", - "prefix": "enf", - "body": ["export const ${1:first} = (${2:second}) => {", " $0;", "};", ""], - "description": "Export named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefaultFunction": { - "key": "exportDefaultFunction", - "prefix": "edf", - "body": ["export default (${1:first}) => {", " $0;", "};", ""], - "description": "Export default function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefaultNamedFunction": { - "key": "exportDefaultNamedFunction", - "prefix": "ednf", - "body": [ - "export default function ${1:first}(${2:second}) {", - " $0;", - "}", - "" - ], - "description": "Export default named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "method": { - "key": "method", - "prefix": "met", - "body": ["${1:first} = (${2:second}) => {", " $0;", "};", ""], - "description": "Creates a method inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propertyGet": { - "key": "propertyGet", - "prefix": "pge", - "body": "get ${1:first}() {\n return this.$0\n}\n", - "description": "Creates a getter property inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propertySet": { - "key": "propertySet", - "prefix": "pse", - "body": "set ${1:first}(${2:second}) {$0}\n", - "description": "Creates a setter property inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forEach": { - "key": "forEach", - "prefix": "fre", - "body": ["${1:first}.forEach((${2:second}) => {", " $0;", "});", ""], - "description": "Creates a forEach statement", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forOf": { - "key": "forOf", - "prefix": "fof", - "body": ["for (let ${1:first} of ${2:second}) {", " $0;", "}", ""], - "description": "Iterating over property names of iterable objects", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forIn": { - "key": "forIn", - "prefix": "fin", - "body": ["for (let ${1:first} in ${2:second}) {", " $0;", "}", ""], - "description": "Iterating over property values of iterable objects", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "anonymousFunction": { - "key": "anonymousFunction", - "prefix": "anfn", - "body": ["(${1:first}) => {", " ${2:second};", "};", ""], - "description": "Creates an anonymous function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "namedFunction": { - "key": "namedFunction", - "prefix": "nfn", - "body": [ - "const ${1:first} = (${2:second}) => {", - " ${3:third};", - "};", - "" - ], - "description": "Creates a named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructingObject": { - "key": "destructingObject", - "prefix": "dob", - "body": ["const { ${2:second} } = ${1:first};", ""], - "description": "Creates and assigns a local variable using object destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructingArray": { - "key": "destructingArray", - "prefix": "dar", - "body": ["const [${2:second}] = ${1:first};", ""], - "description": "Creates and assigns a local variable using array destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setInterval": { - "key": "setInterval", - "prefix": "sti", - "body": ["setInterval(() => {", " ${2:second};", "}, $0);", ""], - "description": "Executes the given function at specified intervals", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setTimeOut": { - "key": "setTimeOut", - "prefix": "sto", - "body": ["setTimeout(() => {", " ${2:second};", "}, ${1:first});", ""], - "description": "Executes the given function after the specified delay", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "promise": { - "key": "promise", - "prefix": "prom", - "body": ["return new Promise((resolve, reject) => {", " $0;", "});", ""], - "description": "Creates and returns a new Promise in the standard ES7 syntax", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructProps": { - "key": "destructProps", - "prefix": "cp", - "body": ["const { $0 } = this.props;", ""], - "description": "Creates and assigns a local variable using props destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructState": { - "key": "destructState", - "prefix": "cs", - "body": ["const { $0 } = this.state;", ""], - "description": "Creates and assigns a local variable using state destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "classConstructor": { - "key": "classConstructor", - "prefix": "rconst", - "body": "constructor(props) {\n super(props)\n\n this.state = {\n $0\n }\n}\n", - "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "emptyState": { - "key": "emptyState", - "prefix": "est", - "body": ["state = {", " $0,", "};", ""], - "description": "Creates empty state object. To be used in a constructor.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentDidMount": { - "key": "componentDidMount", - "prefix": "cdm", - "body": "componentDidMount() {\n $0\n}\n", - "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "shouldComponentUpdate": { - "key": "shouldComponentUpdate", - "prefix": "scu", - "body": "shouldComponentUpdate(nextProps, nextState) {\n $0\n}\n", - "description": "Invoked before rendering when new props or state are being received. ", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentDidUpdate": { - "key": "componentDidUpdate", - "prefix": "cdup", - "body": "componentDidUpdate(prevProps, prevState) {\n $0\n}\n", - "description": "Invoked immediately after the component's updates are flushed to the DOM.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentWillUnmount": { - "key": "componentWillUnmount", - "prefix": "cwun", - "body": "componentWillUnmount() {\n $0\n}\n", - "description": "Invoked immediately before a component is unmounted from the DOM.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "getDerivedStateFromProps": { - "key": "getDerivedStateFromProps", - "prefix": "gdsfp", - "body": "static getDerivedStateFromProps(props, state) {\n $0\n}", - "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "getSnapshotBeforeUpdate": { - "key": "getSnapshotBeforeUpdate", - "prefix": "gsbu", - "body": "getSnapshotBeforeUpdate = (prevProps, prevState) => {\n $0\n}\n", - "description": "Called right before mutations are made (e.g. before the DOM is updated)", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "createContext": { - "key": "createContext", - "prefix": "rcontext", - "body": ["const $0 = React.createContext();", ""], - "description": "Create React context", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "createRef": { - "key": "createRef", - "prefix": "cref", - "body": ["this.$0Ref = React.createRef();", ""], - "description": "Create ref statement used inside constructor", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentSetStateObject": { - "key": "componentSetStateObject", - "prefix": "sst", - "body": ["this.setState({ $0 });", ""], - "description": "Performs a shallow merge of nextState into current state", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentSetStateFunc": { - "key": "componentSetStateFunc", - "prefix": "ssf", - "body": [ - "this.setState((state, props) => {", - " return { $0 };", - "});", - "" - ], - "description": "Performs a shallow merge of nextState into current state", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentProps": { - "key": "componentProps", - "prefix": "props", - "body": ["this.props.$0;", ""], - "description": "Access component's props", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentState": { - "key": "componentState", - "prefix": "state", - "body": ["this.state.$0;", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "bindThis": { - "key": "bindThis", - "prefix": "bnd", - "body": ["this.${1:first} = this.${1:first}.bind(this);", ""], - "description": "Binds this to a method", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "commentBigBlock": { - "key": "commentBigBlock", - "prefix": "cmmb", - "body": ["/**", " * $0", " */", ""], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "hocComponentWithRedux": { - "key": "hocComponentWithRedux", - "prefix": "hocredux", - "body": [ - "import { connect } from 'react-redux';", - "import PropTypes from 'prop-types';", - "", - "export const mapStateToProps = (state) => ({});", - "", - "export const mapDispatchToProps = {};", - "", - "export const ${1:first} = (WrappedComponent) => {", - " const hocComponent = ({ ...props }) => ;", - "", - " hocComponent.propTypes = {};", - "", - " return hocComponent;", - "};", - "", - "export default (WrapperComponent) =>", - " connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent));", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "hocComponent": { - "key": "hocComponent", - "prefix": "hoc", - "body": [ - "import PropTypes from 'prop-types';", - "", - "export default (WrappedComponent) => {", - " const hocComponent = ({ ...props }) => ;", - "", - " hocComponent.propTypes = {};", - "", - " return hocComponent;", - "};", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typeofSnippet": { - "key": "typeofSnippet", - "prefix": "tpf", - "body": "typeof $0;", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - } -} +{} diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts index ba042ca..ea2c116 100644 --- a/src/sourceSnippets/imports.ts +++ b/src/sourceSnippets/imports.ts @@ -32,19 +32,19 @@ export type ImportsSnippet = SnippetMapping; const importReact: ImportsSnippet = { key: 'importReact', prefix: 'imr', - body: ["import React from 'react'", ''], + body: ["import React from 'react'"], }; const importReactDom: ImportsSnippet = { key: 'importReactDom', prefix: 'imrd', - body: ["import ReactDOM from 'react-dom'", ''], + body: ["import ReactDOM from 'react-dom'"], }; const importReactWithComponent: ImportsSnippet = { key: 'importReactWithComponent', prefix: 'imrc', - body: ["import React, { Component } from 'react'", ''], + body: ["import React, { Component } from 'react'"], }; const importReactWithComponentAndPropTypes: ImportsSnippet = { @@ -60,7 +60,7 @@ const importReactWithComponentAndPropTypes: ImportsSnippet = { const importReactWithPureComponent: ImportsSnippet = { key: 'importReactWithPureComponent', prefix: 'imrpc', - body: ["import React, { PureComponent } from 'react'", ''], + body: ["import React, { PureComponent } from 'react'"], }; const importReactWithPureComponentAndPropTypes: ImportsSnippet = { @@ -76,7 +76,7 @@ const importReactWithPureComponentAndPropTypes: ImportsSnippet = { const importReactWithMemo: ImportsSnippet = { key: 'importReactWithMemo', prefix: 'imrm', - body: ["import React, { memo } from 'react'", ''], + body: ["import React, { memo } from 'react'"], }; const importReactWithMemoAndPropTypes: ImportsSnippet = { @@ -92,7 +92,7 @@ const importReactWithMemoAndPropTypes: ImportsSnippet = { const importPropTypes: ImportsSnippet = { key: 'importPropTypes', prefix: 'impt', - body: ["import PropTypes from 'prop-types'", ''], + body: ["import PropTypes from 'prop-types'"], }; /** @@ -102,7 +102,7 @@ const importPropTypes: ImportsSnippet = { const importBrowserRouter: ImportsSnippet = { key: 'importBrowserRouter', prefix: 'imbr', - body: ["import { BrowserRouter as Router } from 'react-router-dom'", ''], + body: ["import { BrowserRouter as Router } from 'react-router-dom'"], }; const importBrowserRouterWithRouteAndNavLink: ImportsSnippet = { @@ -117,25 +117,25 @@ const importBrowserRouterWithRouteAndNavLink: ImportsSnippet = { const importRouterSetup: ImportsSnippet = { key: 'importRouterSetup', prefix: 'imbrc', - body: ["import { Route, Switch, NavLink, Link } from 'react-router-dom'", ''], + body: ["import { Route, Switch, NavLink, Link } from 'react-router-dom'"], }; const importRouterSwitch: ImportsSnippet = { key: 'importRouterSwitch', prefix: 'imbrs', - body: ["import { Switch } from 'react-router-dom'", ''], + body: ["import { Switch } from 'react-router-dom'"], }; const importRouterLink: ImportsSnippet = { key: 'importRouterLink', prefix: 'imbrl', - body: ["import { Link } from 'react-router-dom'", ''], + body: ["import { Link } from 'react-router-dom'"], }; const importRouterNavLink: ImportsSnippet = { key: 'importRouterNavLink', prefix: 'imbrnl', - body: ["import { NavLink } from 'react-router-dom'", ''], + body: ["import { NavLink } from 'react-router-dom'"], }; /** @@ -145,16 +145,13 @@ const importRouterNavLink: ImportsSnippet = { const importSnippet: ImportsSnippet = { key: 'import', prefix: 'imp', - body: [ - `import ${Placeholders.SecondTab} from '${Placeholders.FirstTab}'`, - Placeholders.LastTab, - ], + body: [`import ${Placeholders.SecondTab} from '${Placeholders.FirstTab}'`], }; const importNoModuleName: ImportsSnippet = { key: 'importNoModuleName', prefix: 'imn', - body: [`import '${Placeholders.FirstTab}'`, Placeholders.LastTab], + body: [`import '${Placeholders.FirstTab}'`], }; const importDestructing: ImportsSnippet = { @@ -162,7 +159,6 @@ const importDestructing: ImportsSnippet = { prefix: 'imd', body: [ `import { ${Placeholders.SecondTab} } from '${Placeholders.FirstTab}'`, - Placeholders.LastTab, ], }; @@ -171,7 +167,6 @@ const importEverything: ImportsSnippet = { prefix: 'ime', body: [ `import * as ${Placeholders.SecondTab} from '${Placeholders.FirstTab}'`, - Placeholders.LastTab, ], }; @@ -180,7 +175,6 @@ const importAs: ImportsSnippet = { prefix: 'ima', body: [ `import { ${Placeholders.SecondTab} as ${Placeholders.ThirdTab} } from '${Placeholders.FirstTab}'`, - Placeholders.LastTab, ], }; diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts index 04acde8..e9e035e 100644 --- a/src/sourceSnippets/others.ts +++ b/src/sourceSnippets/others.ts @@ -48,7 +48,7 @@ export type OthersSnippet = SnippetMapping; const exportDefault: OthersSnippet = { key: 'exportDefault', prefix: 'exp', - body: [`export default ${Placeholders.LastTab}`, ''], + body: [`export default ${Placeholders.FirstTab}`], }; const exportDestructing: OthersSnippet = { @@ -56,7 +56,6 @@ const exportDestructing: OthersSnippet = { prefix: 'exd', body: [ `export { ${Placeholders.SecondTab} } from '${Placeholders.FirstTab}'`, - Placeholders.LastTab, ], }; @@ -65,7 +64,6 @@ const exportAs: OthersSnippet = { prefix: 'exa', body: [ `export { ${Placeholders.SecondTab} as ${Placeholders.ThirdTab} } from '${Placeholders.FirstTab}'`, - Placeholders.LastTab, ], }; @@ -73,8 +71,7 @@ const exportNamedFunction: OthersSnippet = { key: 'exportNamedFunction', prefix: 'enf', body: [ - `export const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.LastTab}}`, - '', + `export const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.ThirdTab}}`, ], description: 'Export named function', }; @@ -83,8 +80,7 @@ const exportDefaultFunction: OthersSnippet = { key: 'exportDefaultFunction', prefix: 'edf', body: [ - `export default (${Placeholders.FirstTab}) => {${Placeholders.LastTab}}`, - '', + `export default (${Placeholders.FirstTab}) => {${Placeholders.SecondTab}}`, ], description: 'Export default function', }; @@ -93,8 +89,7 @@ const exportDefaultNamedFunction: OthersSnippet = { key: 'exportDefaultNamedFunction', prefix: 'ednf', body: [ - `export default function ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, - '', + `export default function ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, ], description: 'Export default named function', }; @@ -103,8 +98,7 @@ const method: OthersSnippet = { key: 'method', prefix: 'met', body: [ - `${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.LastTab}}`, - '', + `${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.ThirdTab}}`, ], description: 'Creates a method inside a class', }; @@ -114,7 +108,7 @@ const propertyGet: OthersSnippet = { prefix: 'pge', body: [ `get ${Placeholders.FirstTab}() {`, - ` return this.${Placeholders.LastTab}`, + ` return this.${Placeholders.SecondTab}`, '}', '', ], @@ -125,8 +119,7 @@ const propertySet: OthersSnippet = { key: 'propertySet', prefix: 'pse', body: [ - `set ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, - '', + `set ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, ], description: 'Creates a setter property inside a class', }; @@ -135,10 +128,7 @@ const forEach: OthersSnippet = { key: 'forEach', prefix: 'fre', body: [ - `${Placeholders.FirstTab}.forEach(${Placeholders.SecondTab} => {`, - ` ${Placeholders.LastTab}`, - '})', - '', + `${Placeholders.FirstTab}.forEach(${Placeholders.SecondTab} => {${Placeholders.LastTab}})`, ], description: 'Creates a forEach statement', }; @@ -147,10 +137,7 @@ const forOf: OthersSnippet = { key: 'forOf', prefix: 'fof', body: [ - `for(let ${Placeholders.FirstTab} of ${Placeholders.SecondTab}) {`, - ` ${Placeholders.LastTab}`, - '}', - '', + `for(let ${Placeholders.FirstTab} of ${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, ], description: 'Iterating over property names of iterable objects', }; @@ -159,10 +146,7 @@ const forIn: OthersSnippet = { key: 'forIn', prefix: 'fin', body: [ - `for(let ${Placeholders.FirstTab} in ${Placeholders.SecondTab}) {`, - ` ${Placeholders.LastTab}`, - '}', - '', + `for(let ${Placeholders.FirstTab} in ${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, ], description: 'Iterating over property values of iterable objects', }; @@ -178,10 +162,7 @@ const namedFunction: OthersSnippet = { key: 'namedFunction', prefix: 'nfn', body: [ - `const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {`, - ` ${Placeholders.ThirdTab}`, - '}', - '', + `const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.ThirdTab}}`, ], description: 'Creates a named function', }; @@ -189,14 +170,14 @@ const namedFunction: OthersSnippet = { const destructingObject: OthersSnippet = { key: 'destructingObject', prefix: 'dob', - body: [`const {${Placeholders.SecondTab}} = ${Placeholders.FirstTab}`, ''], + body: [`const {${Placeholders.SecondTab}} = ${Placeholders.FirstTab}`], description: 'Creates and assigns a local variable using object destructing', }; const destructingArray: OthersSnippet = { key: 'destructingArray', prefix: 'dar', - body: [`const [${Placeholders.SecondTab}] = ${Placeholders.FirstTab}`, ''], + body: [`const [${Placeholders.SecondTab}] = ${Placeholders.FirstTab}`], description: 'Creates and assigns a local variable using array destructing', }; @@ -205,8 +186,8 @@ const setInterval: OthersSnippet = { prefix: 'sti', body: [ 'setInterval(() => {', - ` ${Placeholders.SecondTab}`, - `}, ${Placeholders.LastTab})`, + ` ${Placeholders.FirstTab}`, + `}, ${Placeholders.SecondTab})`, '', ], description: 'Executes the given function at specified intervals', @@ -239,14 +220,14 @@ const promise: OthersSnippet = { const destructProps: OthersSnippet = { key: 'destructProps', prefix: 'cp', - body: [`const { ${Placeholders.LastTab} } = this.props`, ''], + body: [`const { ${Placeholders.FirstTab} } = this.props`], description: 'Creates and assigns a local variable using props destructing', }; const destructState: OthersSnippet = { key: 'destructState', prefix: 'cs', - body: [`const { ${Placeholders.LastTab} } = this.state`, ''], + body: [`const { ${Placeholders.FirstTab} } = this.state`], description: 'Creates and assigns a local variable using state destructing', }; @@ -258,7 +239,7 @@ const classConstructor: OthersSnippet = { ' super(props)', '', ' this.state = {', - ` ${Placeholders.LastTab}`, + ` ${Placeholders.FirstTab}`, ' }', '}', '', @@ -270,14 +251,14 @@ const classConstructor: OthersSnippet = { const emptyState: OthersSnippet = { key: 'emptyState', prefix: 'est', - body: ['state = {', ` ${Placeholders.LastTab}`, '}', ''], + body: ['state = {', ` ${Placeholders.FirstTab}`, '}'], description: 'Creates empty state object. To be used in a constructor.', }; const componentDidMount: OthersSnippet = { key: 'componentDidMount', prefix: 'cdm', - body: ['componentDidMount() {', ` ${Placeholders.LastTab}`, '}', ''], + body: ['componentDidMount() {', ` ${Placeholders.FirstTab}`, '}'], description: 'Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.', }; @@ -287,7 +268,7 @@ const shouldComponentUpdate: OthersSnippet = { prefix: 'scu', body: [ 'shouldComponentUpdate(nextProps, nextState) {', - ` ${Placeholders.LastTab}`, + ` ${Placeholders.FirstTab}`, '}', '', ], @@ -311,7 +292,7 @@ const componentDidUpdate: OthersSnippet = { const componentWillUnmount: OthersSnippet = { key: 'componentWillUnmount', prefix: 'cwun', - body: ['componentWillUnmount() {', ` ${Placeholders.LastTab}`, '}', ''], + body: ['componentWillUnmount() {', ` ${Placeholders.FirstTab}`, '}'], description: 'Invoked immediately before a component is unmounted from the DOM.', }; @@ -320,9 +301,7 @@ const getDerivedStateFromProps: OthersSnippet = { key: 'getDerivedStateFromProps', prefix: 'gdsfp', body: [ - 'static getDerivedStateFromProps(props, state) {', - ` ${Placeholders.LastTab}`, - '}', + `static getDerivedStateFromProps(props, state) {${Placeholders.FirstTab}}`, ], description: 'Invoked right before calling the render method, both on the initial mount and on subsequent updates.', @@ -332,10 +311,7 @@ const getSnapshotBeforeUpdate: OthersSnippet = { key: 'getSnapshotBeforeUpdate', prefix: 'gsbu', body: [ - 'getSnapshotBeforeUpdate = (prevProps, prevState) => {', - ` ${Placeholders.LastTab}`, - '}', - '', + `getSnapshotBeforeUpdate = (prevProps, prevState) => {${Placeholders.LastTab}}`, ], description: 'Called right before mutations are made (e.g. before the DOM is updated)', @@ -344,21 +320,21 @@ const getSnapshotBeforeUpdate: OthersSnippet = { const createContext: OthersSnippet = { key: 'createContext', prefix: 'rcontext', - body: [`const ${Placeholders.LastTab} = React.createContext()`, ''], + body: [`const ${Placeholders.LastTab} = React.createContext()`], description: 'Create React context', }; const createRef: OthersSnippet = { key: 'createRef', prefix: 'cref', - body: [`this.${Placeholders.LastTab}Ref = React.createRef()`, ''], + body: [`this.${Placeholders.LastTab}Ref = React.createRef()`], description: 'Create ref statement used inside constructor', }; const componentSetStateObject: OthersSnippet = { key: 'componentSetStateObject', prefix: 'sst', - body: [`this.setState({${Placeholders.LastTab}})`, ''], + body: [`this.setState({${Placeholders.LastTab}})`], description: 'Performs a shallow merge of nextState into current state', }; @@ -367,7 +343,6 @@ const componentSetStateFunc: OthersSnippet = { prefix: 'ssf', body: [ `this.setState((state, props) => { return { ${Placeholders.LastTab} }})`, - '', ], description: 'Performs a shallow merge of nextState into current state', }; @@ -375,14 +350,14 @@ const componentSetStateFunc: OthersSnippet = { const componentProps: OthersSnippet = { key: 'componentProps', prefix: 'props', - body: [`this.props.${Placeholders.LastTab}`, ''], + body: [`this.props.${Placeholders.LastTab}`], description: "Access component's props", }; const componentState: OthersSnippet = { key: 'componentState', prefix: 'state', - body: [`this.state.${Placeholders.LastTab}`, ''], + body: [`this.state.${Placeholders.LastTab}`], }; const bindThis: OthersSnippet = { @@ -390,7 +365,6 @@ const bindThis: OthersSnippet = { prefix: 'bnd', body: [ `this.${Placeholders.FirstTab} = this.${Placeholders.FirstTab}.bind(this)`, - '', ], description: 'Binds this to a method', }; diff --git a/src/sourceSnippets/reactNative.ts b/src/sourceSnippets/reactNative.ts index d881900..2c8db65 100644 --- a/src/sourceSnippets/reactNative.ts +++ b/src/sourceSnippets/reactNative.ts @@ -23,7 +23,7 @@ type ReactNativeMapping = { export type ReactNativeSnippet = SnippetMapping; -const reactNativeStylesSnippet = ['const styles = StyleSheet.create({})', '']; +const reactNativeStylesSnippet = ['const styles = StyleSheet.create({})']; const reactNativeComponentReturn = [ ' render() {', ' return (', @@ -45,18 +45,13 @@ const reactNativeReturn = [ const reactNativeImport: ReactNativeSnippet = { key: 'reactNativeImport', prefix: 'imrn', - body: [`import { ${Placeholders.LastTab} } from 'react-native'`, ''], + body: [`import { ${Placeholders.LastTab} } from 'react-native'`], }; const reactNativeStyles: ReactNativeSnippet = { key: 'reactNativeStyles', prefix: 'rnstyle', - body: [ - 'const styles = StyleSheet.create({', - ` ${Placeholders.LastTab}`, - '})', - '', - ], + body: [`const styles = StyleSheet.create({${Placeholders.LastTab}})`], }; const reactNativeComponent: ReactNativeSnippet = { @@ -65,10 +60,10 @@ const reactNativeComponent: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactComponent, + '', `export default class ${Placeholders.FileName} extends Component {`, ...reactNativeComponentReturn, '}', - '', ], }; @@ -78,6 +73,7 @@ const reactNativeComponentWithStyles: ReactNativeSnippet = { body: [ "import { Text, StyleSheet, View } from 'react-native'", ...reactComponent, + '', `export default class ${Placeholders.FileName} extends Component {`, ...reactNativeComponentReturn, '}', @@ -92,6 +88,7 @@ const reactNativeComponentExport: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactComponent, + '', `export class ${Placeholders.FileName} extends Component {`, ...reactNativeComponentReturn, '}', @@ -105,10 +102,10 @@ const reactNativePureComponent: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactPureComponent, + '', `export default class ${Placeholders.FileName} extends PureComponent {`, ...reactNativeComponentReturn, '}', - '', ], }; @@ -118,6 +115,7 @@ const reactNativePureComponentExport: ReactNativeSnippet = { body: [ "import { Text, View } from 'react-native'", ...reactPureComponent, + '', `export class ${Placeholders.FileName} extends PureComponent {`, ...reactNativeComponentReturn, '}', @@ -131,6 +129,7 @@ const reactNativeFunctionalExportComponent: ReactNativeSnippet = { body: [ "import { View, Text } from 'react-native'", ...react, + '', `const ${Placeholders.FileName} = () => {`, ...reactNativeReturn, '}', @@ -144,6 +143,7 @@ const reactNativeFunctionalExportComponentWithStyles: ReactNativeSnippet = { body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, + '', `const ${Placeholders.FileName} = () => {`, ...reactNativeReturn, '}', @@ -159,10 +159,10 @@ const reactNativeFunctionalComponent: ReactNativeSnippet = { body: [ "import { View, Text } from 'react-native'", ...react, + '', `export default function ${Placeholders.FileName}() {`, ...reactNativeReturn, '}', - '', ], }; @@ -172,6 +172,7 @@ const reactNativeFunctionalComponentWithStyles: ReactNativeSnippet = { body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, + '', `export default function ${Placeholders.FileName}() {`, ...reactNativeReturn, '}', diff --git a/src/sourceSnippets/redux.ts b/src/sourceSnippets/redux.ts index c77b148..ed1149f 100644 --- a/src/sourceSnippets/redux.ts +++ b/src/sourceSnippets/redux.ts @@ -15,7 +15,7 @@ export type ReduxSnippet = SnippetMapping; const importReduxConnect: ReduxSnippet = { key: 'importReduxConnect', prefix: 'redux', - body: ["import { connect } from 'react-redux'", ''], + body: ["import { connect } from 'react-redux'"], }; const reduxAction: ReduxSnippet = { @@ -63,7 +63,6 @@ const reduxSelector: ReduxSnippet = { "import { createSelector } from 'reselect'", '', `export const ${Placeholders.FirstTab} = state => state.${Placeholders.SecondTab}`, - '', ], }; @@ -96,7 +95,6 @@ const mappingToProps: ReduxSnippet = { 'const mapStateToProps = (state) => ({})', '', 'const mapDispatchToProps = {}', - '', ], }; diff --git a/src/sourceSnippets/sharedSnippets.ts b/src/sourceSnippets/sharedSnippets.ts index 3f9e367..72e0848 100644 --- a/src/sourceSnippets/sharedSnippets.ts +++ b/src/sourceSnippets/sharedSnippets.ts @@ -1,30 +1,26 @@ import { Placeholders } from '../types'; -export const reactComponent = ["import React, { Component } from 'react'", '']; -export const react = ["import React from 'react'", '']; +export const reactComponent = ["import React, { Component } from 'react'"]; +export const react = ["import React from 'react'"]; export const reactPureComponent = [ "import React, { PureComponent } from 'react'", - '', ]; export const reactPropTypes = [ "import React from 'react'", "import PropTypes from 'prop-types'", - '', ]; export const reactWithReduxConnect = [ "import React from 'react'", "import { connect } from 'react-redux'", - '', ]; export const reactComponentWithReduxConnect = [ "import React, { Component } from 'react'", "import { connect } from 'react-redux'", - '', ]; -export const reactWithMemo = ["import React, { memo } from 'react'", '']; +export const reactWithMemo = ["import React, { memo } from 'react'"]; export const reduxComponentExport = [ '', @@ -33,32 +29,23 @@ export const reduxComponentExport = [ 'const mapDispatchToProps = {}', '', `export default connect(mapStateToProps, mapDispatchToProps)(${Placeholders.FileName})`, - '', ]; export const innerComponent = [ ' return (', - '
', - ` ${Placeholders.LastTab}`, - '
', + `
${Placeholders.LastTab}
`, ' )', ]; export const innerComponentReturn = [ ' render() {', ' return (', - '
', - ` ${Placeholders.LastTab}`, - '
', + `
${Placeholders.LastTab}
`, ' )', ' }', ]; -export const exportDefault = [ - '', - `export default ${Placeholders.FileName}`, - '', -]; +export const exportDefault = ['', `export default ${Placeholders.FileName}`]; export const propsTypeInterface = [Placeholders.TypeProps, '']; export const stateTypeInterface = [Placeholders.TypeState, '']; diff --git a/src/sourceSnippets/tests.ts b/src/sourceSnippets/tests.ts index 1a9612c..8a9f13c 100644 --- a/src/sourceSnippets/tests.ts +++ b/src/sourceSnippets/tests.ts @@ -21,7 +21,6 @@ const describeBlock: TestsSnippet = { `describe('${Placeholders.FirstTab}', () => {`, ` ${Placeholders.LastTab}`, '})', - '', ], description: 'Testing `describe` block', }; @@ -32,7 +31,6 @@ const testBlock: TestsSnippet = { `test('should ${Placeholders.FirstTab}', () => {`, ` ${Placeholders.LastTab}`, '})', - '', ], description: 'Testing `test` block', }; @@ -43,7 +41,6 @@ const testAsyncBlock: TestsSnippet = { `test('should ${Placeholders.FirstTab}', async () => {`, ` ${Placeholders.LastTab}`, '})', - '', ], description: 'Testing `asynchronous test` block', }; @@ -54,7 +51,6 @@ const itBlock: TestsSnippet = { `it('should ${Placeholders.FirstTab}', () => {`, ` ${Placeholders.LastTab}`, '})', - '', ], description: 'Testing `it` block', }; @@ -65,7 +61,6 @@ const itAsyncBlock: TestsSnippet = { `it('should ${Placeholders.FirstTab}', async () => {`, ` ${Placeholders.LastTab}`, '})', - '', ], description: 'Testing asynchronous `it` block', }; @@ -86,7 +81,6 @@ const setupReactTest: TestsSnippet = { ' expect(wrapper).toMatchSnapshot()', ' })', '})', - '', ], }; const setupReactNativeTest: TestsSnippet = { @@ -107,7 +101,6 @@ const setupReactNativeTest: TestsSnippet = { ' expect(wrapper).toMatchSnapshot()', ' })', '})', - '', ], }; const setupReactComponentTestWithRedux: TestsSnippet = { @@ -133,7 +126,6 @@ const setupReactComponentTestWithRedux: TestsSnippet = { ' expect(wrapper).toMatchSnapshot()', ' })', '})', - '', ], description: 'Create test component', }; @@ -161,7 +153,6 @@ const setupReactNativeTestWithRedux: TestsSnippet = { ' expect(wrapper).toMatchSnapshot()', ' })', '})', - '', ], }; diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts index cfa07d3..3b3657c 100644 --- a/src/sourceSnippets/typescript.ts +++ b/src/sourceSnippets/typescript.ts @@ -41,10 +41,7 @@ const exportType: TypescriptSnippet = { const exportInterface: TypescriptSnippet = { key: 'exportInterface', prefix: 'expint', - body: [ - `export interface ${Placeholders.FirstTab} {${Placeholders.LastTab}}`, - '', - ], + body: [`export interface ${Placeholders.FirstTab} {${Placeholders.LastTab}}`], }; const typescriptReactClassComponent: TypescriptSnippet = { @@ -60,7 +57,6 @@ const typescriptReactClassComponent: TypescriptSnippet = { '', ...innerComponentReturn, '}', - '', ], }; @@ -105,7 +101,6 @@ const typescriptReactFunctionalComponent: TypescriptSnippet = { `export default function ${Placeholders.FileName}({}: Props) {`, ...innerComponent, '}', - '', ], description: 'Creates a React Functional Component with ES7 module system and TypeScript interface', @@ -135,7 +130,6 @@ const typescriptReactArrowFunctionComponent: TypescriptSnippet = { `const ${Placeholders.FileName} = (props: Props) => {`, ...innerComponent, '}', - '', ], description: 'Creates a React Arrow Function Component with ES7 module system and TypeScript interface', @@ -150,7 +144,6 @@ const typescriptReactClassPureComponent: TypescriptSnippet = { `export default class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, '}', - '', ], description: 'Creates a React pure component class with ES7 module system and TypeScript interface', @@ -246,8 +239,8 @@ const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = ' )', '}', ...exportDefault, - 'const styles = StyleSheet.create({})', '', + 'const styles = StyleSheet.create({})', ], description: 'Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet', diff --git a/tsconfig.json b/tsconfig.json index c3b0b61..c1aa99d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,11 +2,6 @@ "compilerOptions": { "allowJs": true, "allowSyntheticDefaultImports": true, - "baseUrl": ".", - "paths": { - "./*": ["./src/*"], - "./src/*": ["./src/*"] - }, "esModuleInterop": true, "module": "amd", "moduleResolution": "Node", From a5316493a0426ba70cc11b14092be2b9916b2a7c Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 00:42:17 +0100 Subject: [PATCH 094/110] fix: ts snippets --- src/sourceSnippets/typescript.ts | 39 +++++++++++--------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts index 3b3657c..05c8cdd 100644 --- a/src/sourceSnippets/typescript.ts +++ b/src/sourceSnippets/typescript.ts @@ -22,11 +22,9 @@ type TypescriptMappings = { typescriptReactClassExportComponent: 'tsrce'; typescriptReactClassExportPureComponent: 'tsrpce'; typescriptReactClassPureComponent: 'tsrpc'; - typescriptReactFunctionMemoComponent: 'tsrmc'; typescriptReactFunctionalComponent: 'tsrfc'; typescriptReactFunctionalExportComponent: 'tsrfce'; typescriptReactNativeArrowFunctionComponent: 'tsrnf'; - typescriptReactNativeArrowFunctionComponentNamedProps: 'tsrnfi'; typescriptReactNativeArrowFunctionComponentWithStyles: 'tsrnfs'; }; @@ -41,7 +39,7 @@ const exportType: TypescriptSnippet = { const exportInterface: TypescriptSnippet = { key: 'exportInterface', prefix: 'expint', - body: [`export interface ${Placeholders.FirstTab} {${Placeholders.LastTab}}`], + body: [`export interface ${Placeholders.FirstTab} {}`], }; const typescriptReactClassComponent: TypescriptSnippet = { @@ -51,6 +49,7 @@ const typescriptReactClassComponent: TypescriptSnippet = { 'Creates a React component class with ES7 module system and TypeScript interfaces', body: [ ...reactComponent, + '', ...propsStateInterface, `export default class ${Placeholders.FileName} extends Component {`, ' state = {}', @@ -65,6 +64,7 @@ const typescriptReactClassExportComponent: TypescriptSnippet = { prefix: 'tsrce', body: [ ...reactComponent, + '', ...propsStateInterface, `class ${Placeholders.FileName} extends Component {`, ' state = {}', @@ -82,6 +82,7 @@ const typescriptReactFunctionalExportComponent: TypescriptSnippet = { prefix: 'tsrfce', body: [ ...react, + '', ...propsTypeInterface, `function ${Placeholders.FileName}({}: Props) {`, ...innerComponent, @@ -97,6 +98,7 @@ const typescriptReactFunctionalComponent: TypescriptSnippet = { prefix: 'tsrfc', body: [ ...react, + '', ...propsTypeInterface, `export default function ${Placeholders.FileName}({}: Props) {`, ...innerComponent, @@ -111,6 +113,7 @@ const typescriptReactArrowFunctionExportComponent: TypescriptSnippet = { prefix: 'tsrafce', body: [ ...react, + '', ...propsTypeInterface, `const ${Placeholders.FileName} = (props: Props) => {`, ...innerComponent, @@ -126,6 +129,7 @@ const typescriptReactArrowFunctionComponent: TypescriptSnippet = { prefix: 'tsrafc', body: [ ...react, + '', ...propsTypeInterface, `const ${Placeholders.FileName} = (props: Props) => {`, ...innerComponent, @@ -140,6 +144,7 @@ const typescriptReactClassPureComponent: TypescriptSnippet = { prefix: 'tsrpc', body: [ ...reactPureComponent, + '', ...propsTypeInterface, `export default class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, @@ -154,6 +159,7 @@ const typescriptReactClassExportPureComponent: TypescriptSnippet = { prefix: 'tsrpce', body: [ ...reactPureComponent, + '', ...propsTypeInterface, `class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, @@ -170,6 +176,7 @@ const typescriptReactClassComponentRedux: TypescriptSnippet = { body: [ "import { connect } from 'react-redux'", ...reactComponent, + '', ...propsStateInterface, `export class ${Placeholders.FileName} extends Component {`, ' state = {}', @@ -188,6 +195,7 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = { body: [ "import { View, Text } from 'react-native'", ...react, + '', ...propsTypeInterface, `const ${Placeholders.FileName} = (props: Props) => {`, ' return (', @@ -199,30 +207,9 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = { ...exportDefault, ], description: - 'Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface', + 'Creates a React Native Arrow Function Component with ES7 module system in TypeScript', }; -const typescriptReactNativeArrowFunctionComponentNamedProps: TypescriptSnippet = - { - key: 'typescriptReactNativeArrowFunctionComponentNamedProps', - prefix: 'tsrnfi', - body: [ - "import { View } from 'react-native'", - ...react, - ...propsTypeInterface, - `const ${Placeholders.FileName}: React.FC<${Placeholders.FileName}Props> = (props) => {`, - ' return (', - ' ', - ` ${Placeholders.LastTab}`, - ' ', - ' )', - '}', - ...exportDefault, - ], - description: - 'Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface', - }; - const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = { key: 'typescriptReactNativeArrowFunctionComponentWithStyles', @@ -230,6 +217,7 @@ const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = body: [ "import { StyleSheet, Text, View } from 'react-native'", ...react, + '', ...propsTypeInterface, `const ${Placeholders.FileName} = (props: Props) => {`, ' return (', @@ -259,6 +247,5 @@ export default [ typescriptReactClassExportPureComponent, typescriptReactClassComponentRedux, typescriptReactNativeArrowFunctionComponent, - typescriptReactNativeArrowFunctionComponentNamedProps, typescriptReactNativeArrowFunctionComponentWithStyles, ]; From fa001289faf6840470dcf095d284fd5fe56eb1d9 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 01:01:53 +0100 Subject: [PATCH 095/110] chore: remove LastTab placeholder --- src/helpers/snippetPlaceholders.ts | 2 - src/sourceSnippets/components.ts | 24 +++++++++-- src/sourceSnippets/imports.ts | 10 ++--- src/sourceSnippets/others.ts | 61 ++++++++++------------------ src/sourceSnippets/reactNative.ts | 8 ++-- src/sourceSnippets/sharedSnippets.ts | 4 +- src/sourceSnippets/tests.ts | 20 +++------ src/sourceSnippets/typescript.ts | 10 +++-- src/types.ts | 2 - 9 files changed, 63 insertions(+), 78 deletions(-) diff --git a/src/helpers/snippetPlaceholders.ts b/src/helpers/snippetPlaceholders.ts index 72595ff..5896a82 100644 --- a/src/helpers/snippetPlaceholders.ts +++ b/src/helpers/snippetPlaceholders.ts @@ -18,7 +18,6 @@ export const replaceSnippetPlaceholders = (snippetString: string) => { .replace(new RegExp(Placeholders.FirstTab, 'g'), '${1:first}') .replace(new RegExp(Placeholders.SecondTab, 'g'), '${2:second}') .replace(new RegExp(Placeholders.ThirdTab, 'g'), '${3:third}') - .replace(new RegExp(Placeholders.LastTab, 'g'), '$0') .replace( new RegExp(Placeholders.Capitalize, 'g'), '${1/(.*)/${1:/capitalize}/}', @@ -36,7 +35,6 @@ export const revertSnippetPlaceholders = (snippetString: string) => { .replace(new RegExp(/\${1:first}/, 'g'), Placeholders.FirstTab) .replace(new RegExp(/\${2:second}/, 'g'), Placeholders.SecondTab) .replace(new RegExp(/\${3:third}/, 'g'), Placeholders.ThirdTab) - .replace(new RegExp(/\$0/, 'g'), Placeholders.LastTab) .replace( new RegExp(/\${1\/(.*)\/${1:\/capitalize}\/}/, 'g'), Placeholders.Capitalize, diff --git a/src/sourceSnippets/components.ts b/src/sourceSnippets/components.ts index a67fc0f..4889457 100644 --- a/src/sourceSnippets/components.ts +++ b/src/sourceSnippets/components.ts @@ -43,6 +43,7 @@ const reactClassComponent: ComponentsSnippet = { prefix: 'rcc', body: [ ...reactComponent, + '', `export default class ${Placeholders.FileName} extends Component {`, ...innerComponentReturn, '}', @@ -56,6 +57,7 @@ const reactClassExportComponent: ComponentsSnippet = { prefix: 'rce', body: [ ...reactComponent, + '', `export class ${Placeholders.FileName} extends Component {`, ...innerComponentReturn, '}', @@ -69,6 +71,7 @@ const reactFunctionalExportComponent: ComponentsSnippet = { prefix: 'rfce', body: [ ...react, + '', `function ${Placeholders.FileName}() {`, ...innerComponent, '}', @@ -82,6 +85,7 @@ const reactFunctionalComponent: ComponentsSnippet = { prefix: 'rfc', body: [ ...react, + '', `export default function ${Placeholders.FileName}() {`, ...innerComponent, '}', @@ -95,6 +99,7 @@ const reactFunctionalComponentWithPropTypes: ComponentsSnippet = { prefix: 'rfcp', body: [ ...reactPropTypes, + '', `function ${Placeholders.FileName}(props) {`, ...innerComponent, '}', @@ -112,6 +117,7 @@ const reactArrowFunctionExportComponent: ComponentsSnippet = { prefix: 'rafce', body: [ ...react, + '', `const ${Placeholders.FileName} = () => {`, ...innerComponent, '}', @@ -126,6 +132,7 @@ const reactArrowFunctionComponent: ComponentsSnippet = { prefix: 'rafc', body: [ ...react, + '', `export const ${Placeholders.FileName} = () => {`, ...innerComponent, '}', @@ -140,6 +147,7 @@ const reactArrowFunctionComponentWithPropTypes: ComponentsSnippet = { prefix: 'rafcp', body: [ ...reactPropTypes, + '', `const ${Placeholders.FileName} = props => {`, ...innerComponent, '}', @@ -157,6 +165,7 @@ const reactClassExportComponentWithPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactComponent, + '', `export class ${Placeholders.FileName} extends Component {`, ' static propTypes = {}', '', @@ -172,6 +181,7 @@ const reactClassPureComponent: ComponentsSnippet = { prefix: 'rpc', body: [ ...reactPureComponent, + '', `export default class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, '}', @@ -185,6 +195,7 @@ const reactClassExportPureComponent: ComponentsSnippet = { prefix: 'rpce', body: [ ...reactPureComponent, + '', `export class ${Placeholders.FileName} extends PureComponent {`, ...innerComponentReturn, '}', @@ -200,6 +211,7 @@ const reactClassPureComponentWithPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactPureComponent, + '', `export default class ${Placeholders.FileName} extends PureComponent {`, ' static propTypes = {}', '', @@ -214,7 +226,7 @@ const reactFunctionMemoComponent: ComponentsSnippet = { key: 'reactFunctionMemoComponent', prefix: 'rmc', body: [ - "import React, { memo } from 'react'", + ...reactWithMemo, '', `export default memo(function ${Placeholders.FileName}() {`, ...innerComponent, @@ -230,6 +242,7 @@ const reactFunctionMemoComponentWithPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactWithMemo, + '', `const ${Placeholders.FileName} = memo(function ${Placeholders.FileName}(props) {`, ...innerComponent, '})', @@ -247,10 +260,9 @@ const reactClassComponentPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactComponent, + '', `export default class ${Placeholders.FileName} extends Component {`, - ' static propTypes = {', - ` ${Placeholders.SecondTab}: ${Placeholders.ThirdTab}`, - ' }', + ` static propTypes = {${Placeholders.SecondTab}: ${Placeholders.ThirdTab}}`, '', ...innerComponentReturn, '}', @@ -265,6 +277,7 @@ const reactClassComponentRedux: ComponentsSnippet = { prefix: 'rcredux', body: [ ...reactComponentWithReduxConnect, + '', `export class ${Placeholders.FileName} extends Component {`, ...innerComponentReturn, '}', @@ -280,6 +293,7 @@ const reactClassComponentReduxPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactComponentWithReduxConnect, + '', `export class ${Placeholders.FileName} extends Component {`, ' static propTypes = {', ` ${Placeholders.SecondTab}: ${Placeholders.ThirdTab}`, @@ -298,6 +312,7 @@ const reactFunctionalComponentRedux: ComponentsSnippet = { prefix: 'rfcredux', body: [ ...reactWithReduxConnect, + '', `export const ${Placeholders.FileName} = (props) => {`, ...innerComponent, '}', @@ -313,6 +328,7 @@ const reactFunctionalComponentReduxPropTypes: ComponentsSnippet = { body: [ "import PropTypes from 'prop-types'", ...reactWithReduxConnect, + '', `export const ${Placeholders.FileName} = (props) => {`, ...innerComponent, '}', diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts index ea2c116..f28281b 100644 --- a/src/sourceSnippets/imports.ts +++ b/src/sourceSnippets/imports.ts @@ -1,5 +1,7 @@ import { Placeholders, SnippetMapping } from '../types'; +import { reactWithMemo } from './sharedSnippets'; + type ImportsMappings = { import: 'imp'; importAs: 'ima'; @@ -76,17 +78,13 @@ const importReactWithPureComponentAndPropTypes: ImportsSnippet = { const importReactWithMemo: ImportsSnippet = { key: 'importReactWithMemo', prefix: 'imrm', - body: ["import React, { memo } from 'react'"], + body: reactWithMemo, }; const importReactWithMemoAndPropTypes: ImportsSnippet = { key: 'importReactWithMemoAndPropTypes', prefix: 'imrmp', - body: [ - "import React, { memo } from 'react'", - "import PropTypes from 'prop-types'", - '', - ], + body: [...reactWithMemo, "import PropTypes from 'prop-types'", ''], }; const importPropTypes: ImportsSnippet = { diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts index e9e035e..76bf1db 100644 --- a/src/sourceSnippets/others.ts +++ b/src/sourceSnippets/others.ts @@ -110,7 +110,6 @@ const propertyGet: OthersSnippet = { `get ${Placeholders.FirstTab}() {`, ` return this.${Placeholders.SecondTab}`, '}', - '', ], description: 'Creates a getter property inside a class', }; @@ -128,7 +127,7 @@ const forEach: OthersSnippet = { key: 'forEach', prefix: 'fre', body: [ - `${Placeholders.FirstTab}.forEach(${Placeholders.SecondTab} => {${Placeholders.LastTab}})`, + `${Placeholders.FirstTab}.forEach(${Placeholders.SecondTab} => {${Placeholders.ThirdTab}})`, ], description: 'Creates a forEach statement', }; @@ -137,7 +136,7 @@ const forOf: OthersSnippet = { key: 'forOf', prefix: 'fof', body: [ - `for(let ${Placeholders.FirstTab} of ${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, + `for(let ${Placeholders.FirstTab} of ${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, ], description: 'Iterating over property names of iterable objects', }; @@ -146,7 +145,7 @@ const forIn: OthersSnippet = { key: 'forIn', prefix: 'fin', body: [ - `for(let ${Placeholders.FirstTab} in ${Placeholders.SecondTab}) {${Placeholders.LastTab}}`, + `for(let ${Placeholders.FirstTab} in ${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, ], description: 'Iterating over property values of iterable objects', }; @@ -154,7 +153,7 @@ const forIn: OthersSnippet = { const anonymousFunction: OthersSnippet = { key: 'anonymousFunction', prefix: 'anfn', - body: [`(${Placeholders.FirstTab}) => {`, ` ${Placeholders.SecondTab}`, '}'], + body: [`(${Placeholders.FirstTab}) => { ${Placeholders.SecondTab} }`], description: 'Creates an anonymous function', }; @@ -162,7 +161,7 @@ const namedFunction: OthersSnippet = { key: 'namedFunction', prefix: 'nfn', body: [ - `const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.ThirdTab}}`, + `const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => { ${Placeholders.ThirdTab} }`, ], description: 'Creates a named function', }; @@ -185,10 +184,7 @@ const setInterval: OthersSnippet = { key: 'setInterval', prefix: 'sti', body: [ - 'setInterval(() => {', - ` ${Placeholders.FirstTab}`, - `}, ${Placeholders.SecondTab})`, - '', + `setInterval(() => { ${Placeholders.FirstTab} }, ${Placeholders.SecondTab})`, ], description: 'Executes the given function at specified intervals', }; @@ -197,10 +193,7 @@ const setTimeOut: OthersSnippet = { key: 'setTimeOut', prefix: 'sto', body: [ - 'setTimeout(() => {', - ` ${Placeholders.SecondTab}`, - `}, ${Placeholders.FirstTab})`, - '', + `setTimeout(() => { ${Placeholders.FirstTab} }, ${Placeholders.SecondTab})`, ], description: 'Executes the given function after the specified delay', }; @@ -209,10 +202,7 @@ const promise: OthersSnippet = { key: 'promise', prefix: 'prom', body: [ - 'return new Promise((resolve, reject) => {', - ` ${Placeholders.LastTab}`, - '})', - '', + `return new Promise((resolve, reject) => { ${Placeholders.FirstTab} })`, ], description: 'Creates and returns a new Promise in the standard ES7 syntax', }; @@ -242,7 +232,6 @@ const classConstructor: OthersSnippet = { ` ${Placeholders.FirstTab}`, ' }', '}', - '', ], description: "Adds a default constructor for it('', () => {})the class that contains props as arguments", @@ -251,14 +240,14 @@ const classConstructor: OthersSnippet = { const emptyState: OthersSnippet = { key: 'emptyState', prefix: 'est', - body: ['state = {', ` ${Placeholders.FirstTab}`, '}'], + body: [`state = { ${Placeholders.FirstTab} }`], description: 'Creates empty state object. To be used in a constructor.', }; const componentDidMount: OthersSnippet = { key: 'componentDidMount', prefix: 'cdm', - body: ['componentDidMount() {', ` ${Placeholders.FirstTab}`, '}'], + body: [`componentDidMount() { ${Placeholders.FirstTab} }`], description: 'Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.', }; @@ -267,10 +256,7 @@ const shouldComponentUpdate: OthersSnippet = { key: 'shouldComponentUpdate', prefix: 'scu', body: [ - 'shouldComponentUpdate(nextProps, nextState) {', - ` ${Placeholders.FirstTab}`, - '}', - '', + `shouldComponentUpdate(nextProps, nextState) { ${Placeholders.FirstTab} }`, ], description: 'Invoked before rendering when new props or state are being received. ', @@ -280,10 +266,7 @@ const componentDidUpdate: OthersSnippet = { key: 'componentDidUpdate', prefix: 'cdup', body: [ - 'componentDidUpdate(prevProps, prevState) {', - ` ${Placeholders.LastTab}`, - '}', - '', + `componentDidUpdate(prevProps, prevState) { ${Placeholders.FirstTab}} `, ], description: "Invoked immediately after the component's updates are flushed to the DOM.", @@ -292,7 +275,7 @@ const componentDidUpdate: OthersSnippet = { const componentWillUnmount: OthersSnippet = { key: 'componentWillUnmount', prefix: 'cwun', - body: ['componentWillUnmount() {', ` ${Placeholders.FirstTab}`, '}'], + body: [`componentWillUnmount() {${Placeholders.FirstTab} }`], description: 'Invoked immediately before a component is unmounted from the DOM.', }; @@ -311,7 +294,7 @@ const getSnapshotBeforeUpdate: OthersSnippet = { key: 'getSnapshotBeforeUpdate', prefix: 'gsbu', body: [ - `getSnapshotBeforeUpdate = (prevProps, prevState) => {${Placeholders.LastTab}}`, + `getSnapshotBeforeUpdate = (prevProps, prevState) => {${Placeholders.FirstTab}}`, ], description: 'Called right before mutations are made (e.g. before the DOM is updated)', @@ -320,21 +303,21 @@ const getSnapshotBeforeUpdate: OthersSnippet = { const createContext: OthersSnippet = { key: 'createContext', prefix: 'rcontext', - body: [`const ${Placeholders.LastTab} = React.createContext()`], + body: [`const ${Placeholders.FirstTab} = React.createContext()`], description: 'Create React context', }; const createRef: OthersSnippet = { key: 'createRef', prefix: 'cref', - body: [`this.${Placeholders.LastTab}Ref = React.createRef()`], + body: [`this.${Placeholders.FirstTab}Ref = React.createRef()`], description: 'Create ref statement used inside constructor', }; const componentSetStateObject: OthersSnippet = { key: 'componentSetStateObject', prefix: 'sst', - body: [`this.setState({${Placeholders.LastTab}})`], + body: [`this.setState({${Placeholders.FirstTab}})`], description: 'Performs a shallow merge of nextState into current state', }; @@ -342,7 +325,7 @@ const componentSetStateFunc: OthersSnippet = { key: 'componentSetStateFunc', prefix: 'ssf', body: [ - `this.setState((state, props) => { return { ${Placeholders.LastTab} }})`, + `this.setState((state, props) => { return { ${Placeholders.FirstTab} }})`, ], description: 'Performs a shallow merge of nextState into current state', }; @@ -350,14 +333,14 @@ const componentSetStateFunc: OthersSnippet = { const componentProps: OthersSnippet = { key: 'componentProps', prefix: 'props', - body: [`this.props.${Placeholders.LastTab}`], + body: [`this.props.${Placeholders.FirstTab}`], description: "Access component's props", }; const componentState: OthersSnippet = { key: 'componentState', prefix: 'state', - body: [`this.state.${Placeholders.LastTab}`], + body: [`this.state.${Placeholders.FirstTab}`], }; const bindThis: OthersSnippet = { @@ -372,7 +355,7 @@ const bindThis: OthersSnippet = { const commentBigBlock: OthersSnippet = { key: 'commentBigBlock', prefix: 'cmmb', - body: ['/**', ` * ${Placeholders.LastTab}`, ' */'], + body: ['/**', ` * ${Placeholders.FirstTab}`, ' */'], }; const hocComponentWithRedux: OthersSnippet = { @@ -421,7 +404,7 @@ const hocComponent: OthersSnippet = { const typeofSnippet: OthersSnippet = { key: 'typeofSnippet', prefix: 'tpf', - body: [`typeof ${Placeholders.LastTab}`], + body: [`typeof ${Placeholders.FirstTab}`], }; export default [ diff --git a/src/sourceSnippets/reactNative.ts b/src/sourceSnippets/reactNative.ts index 2c8db65..0a06d6c 100644 --- a/src/sourceSnippets/reactNative.ts +++ b/src/sourceSnippets/reactNative.ts @@ -28,7 +28,7 @@ const reactNativeComponentReturn = [ ' render() {', ' return (', ' ', - ` ${Placeholders.LastTab}`, + ` ${Placeholders.FirstTab}`, ' ', ' )', ' }', @@ -37,7 +37,7 @@ const reactNativeComponentReturn = [ const reactNativeReturn = [ ' return (', ' ', - ' $0', + ` ${Placeholders.FirstTab}`, ' ', ' )', ]; @@ -45,13 +45,13 @@ const reactNativeReturn = [ const reactNativeImport: ReactNativeSnippet = { key: 'reactNativeImport', prefix: 'imrn', - body: [`import { ${Placeholders.LastTab} } from 'react-native'`], + body: [`import { ${Placeholders.FirstTab} } from 'react-native'`], }; const reactNativeStyles: ReactNativeSnippet = { key: 'reactNativeStyles', prefix: 'rnstyle', - body: [`const styles = StyleSheet.create({${Placeholders.LastTab}})`], + body: [`const styles = StyleSheet.create({${Placeholders.FirstTab}})`], }; const reactNativeComponent: ReactNativeSnippet = { diff --git a/src/sourceSnippets/sharedSnippets.ts b/src/sourceSnippets/sharedSnippets.ts index 72e0848..6a199ac 100644 --- a/src/sourceSnippets/sharedSnippets.ts +++ b/src/sourceSnippets/sharedSnippets.ts @@ -33,14 +33,14 @@ export const reduxComponentExport = [ export const innerComponent = [ ' return (', - `
${Placeholders.LastTab}
`, + `
${Placeholders.FirstTab}
`, ' )', ]; export const innerComponentReturn = [ ' render() {', ' return (', - `
${Placeholders.LastTab}
`, + `
${Placeholders.FirstTab}
`, ' )', ' }', ]; diff --git a/src/sourceSnippets/tests.ts b/src/sourceSnippets/tests.ts index 8a9f13c..73ebadb 100644 --- a/src/sourceSnippets/tests.ts +++ b/src/sourceSnippets/tests.ts @@ -18,9 +18,7 @@ const describeBlock: TestsSnippet = { key: 'describeBlock', prefix: 'desc', body: [ - `describe('${Placeholders.FirstTab}', () => {`, - ` ${Placeholders.LastTab}`, - '})', + `describe('${Placeholders.FirstTab}', () => { ${Placeholders.SecondTab} })`, ], description: 'Testing `describe` block', }; @@ -28,9 +26,7 @@ const testBlock: TestsSnippet = { key: 'testBlock', prefix: 'test', body: [ - `test('should ${Placeholders.FirstTab}', () => {`, - ` ${Placeholders.LastTab}`, - '})', + `test('should ${Placeholders.FirstTab}', () => { ${Placeholders.SecondTab} })`, ], description: 'Testing `test` block', }; @@ -38,9 +34,7 @@ const testAsyncBlock: TestsSnippet = { key: 'testAsyncBlock', prefix: 'testa', body: [ - `test('should ${Placeholders.FirstTab}', async () => {`, - ` ${Placeholders.LastTab}`, - '})', + `test('should ${Placeholders.FirstTab}', async () => { ${Placeholders.SecondTab} })`, ], description: 'Testing `asynchronous test` block', }; @@ -48,9 +42,7 @@ const itBlock: TestsSnippet = { key: 'itBlock', prefix: 'tit', body: [ - `it('should ${Placeholders.FirstTab}', () => {`, - ` ${Placeholders.LastTab}`, - '})', + `it('should ${Placeholders.FirstTab}', () => { ${Placeholders.SecondTab} })`, ], description: 'Testing `it` block', }; @@ -58,9 +50,7 @@ const itAsyncBlock: TestsSnippet = { key: 'itAsyncBlock', prefix: 'tita', body: [ - `it('should ${Placeholders.FirstTab}', async () => {`, - ` ${Placeholders.LastTab}`, - '})', + `it('should ${Placeholders.FirstTab}', async () => { ${Placeholders.SecondTab} })`, ], description: 'Testing asynchronous `it` block', }; diff --git a/src/sourceSnippets/typescript.ts b/src/sourceSnippets/typescript.ts index 05c8cdd..d024a0c 100644 --- a/src/sourceSnippets/typescript.ts +++ b/src/sourceSnippets/typescript.ts @@ -31,7 +31,7 @@ type TypescriptMappings = { export type TypescriptSnippet = SnippetMapping; const exportType: TypescriptSnippet = { - body: [`export type ${Placeholders.FirstTab} = {${Placeholders.LastTab}}`], + body: [`export type ${Placeholders.FirstTab} = {${Placeholders.SecondTab}}`], key: 'exportType', prefix: 'exptp', }; @@ -39,7 +39,9 @@ const exportType: TypescriptSnippet = { const exportInterface: TypescriptSnippet = { key: 'exportInterface', prefix: 'expint', - body: [`export interface ${Placeholders.FirstTab} {}`], + body: [ + `export interface ${Placeholders.FirstTab} {${Placeholders.SecondTab}}`, + ], }; const typescriptReactClassComponent: TypescriptSnippet = { @@ -200,7 +202,7 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = { `const ${Placeholders.FileName} = (props: Props) => {`, ' return (', ' ', - ` ${Placeholders.LastTab}`, + ` ${Placeholders.FirstTab}`, ' ', ' )', '}', @@ -222,7 +224,7 @@ const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = `const ${Placeholders.FileName} = (props: Props) => {`, ' return (', ' ', - ` ${Placeholders.LastTab}`, + ` ${Placeholders.FirstTab}`, ' ', ' )', '}', diff --git a/src/types.ts b/src/types.ts index 7d48458..0d2d726 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,7 +10,6 @@ export const Placeholders = { FirstTab: 'FIRST_TAB', SecondTab: 'SECOND_TAB', ThirdTab: 'THIRD_TAB', - LastTab: 'LAST_TAB', Capitalize: 'CAPITALIZE', TypeProps: 'TYPE_PROPS', TypeState: 'TYPE_STATE', @@ -21,7 +20,6 @@ export const Mappings = { FirstTab: '${1:first}', SecondTab: '${2:second}', ThirdTab: '${3:third}', - LastTab: '$0', Capitalize: '${1/(.*)/${1:/capitalize}/}', TypeProps: 'type Props = {}', TypeState: 'type State = {}', From c212942e488548741b536c3dc1842f3fcb5698e7 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 01:11:39 +0100 Subject: [PATCH 096/110] fix: components --- src/sourceSnippets/components.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sourceSnippets/components.ts b/src/sourceSnippets/components.ts index 4889457..09ef578 100644 --- a/src/sourceSnippets/components.ts +++ b/src/sourceSnippets/components.ts @@ -228,10 +228,10 @@ const reactFunctionMemoComponent: ComponentsSnippet = { body: [ ...reactWithMemo, '', - `export default memo(function ${Placeholders.FileName}() {`, + `const ${Placeholders.FileName} = memo(() => {`, ...innerComponent, '})', - '', + ...exportDefault, ], description: 'Creates a React Memo Function Component with ES7 module system', }; @@ -243,7 +243,7 @@ const reactFunctionMemoComponentWithPropTypes: ComponentsSnippet = { "import PropTypes from 'prop-types'", ...reactWithMemo, '', - `const ${Placeholders.FileName} = memo(function ${Placeholders.FileName}(props) {`, + `const ${Placeholders.FileName} = memo((props) => {`, ...innerComponent, '})', '', From 3cd5f97cda173cb3b0861b84f935b7f61b138910 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 22:13:07 +0100 Subject: [PATCH 097/110] fix: initial hooks for prettier, generated with standard --- docs/Snippets.md | 356 ++-- package.json | 2 + src/helpers/parseSnippetToBody.ts | 19 +- src/helpers/revertSnippetPlaceholders.ts | 0 src/index.ts | 4 +- src/snippets/generated.json | 1895 +++++++++++++++++++++- src/sourceSnippets/hooks.ts | 5 +- src/sourceSnippets/redux.ts | 4 +- src/types.ts | 14 +- 9 files changed, 2090 insertions(+), 209 deletions(-) delete mode 100644 src/helpers/revertSnippetPlaceholders.ts diff --git a/docs/Snippets.md b/docs/Snippets.md index 1b54713..135e201 100644 --- a/docs/Snippets.md +++ b/docs/Snippets.md @@ -157,11 +157,11 @@ I.E. `tsrcc` ### `rcc` ```javascript -import React, { Component } from 'react'; +import React, { Component } from 'react' export default class FileName extends Component { render() { - return
$2
; + return
$2
} } ``` @@ -169,42 +169,42 @@ export default class FileName extends Component { ### `rce` ```javascript -import React, { Component } from 'react'; +import React, { Component } from 'react' export class FileName extends Component { render() { - return
$2
; + return
$2
} } -export default $1; +export default $1 ``` ### `rcep` ```javascript -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import React, { Component } from 'react' +import PropTypes from 'prop-types' export class FileName extends Component { - static propTypes = {}; + static propTypes = {} render() { - return
$2
; + return
$2
} } -export default $1; +export default $1 ``` ### `rpc` ```javascript -import React, { PureComponent } from 'react'; +import React, { PureComponent } from 'react' export default class FileName extends PureComponent { render() { - return
$2
; + return
$2
} } ``` @@ -212,14 +212,14 @@ export default class FileName extends PureComponent { ### `rpcp` ```javascript -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' export default class FileName extends PureComponent { - static propTypes = {}; + static propTypes = {} render() { - return
$2
; + return
$2
} } ``` @@ -227,33 +227,33 @@ export default class FileName extends PureComponent { ### `rpce` ```javascript -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' export class FileName extends PureComponent { - static propTypes = {}; + static propTypes = {} render() { - return
$2
; + return
$2
} } -export default FileName; +export default FileName ``` ### `rccp` ```javascript -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import React, { Component } from 'react' +import PropTypes from 'prop-types' export default class FileName extends Component { static propTypes = { $2: $3, - }; + } render() { - return
$4
; + return
$4
} } ``` @@ -261,190 +261,190 @@ export default class FileName extends Component { ### `rfcp` ```javascript -import React from 'react'; -import PropTypes from 'prop-types'; +import React from 'react' +import PropTypes from 'prop-types' function $1(props) { - return
$0
; + return
$0
} -$1.propTypes = {}; +$1.propTypes = {} -export default $1; +export default $1 ``` ### `rfc` ```javascript -import React from 'react'; +import React from 'react' export default function $1() { - return
$0
; + return
$0
} ``` ### `rfce` ```javascript -import React from 'react'; +import React from 'react' function $1() { - return
$0
; + return
$0
} -export default $1; +export default $1 ``` ### `rafcp` ```javascript -import React from 'react'; -import PropTypes from 'prop-types'; +import React from 'react' +import PropTypes from 'prop-types' const $1 = (props) => { - return
$0
; -}; + return
$0
+} -$1.propTypes = {}; +$1.propTypes = {} -export default $1; +export default $1 ``` ### `rafc` ```javascript -import React from 'react'; +import React from 'react' export const $1 = () => { - return
$0
; -}; + return
$0
+} ``` ### `rafce` ```javascript -import React from 'react'; +import React from 'react' const $1 = () => { - return
$0
; -}; + return
$0
+} -export default $1; +export default $1 ``` ### `rmc` ```javascript -import React, { memo } from 'react'; +import React, { memo } from 'react' export default memo(function $1() { - return
$0
; -}); + return
$0
+}) ``` ### `rmcp` ```javascript -import React, { memo } from 'react'; -import PropTypes from 'prop-types'; +import React, { memo } from 'react' +import PropTypes from 'prop-types' const $1 = memo(function $1(props) { - return
$0
; -}); + return
$0
+}) -$1.propTypes = {}; +$1.propTypes = {} -export default $1; +export default $1 ``` ### `rcredux` ```javascript -import React, { Component } from 'react'; -import { connect } from 'react-redux'; +import React, { Component } from 'react' +import { connect } from 'react-redux' export class FileName extends Component { render() { - return
$4
; + return
$4
} } -const mapStateToProps = (state) => ({}); +const mapStateToProps = (state) => ({}) -const mapDispatchToProps = {}; +const mapDispatchToProps = {} -export default connect(mapStateToProps, mapDispatchToProps)(FileName); +export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` ### `rcreduxp` ```javascript -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import { connect } from 'react-redux' export class FileName extends Component { static propTypes = { $2: $3, - }; + } render() { - return
$4
; + return
$4
} } -const mapStateToProps = (state) => ({}); +const mapStateToProps = (state) => ({}) -const mapDispatchToProps = {}; +const mapDispatchToProps = {} -export default connect(mapStateToProps, mapDispatchToProps)(FileName); +export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` ### `rfcredux` ```javascript -import React, { Component } from 'react'; -import { connect } from 'react-redux'; +import React, { Component } from 'react' +import { connect } from 'react-redux' export const FileName = () => { - return
$4
; -}; + return
$4
+} -const mapStateToProps = (state) => ({}); +const mapStateToProps = (state) => ({}) -const mapDispatchToProps = {}; +const mapDispatchToProps = {} -export default connect(mapStateToProps, mapDispatchToProps)(FileName); +export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` ### `rfreduxp` ```javascript -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import { connect } from 'react-redux' export const FileName = () => { - return
$4
; -}; + return
$4
+} FileName.propTypes = { $2: $3, -}; +} -const mapStateToProps = (state) => ({}); +const mapStateToProps = (state) => ({}) -const mapDispatchToProps = {}; +const mapDispatchToProps = {} -export default connect(mapStateToProps, mapDispatchToProps)(FileName); +export default connect(mapStateToProps, mapDispatchToProps)(FileName) ``` ### `reduxmap` ```javascript -const mapStateToProps = (state) => ({}); +const mapStateToProps = (state) => ({}) -const mapDispatchToProps = {}; +const mapDispatchToProps = {} ``` ## React Native Components @@ -452,8 +452,8 @@ const mapDispatchToProps = {}; ### `rnc` ```javascript -import React, { Component } from 'react'; -import { Text, View } from 'react-native'; +import React, { Component } from 'react' +import { Text, View } from 'react-native' export default class FileName extends Component { render() { @@ -461,7 +461,7 @@ export default class FileName extends Component { $2 - ); + ) } } ``` @@ -469,76 +469,76 @@ export default class FileName extends Component { ### `rnf` ```javascript -import React from 'react'; -import { View, Text } from 'react-native'; +import React from 'react' +import { View, Text } from 'react-native' export default function $1() { return ( $2 - ); + ) } ``` ### `rnfs` ```javascript -import React from 'react'; -import { StyleSheet, View, Text } from 'react-native'; +import React from 'react' +import { StyleSheet, View, Text } from 'react-native' export default function $1() { return ( $2 - ); + ) } -const styles = StyleSheet.create({}); +const styles = StyleSheet.create({}) ``` ### `rnfe` ```javascript -import React from 'react'; -import { View, Text } from 'react-native'; +import React from 'react' +import { View, Text } from 'react-native' const $1 = () => { return ( $2 - ); -}; + ) +} -export default $1; +export default $1 ``` ### `rnfes` ```javascript -import React from 'react'; -import { StyleSheet, View, Text } from 'react-native'; +import React from 'react' +import { StyleSheet, View, Text } from 'react-native' const $1 = () => { return ( $2 - ); -}; + ) +} -export default $1; +export default $1 -const styles = StyleSheet.create({}); +const styles = StyleSheet.create({}) ``` ### `rncs` ```javascript -import React, { Component } from 'react'; -import { Text, StyleSheet, View } from 'react-native'; +import React, { Component } from 'react' +import { Text, StyleSheet, View } from 'react-native' export default class FileName extends Component { render() { @@ -546,18 +546,18 @@ export default class FileName extends Component { $2 - ); + ) } } -const styles = StyleSheet.create({}); +const styles = StyleSheet.create({}) ``` ### `rnce` ```javascript -import React, { Component } from 'react'; -import { Text, View } from 'react-native'; +import React, { Component } from 'react' +import { Text, View } from 'react-native' export class FileName extends Component { render() { @@ -565,11 +565,11 @@ export class FileName extends Component { $2 - ); + ) } } -export default $1; +export default $1 ``` ## Others @@ -588,147 +588,147 @@ export default $1; ```javascript describe('$1', () => { - $2; -}); + $2 +}) ``` ### `test` ```javascript test('should $1', () => { - $2; -}); + $2 +}) ``` ### `tit` ```javascript it('should $1', () => { - $2; -}); + $2 +}) ``` ### `stest` ```javascript -import React from 'react'; -import renderer from 'react-test-renderer'; +import React from 'react' +import renderer from 'react-test-renderer' -import { $1 } from '../$1'; +import { $1 } from '../$1' describe('<$1 />', () => { - const defaultProps = {}; - const wrapper = renderer.create(<$1 {...defaultProps} />); + const defaultProps = {} + const wrapper = renderer.create(<$1 {...defaultProps} />) test('render', () => { - expect(wrapper).toMatchSnapshot(); - }); -}); + expect(wrapper).toMatchSnapshot() + }) +}) ``` ### `srtest` ```javascript -import React from 'react'; -import renderer from 'react-test-renderer'; -import { Provider } from 'react-redux'; +import React from 'react' +import renderer from 'react-test-renderer' +import { Provider } from 'react-redux' -import store from 'src/store'; -import { $1 } from '../$1'; +import store from 'src/store' +import { $1 } from '../$1' describe('<$1 />', () => { - const defaultProps = {}; + const defaultProps = {} const wrapper = renderer.create( <$1 {...defaultProps} />) , - ); + ) test('render', () => { - expect(wrapper).toMatchSnapshot(); - }); -}); + expect(wrapper).toMatchSnapshot() + }) +}) ``` ### `sntest` ```javascript -import 'react-native'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import 'react-native' +import React from 'react' +import renderer from 'react-test-renderer' -import $1 from '../$1'; +import $1 from '../$1' describe('<$1 />', () => { - const defaultProps = {}; + const defaultProps = {} - const wrapper = renderer.create(<$1 {...defaultProps} />); + const wrapper = renderer.create(<$1 {...defaultProps} />) test('render', () => { - expect(wrapper).toMatchSnapshot(); - }); -}); + expect(wrapper).toMatchSnapshot() + }) +}) ``` ### `snrtest` ```javascript -import 'react-native'; -import React from 'react'; -import renderer from 'react-test-renderer'; -import { Provider } from 'react-redux'; +import 'react-native' +import React from 'react' +import renderer from 'react-test-renderer' +import { Provider } from 'react-redux' -import store from 'src/store/configureStore'; -import $1 from '../$1'; +import store from 'src/store/configureStore' +import $1 from '../$1' describe('<$1 />', () => { - const defaultProps = {}; + const defaultProps = {} const wrapper = renderer.create( <$1 {...defaultProps} /> , - ); + ) test('render', () => { - expect(wrapper).toMatchSnapshot(); - }); -}); + expect(wrapper).toMatchSnapshot() + }) +}) ``` ### `hocredux` ```javascript -import React from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; +import React from 'react' +import PropTypes from 'prop-types' +import { connect } from 'react-redux' -export const mapStateToProps = (state) => ({}); +export const mapStateToProps = (state) => ({}) -export const mapDispatchToProps = {}; +export const mapDispatchToProps = {} export const $1 = (WrappedComponent) => { - const hocComponent = ({ ...props }) => ; + const hocComponent = ({ ...props }) => - hocComponent.propTypes = {}; + hocComponent.propTypes = {} - return hocComponent; -}; + return hocComponent +} export default (WrapperComponent) => - connect(mapStateToProps, mapDispatchToProps)($1(WrapperComponent)); + connect(mapStateToProps, mapDispatchToProps)($1(WrapperComponent)) ``` ### `hoc` ```javascript -import React from 'react'; -import PropTypes from 'prop-types'; +import React from 'react' +import PropTypes from 'prop-types' export default (WrappedComponent) => { - const hocComponent = ({ ...props }) => ; + const hocComponent = ({ ...props }) => - hocComponent.propTypes = {}; + hocComponent.propTypes = {} - return hocComponent; -}; + return hocComponent +} ``` diff --git a/package.json b/package.json index 904f013..d1394f9 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,9 @@ }, "activationEvents": [ "onLanguage:typescript", + "onLanguage:typescriptReact", "onLanguage:javascript", + "onLanguage:javascriptReact", "onCommand:reactSnippets.search" ], "contributes": { diff --git a/src/helpers/parseSnippetToBody.ts b/src/helpers/parseSnippetToBody.ts index 7f99e34..17c8ce6 100644 --- a/src/helpers/parseSnippetToBody.ts +++ b/src/helpers/parseSnippetToBody.ts @@ -3,19 +3,6 @@ import { formatSnippet } from './formatters'; import { Snippet } from './generateSnippets'; import replaceOrRemoveReactImport from './replaceOrRemoveReactImport'; -// This is array of prefixes which are currently skipped because of syntax format issues -const skippedSnippets = [ - 'pge', - 'pse', - 'gdsfp', - 'gsbu', - 'scu', - 'cwun', - 'cdm', - 'cdup', - 'rconst', -]; - const withReactImport = [ 'rfce', 'rfc', @@ -46,11 +33,9 @@ const parseSnippetToBody = (snippet: Snippet) => { ? replaceOrRemoveReactImport(snippet.body) : body; - const formattedSnippet = skippedSnippets.includes(snippet.prefix) - ? snippetBody - : formatSnippet(snippetBody).split('\n'); + const formattedSnippet = formatSnippet(snippetBody).split('\n'); - return snippet.body.length === 1 ? formattedSnippet[0] : formattedSnippet; + return formattedSnippet; }; export default parseSnippetToBody; diff --git a/src/helpers/revertSnippetPlaceholders.ts b/src/helpers/revertSnippetPlaceholders.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/index.ts b/src/index.ts index 11a020a..e7c3e87 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,7 +30,7 @@ const showRestartMessage = async ({ } }; -export async function activate(context: ExtensionContext) { +export function activate(context: ExtensionContext) { workspace.onDidChangeConfiguration(showRestartMessage); const snippetSearchCommand = commands.registerCommand( 'reactSnippets.search', @@ -38,8 +38,6 @@ export async function activate(context: ExtensionContext) { ); context.subscriptions.push(snippetSearchCommand); - - await generateSnippets(); } export function deactivate() {} diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 0967ef4..863bbbd 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -1 +1,1894 @@ -{} +{ + "exportType": { + "body": "export type ${1:first} = {${2:second}}", + "key": "exportType", + "prefix": "exptp", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportInterface": { + "key": "exportInterface", + "prefix": "expint", + "body": "export interface ${1:first} {${2:second}}", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponent": { + "key": "typescriptReactClassComponent", + "prefix": "tsrcc", + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "body": [ + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportComponent": { + "key": "typescriptReactClassExportComponent", + "prefix": "tsrce", + "body": [ + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalExportComponent": { + "key": "typescriptReactFunctionalExportComponent", + "prefix": "tsrfce", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalComponent": { + "key": "typescriptReactFunctionalComponent", + "prefix": "tsrfc", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return (", + "
${1:first}
", + " )", + "}" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionExportComponent": { + "key": "typescriptReactArrowFunctionExportComponent", + "prefix": "tsrafce", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionComponent": { + "key": "typescriptReactArrowFunctionComponent", + "prefix": "tsrafc", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + "
${1:first}
", + " )", + "}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassPureComponent": { + "key": "typescriptReactClassPureComponent", + "prefix": "tsrpc", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "type Props = {}", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportPureComponent": { + "key": "typescriptReactClassExportPureComponent", + "prefix": "tsrpce", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "type Props = {}", + "", + "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponentRedux": { + "key": "typescriptReactClassComponentRedux", + "prefix": "tsrcredux", + "body": [ + "import { connect } from 'react-redux'", + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponent": { + "key": "typescriptReactNativeArrowFunctionComponent", + "prefix": "tsrnf", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system in TypeScript", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponentWithStyles": { + "key": "typescriptReactNativeArrowFunctionComponentWithStyles", + "prefix": "tsrnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionComponent": { + "key": "reactArrowFunctionComponent", + "prefix": "rafc", + "body": [ + "import React from 'react'", + "", + "export const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + "
${1:first}
", + " )", + "}", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionComponentWithPropTypes": { + "key": "reactArrowFunctionComponentWithPropTypes", + "prefix": "rafcp", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "const ${1:${TM_FILENAME_BASE}} = props => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionExportComponent": { + "key": "reactArrowFunctionExportComponent", + "prefix": "rafce", + "body": [ + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponent": { + "key": "reactClassComponent", + "prefix": "rcc", + "body": [ + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentPropTypes": { + "key": "reactClassComponentPropTypes", + "prefix": "rccp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {${2:second}: ${3:third}}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with PropTypes and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentRedux": { + "key": "reactClassComponentRedux", + "prefix": "rcredux", + "body": [ + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentReduxPropTypes": { + "key": "reactClassComponentReduxPropTypes", + "prefix": "rcreduxp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {", + " ${2:second}: ${3:third}", + " }", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportComponent": { + "key": "reactClassExportComponent", + "prefix": "rce", + "body": [ + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportComponentWithPropTypes": { + "key": "reactClassExportComponentWithPropTypes", + "prefix": "rcep", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportPureComponent": { + "key": "reactClassExportPureComponent", + "prefix": "rpce", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React pure component class with ES7 module system export", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassPureComponent": { + "key": "reactClassPureComponent", + "prefix": "rpc", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React pure component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassPureComponentWithPropTypes": { + "key": "reactClassPureComponentWithPropTypes", + "prefix": "rpcp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " static propTypes = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionMemoComponent": { + "key": "reactFunctionMemoComponent", + "prefix": "rmc", + "body": [ + "import React, { memo } from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = memo(() => {", + " return (", + "
${1:first}
", + " )", + "})", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Memo Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionMemoComponentWithPropTypes": { + "key": "reactFunctionMemoComponentWithPropTypes", + "prefix": "rmcp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { memo } from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = memo((props) => {", + " return (", + "
${1:first}
", + " )", + "})", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponent": { + "key": "reactFunctionalComponent", + "prefix": "rfc", + "body": [ + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + "
${1:first}
", + " )", + "}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentRedux": { + "key": "reactFunctionalComponentRedux", + "prefix": "rfcredux", + "body": [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React functional component with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentReduxPropTypes": { + "key": "reactFunctionalComponentReduxPropTypes", + "prefix": "rfcreduxp", + "body": [ + "import PropTypes from 'prop-types'", + "import React from 'react'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {", + " ${2:second}: PropTypes.${3:third}", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentWithPropTypes": { + "key": "reactFunctionalComponentWithPropTypes", + "prefix": "rfcp", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "function ${1:${TM_FILENAME_BASE}}(props) {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalExportComponent": { + "key": "reactFunctionalExportComponent", + "prefix": "rfce", + "body": [ + "import React from 'react'", + "", + "function ${1:${TM_FILENAME_BASE}}() {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleAssert": { + "key": "consoleAssert", + "prefix": "cas", + "body": "console.assert(${1:first}, ${2:second})", + "description": "If the specified expression is false, the message is written to the console along with a stack trace", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleClear": { + "key": "consoleClear", + "prefix": "ccl", + "body": "console.clear()", + "description": "Clears the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleCount": { + "key": "consoleCount", + "prefix": "cco", + "body": "console.count(${1:first})", + "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleDir": { + "key": "consoleDir", + "prefix": "cdi", + "body": "console.dir(${1:first})", + "description": "Prints a JavaScript representation of the specified object", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleError": { + "key": "consoleError", + "prefix": "cer", + "body": "console.error(${1:first})", + "description": "Displays a message in the console and also includes a stack trace from where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleGroup": { + "key": "consoleGroup", + "prefix": "cgr", + "body": "console.group('${1:first}')", + "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleGroupEnd": { + "key": "consoleGroupEnd", + "prefix": "cge", + "body": "console.groupEnd()", + "description": "Closes out the corresponding console.group().", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLog": { + "key": "consoleLog", + "prefix": "clg", + "body": "console.log(${1:first})", + "description": "Displays a message in the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTrace": { + "key": "consoleTrace", + "prefix": "ctr", + "body": "console.trace(${1:first})", + "description": "Prints a stack trace from the point where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLogObject": { + "key": "consoleLogObject", + "prefix": "clo", + "body": "console.log('${1:first}', ${1:first})", + "description": "Logs property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLogJson": { + "key": "consoleLogJson", + "prefix": "clj", + "body": "console.log('${1:first}', JSON.stringify(${1:first}, null, 2))", + "description": "Logs stringified JSON property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTime": { + "key": "consoleTime", + "prefix": "ctm", + "body": "console.time('${1:first}')", + "description": "Console time wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTimeEnd": { + "key": "consoleTimeEnd", + "prefix": "cte", + "body": "console.timeEnd('${1:first}')", + "description": "Console time end wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleWarn": { + "key": "consoleWarn", + "prefix": "cwa", + "body": "console.warn(${1:first})", + "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleInfo": { + "key": "consoleInfo", + "prefix": "cin", + "body": "console.info(${1:first})", + "description": "Displays a message in the console but also displays a blue information icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useCallback": { + "key": "useCallback", + "prefix": "useCallbackSnippet", + "body": [ + "useCallback(", + " () => {", + " ${1:first}", + " },", + " [${2:second}],", + ")", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useContext": { + "key": "useContext", + "prefix": "useContextSnippet", + "body": "const ${1:first} = useContext(${2:second})", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useEffect": { + "key": "useEffect", + "prefix": "useEffectSnippet", + "body": [ + "useEffect(() => {", + " ${1:first}", + "", + " return () => {", + " ${2:second}", + " }", + "}, [${3:third}])", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useImperativeHandle": { + "key": "useImperativeHandle", + "prefix": "useImperativeHandleSnippet", + "body": [ + "useImperativeHandle(", + " ${1:first},", + " () => {", + " ${2:second}", + " },", + " [${3:third}],", + ")" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useLayoutEffect": { + "key": "useLayoutEffect", + "prefix": "useLayoutEffectSnippet", + "body": [ + "useLayoutEffect(() => {", + " ${1:first}", + "", + " return () => {", + " ${2:second}", + " };", + "}, [${3:third}])" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useMemo": { + "key": "useMemo", + "prefix": "useMemoSnippet", + "body": "useMemo(() => ${1:first}, [${2:second}])", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useReducer": { + "key": "useReducer", + "prefix": "useReducerSnippet", + "body": "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third})", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useRef": { + "key": "useRef", + "prefix": "useRefSnippet", + "body": "const ${1:first} = useRef(${2:second})", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useState": { + "key": "useState", + "prefix": "useStateSnippet", + "body": "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second})", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importAs": { + "key": "importAs", + "prefix": "ima", + "body": "import { ${2:second} as ${3:third} } from '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importBrowserRouter": { + "key": "importBrowserRouter", + "prefix": "imbr", + "body": "import { BrowserRouter as Router } from 'react-router-dom'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importBrowserRouterWithRouteAndNavLink": { + "key": "importBrowserRouterWithRouteAndNavLink", + "prefix": "imrr", + "body": [ + "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importDestructing": { + "key": "importDestructing", + "prefix": "imd", + "body": "import { ${2:second} } from '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importEverything": { + "key": "importEverything", + "prefix": "ime", + "body": "import * as ${2:second} from '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importNoModuleName": { + "key": "importNoModuleName", + "prefix": "imn", + "body": "import '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importPropTypes": { + "key": "importPropTypes", + "prefix": "impt", + "body": "import PropTypes from 'prop-types'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReact": { + "key": "importReact", + "prefix": "imr", + "body": "import React from 'react'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactDom": { + "key": "importReactDom", + "prefix": "imrd", + "body": "import ReactDOM from 'react-dom'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithComponent": { + "key": "importReactWithComponent", + "prefix": "imrc", + "body": "import React, { Component } from 'react'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithComponentAndPropTypes": { + "key": "importReactWithComponentAndPropTypes", + "prefix": "imrcp", + "body": [ + "import React, { Component } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithMemo": { + "key": "importReactWithMemo", + "prefix": "imrm", + "body": "import React, { memo } from 'react'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithMemoAndPropTypes": { + "key": "importReactWithMemoAndPropTypes", + "prefix": "imrmp", + "body": [ + "import React, { memo } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithPureComponent": { + "key": "importReactWithPureComponent", + "prefix": "imrpc", + "body": "import React, { PureComponent } from 'react'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithPureComponentAndPropTypes": { + "key": "importReactWithPureComponentAndPropTypes", + "prefix": "imrpcp", + "body": [ + "import React, { PureComponent } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterLink": { + "key": "importRouterLink", + "prefix": "imbrl", + "body": "import { Link } from 'react-router-dom'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterNavLink": { + "key": "importRouterNavLink", + "prefix": "imbrnl", + "body": "import { NavLink } from 'react-router-dom'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterSetup": { + "key": "importRouterSetup", + "prefix": "imbrc", + "body": "import { Route, Switch, NavLink, Link } from 'react-router-dom'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterSwitch": { + "key": "importRouterSwitch", + "prefix": "imbrs", + "body": "import { Switch } from 'react-router-dom'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "import": { + "key": "import", + "prefix": "imp", + "body": "import ${2:second} from '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArray": { + "key": "propTypeArray", + "prefix": "pta", + "body": "PropTypes.array", + "description": "Array prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayRequired": { + "key": "propTypeArrayRequired", + "prefix": "ptar", + "body": "PropTypes.array.isRequired", + "description": "Array prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeBool": { + "key": "propTypeBool", + "prefix": "ptb", + "body": "PropTypes.bool", + "description": "Bool prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeBoolRequired": { + "key": "propTypeBoolRequired", + "prefix": "ptbr", + "body": "PropTypes.bool.isRequired", + "description": "Bool prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeFunc": { + "key": "propTypeFunc", + "prefix": "ptf", + "body": "PropTypes.func", + "description": "Func prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeFuncRequired": { + "key": "propTypeFuncRequired", + "prefix": "ptfr", + "body": "PropTypes.func.isRequired", + "description": "Func prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNumber": { + "key": "propTypeNumber", + "prefix": "ptn", + "body": "PropTypes.number", + "description": "Number prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNumberRequired": { + "key": "propTypeNumberRequired", + "prefix": "ptnr", + "body": "PropTypes.number.isRequired", + "description": "Number prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObject": { + "key": "propTypeObject", + "prefix": "pto", + "body": "PropTypes.object", + "description": "Object prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectRequired": { + "key": "propTypeObjectRequired", + "prefix": "ptor", + "body": "PropTypes.object.isRequired", + "description": "Object prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeString": { + "key": "propTypeString", + "prefix": "pts", + "body": "PropTypes.string", + "description": "String prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeStringRequired": { + "key": "propTypeStringRequired", + "prefix": "ptsr", + "body": "PropTypes.string.isRequired", + "description": "String prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNode": { + "key": "propTypeNode", + "prefix": "ptnd", + "body": "PropTypes.node", + "description": "Anything that can be rendered: numbers, strings, elements or an array", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNodeRequired": { + "key": "propTypeNodeRequired", + "prefix": "ptndr", + "body": "PropTypes.node.isRequired", + "description": "Anything that can be rendered: numbers, strings, elements or an array required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeElement": { + "key": "propTypeElement", + "prefix": "ptel", + "body": "PropTypes.element", + "description": "React element prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeElementRequired": { + "key": "propTypeElementRequired", + "prefix": "ptelr", + "body": "PropTypes.element.isRequired", + "description": "React element prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeInstanceOf": { + "key": "propTypeInstanceOf", + "prefix": "pti", + "body": "PropTypes.instanceOf($0)", + "description": "Is an instance of a class prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeInstanceOfRequired": { + "key": "propTypeInstanceOfRequired", + "prefix": "ptir", + "body": "PropTypes.instanceOf($0).isRequired", + "description": "Is an instance of a class prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeEnum": { + "key": "propTypeEnum", + "prefix": "pte", + "body": "PropTypes.oneOf(['$0'])", + "description": "Prop type limited to specific values by treating it as an enum", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeEnumRequired": { + "key": "propTypeEnumRequired", + "prefix": "pter", + "body": "PropTypes.oneOf(['$0']).isRequired", + "description": "Prop type limited to specific values by treating it as an enum required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeOneOfType": { + "key": "propTypeOneOfType", + "prefix": "ptet", + "body": ["PropTypes.oneOfType([", " $0", "])"], + "description": "An object that could be one of many types", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeOneOfTypeRequired": { + "key": "propTypeOneOfTypeRequired", + "prefix": "ptetr", + "body": ["PropTypes.oneOfType([", " $0", "]).isRequired"], + "description": "An object that could be one of many types required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayOf": { + "key": "propTypeArrayOf", + "prefix": "ptao", + "body": "PropTypes.arrayOf($0)", + "description": "An array of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayOfRequired": { + "key": "propTypeArrayOfRequired", + "prefix": "ptaor", + "body": "PropTypes.arrayOf($0).isRequired", + "description": "An array of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectOf": { + "key": "propTypeObjectOf", + "prefix": "ptoo", + "body": "PropTypes.objectOf($0)", + "description": "An object with property values of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectOfRequired": { + "key": "propTypeObjectOfRequired", + "prefix": "ptoor", + "body": "PropTypes.objectOf($0).isRequired", + "description": "An object with property values of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeShape": { + "key": "propTypeShape", + "prefix": "ptsh", + "body": ["PropTypes.shape({", " $0", "})"], + "description": "An object taking on a particular shape", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeShapeRequired": { + "key": "propTypeShapeRequired", + "prefix": "ptshr", + "body": ["PropTypes.shape({", " $0", "}).isRequired"], + "description": "An object taking on a particular shape required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeExact": { + "key": "propTypeExact", + "prefix": "ptex", + "body": ["PropTypes.exact({", " $0", "})"], + "description": "An object with warnings on extra properties", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeExactRequired": { + "key": "propTypeExactRequired", + "prefix": "ptexr", + "body": ["PropTypes.exact({", " $0", "}).isRequired"], + "description": "An object with warnings on extra properties required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeAny": { + "key": "propTypeAny", + "prefix": "ptany", + "body": "PropTypes.any", + "description": "Any prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponent": { + "key": "reactNativeComponent", + "prefix": "rnc", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponentExport": { + "key": "reactNativeComponentExport", + "prefix": "rnce", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponentWithStyles": { + "key": "reactNativeComponentWithStyles", + "prefix": "rncs", + "body": [ + "import { Text, StyleSheet, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalComponent": { + "key": "reactNativeFunctionalComponent", + "prefix": "rnf", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalComponentWithStyles": { + "key": "reactNativeFunctionalComponentWithStyles", + "prefix": "rnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalExportComponent": { + "key": "reactNativeFunctionalExportComponent", + "prefix": "rnfe", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalExportComponentWithStyles": { + "key": "reactNativeFunctionalExportComponentWithStyles", + "prefix": "rnfes", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeImport": { + "key": "reactNativeImport", + "prefix": "imrn", + "body": "import { ${1:first} } from 'react-native'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativePureComponent": { + "key": "reactNativePureComponent", + "prefix": "rnpc", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativePureComponentExport": { + "key": "reactNativePureComponentExport", + "prefix": "rnpce", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { PureComponent } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeStyles": { + "key": "reactNativeStyles", + "prefix": "rnstyle", + "body": "const styles = StyleSheet.create({${1:first}})", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReduxConnect": { + "key": "importReduxConnect", + "prefix": "redux", + "body": "import { connect } from 'react-redux'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxAction": { + "key": "reduxAction", + "prefix": "rxaction", + "body": [ + "export const ${1:first} = (payload) => ({", + " type: ${2:second},", + " payload", + "})", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxConst": { + "key": "reduxConst", + "prefix": "rxconst", + "body": "export const ${1:first} = '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxReducer": { + "key": "reduxReducer", + "prefix": "rxreducer", + "body": [ + "const initialState = {}", + "", + "export default (state = initialState, { type, payload }) => {", + " switch (type) {", + "", + " case ${1:first}:", + " return { ...state, ...payload }", + "", + " default:", + " return state", + " }", + "}", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxSelector": { + "key": "reduxSelector", + "prefix": "rxselect", + "body": [ + "import { createSelector } from 'reselect'", + "", + "export const ${1:first} = state => state.${2:second}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxSlice": { + "key": "reduxSlice", + "prefix": "rxslice", + "body": [ + "import { createSlice } from '@reduxjs/toolkit'", + "", + "const initialState = {", + "", + "}", + "", + "const ${1:${TM_FILENAME_BASE}} = createSlice({", + " name: ${2:second},", + " initialState,", + " reducers: {}", + "});", + "", + "export const {} = ${1:${TM_FILENAME_BASE}}.actions", + "", + "export default ${1:${TM_FILENAME_BASE}}.reducer" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "mappingToProps": { + "key": "mappingToProps", + "prefix": "reduxmap", + "body": [ + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "describeBlock": { + "key": "describeBlock", + "prefix": "desc", + "body": "describe('${1:first}', () => { ${2:second} })", + "description": "Testing `describe` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "itAsyncBlock": { + "key": "itAsyncBlock", + "prefix": "tita", + "body": "it('should ${1:first}', async () => { ${2:second} })", + "description": "Testing asynchronous `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "itBlock": { + "key": "itBlock", + "prefix": "tit", + "body": "it('should ${1:first}', () => { ${2:second} })", + "description": "Testing `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactComponentTestWithRedux": { + "key": "setupReactComponentTestWithRedux", + "prefix": "srtest", + "body": [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "description": "Create test component", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactNativeTest": { + "key": "setupReactNativeTest", + "prefix": "sntest", + "body": [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactNativeTestWithRedux": { + "key": "setupReactNativeTestWithRedux", + "prefix": "snrtest", + "body": [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactTest": { + "key": "setupReactTest", + "prefix": "stest", + "body": [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "testAsyncBlock": { + "key": "testAsyncBlock", + "prefix": "testa", + "body": "test('should ${1:first}', async () => { ${2:second} })", + "description": "Testing `asynchronous test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "testBlock": { + "key": "testBlock", + "prefix": "test", + "body": "test('should ${1:first}', () => { ${2:second} })", + "description": "Testing `test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefault": { + "key": "exportDefault", + "prefix": "exp", + "body": "export default ${1:first}", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDestructing": { + "key": "exportDestructing", + "prefix": "exd", + "body": "export { ${2:second} } from '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportAs": { + "key": "exportAs", + "prefix": "exa", + "body": "export { ${2:second} as ${3:third} } from '${1:first}'", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportNamedFunction": { + "key": "exportNamedFunction", + "prefix": "enf", + "body": "export const ${1:first} = (${2:second}) => {${3:third}}", + "description": "Export named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultFunction": { + "key": "exportDefaultFunction", + "prefix": "edf", + "body": "export default (${1:first}) => {${2:second}}", + "description": "Export default function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultNamedFunction": { + "key": "exportDefaultNamedFunction", + "prefix": "ednf", + "body": "export default function ${1:first}(${2:second}) {${3:third}}", + "description": "Export default named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "method": { + "key": "method", + "prefix": "met", + "body": "${1:first} = (${2:second}) => {${3:third}}", + "description": "Creates a method inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertyGet": { + "key": "propertyGet", + "prefix": "pge", + "body": ["get ${1:first}() {", " return this.${2:second}", "}"], + "description": "Creates a getter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertySet": { + "key": "propertySet", + "prefix": "pse", + "body": "set ${1:first}(${2:second}) {${3:third}}", + "description": "Creates a setter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forEach": { + "key": "forEach", + "prefix": "fre", + "body": "${1:first}.forEach(${2:second} => {${3:third}})", + "description": "Creates a forEach statement", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forOf": { + "key": "forOf", + "prefix": "fof", + "body": "for(let ${1:first} of ${2:second}) {${3:third}}", + "description": "Iterating over property names of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forIn": { + "key": "forIn", + "prefix": "fin", + "body": "for(let ${1:first} in ${2:second}) {${3:third}}", + "description": "Iterating over property values of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "anonymousFunction": { + "key": "anonymousFunction", + "prefix": "anfn", + "body": "(${1:first}) => { ${2:second} }", + "description": "Creates an anonymous function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "namedFunction": { + "key": "namedFunction", + "prefix": "nfn", + "body": "const ${1:first} = (${2:second}) => { ${3:third} }", + "description": "Creates a named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingObject": { + "key": "destructingObject", + "prefix": "dob", + "body": "const {${2:second}} = ${1:first}", + "description": "Creates and assigns a local variable using object destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingArray": { + "key": "destructingArray", + "prefix": "dar", + "body": "const [${2:second}] = ${1:first}", + "description": "Creates and assigns a local variable using array destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setInterval": { + "key": "setInterval", + "prefix": "sti", + "body": "setInterval(() => { ${1:first} }, ${2:second})", + "description": "Executes the given function at specified intervals", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setTimeOut": { + "key": "setTimeOut", + "prefix": "sto", + "body": "setTimeout(() => { ${1:first} }, ${2:second})", + "description": "Executes the given function after the specified delay", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "promise": { + "key": "promise", + "prefix": "prom", + "body": "return new Promise((resolve, reject) => { ${1:first} })", + "description": "Creates and returns a new Promise in the standard ES7 syntax", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructProps": { + "key": "destructProps", + "prefix": "cp", + "body": "const { ${1:first} } = this.props", + "description": "Creates and assigns a local variable using props destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructState": { + "key": "destructState", + "prefix": "cs", + "body": "const { ${1:first} } = this.state", + "description": "Creates and assigns a local variable using state destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "classConstructor": { + "key": "classConstructor", + "prefix": "rconst", + "body": [ + "constructor(props) {", + " super(props)", + "", + " this.state = {", + " ${1:first}", + " }", + "}" + ], + "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "emptyState": { + "key": "emptyState", + "prefix": "est", + "body": "state = { ${1:first} }", + "description": "Creates empty state object. To be used in a constructor.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidMount": { + "key": "componentDidMount", + "prefix": "cdm", + "body": "componentDidMount() { ${1:first} }", + "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "shouldComponentUpdate": { + "key": "shouldComponentUpdate", + "prefix": "scu", + "body": "shouldComponentUpdate(nextProps, nextState) { ${1:first} }", + "description": "Invoked before rendering when new props or state are being received. ", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidUpdate": { + "key": "componentDidUpdate", + "prefix": "cdup", + "body": "componentDidUpdate(prevProps, prevState) { ${1:first}} ", + "description": "Invoked immediately after the component's updates are flushed to the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentWillUnmount": { + "key": "componentWillUnmount", + "prefix": "cwun", + "body": "componentWillUnmount() {${1:first} }", + "description": "Invoked immediately before a component is unmounted from the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getDerivedStateFromProps": { + "key": "getDerivedStateFromProps", + "prefix": "gdsfp", + "body": "static getDerivedStateFromProps(props, state) {${1:first}}", + "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getSnapshotBeforeUpdate": { + "key": "getSnapshotBeforeUpdate", + "prefix": "gsbu", + "body": "getSnapshotBeforeUpdate = (prevProps, prevState) => {${1:first}}", + "description": "Called right before mutations are made (e.g. before the DOM is updated)", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createContext": { + "key": "createContext", + "prefix": "rcontext", + "body": "const ${1:first} = React.createContext()", + "description": "Create React context", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createRef": { + "key": "createRef", + "prefix": "cref", + "body": "this.${1:first}Ref = React.createRef()", + "description": "Create ref statement used inside constructor", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateObject": { + "key": "componentSetStateObject", + "prefix": "sst", + "body": "this.setState({${1:first}})", + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateFunc": { + "key": "componentSetStateFunc", + "prefix": "ssf", + "body": "this.setState((state, props) => { return { ${1:first} }})", + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentProps": { + "key": "componentProps", + "prefix": "props", + "body": "this.props.${1:first}", + "description": "Access component's props", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentState": { + "key": "componentState", + "prefix": "state", + "body": "this.state.${1:first}", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "bindThis": { + "key": "bindThis", + "prefix": "bnd", + "body": "this.${1:first} = this.${1:first}.bind(this)", + "description": "Binds this to a method", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "commentBigBlock": { + "key": "commentBigBlock", + "prefix": "cmmb", + "body": ["/**", " * ${1:first}", " */"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponentWithRedux": { + "key": "hocComponentWithRedux", + "prefix": "hocredux", + "body": [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "import PropTypes from 'prop-types'", + "", + "export const mapStateToProps = state => ({})", + "", + "export const mapDispatchToProps = {}", + "", + "export const ${1:first} = (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "", + "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent))", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponent": { + "key": "hocComponent", + "prefix": "hoc", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "export default (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typeofSnippet": { + "key": "typeofSnippet", + "prefix": "tpf", + "body": "typeof ${1:first}", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + } +} diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts index bdbc674..d8a0377 100644 --- a/src/sourceSnippets/hooks.ts +++ b/src/sourceSnippets/hooks.ts @@ -70,7 +70,9 @@ const useCallback: HooksSnippet = { const useMemo: HooksSnippet = { key: 'useMemo', prefix: 'useMemoSnippet', - body: [`useMemo(() => ${Placeholders.FirstTab}, ${Placeholders.SecondTab})`], + body: [ + `useMemo(() => ${Placeholders.FirstTab}, [${Placeholders.SecondTab}])`, + ], }; const useRef: HooksSnippet = { @@ -99,6 +101,7 @@ const useLayoutEffect: HooksSnippet = { body: [ 'useLayoutEffect(() => {', ` ${Placeholders.FirstTab}`, + '', ' return () => {', ` ${Placeholders.SecondTab}`, ' };', diff --git a/src/sourceSnippets/redux.ts b/src/sourceSnippets/redux.ts index ed1149f..0315fc9 100644 --- a/src/sourceSnippets/redux.ts +++ b/src/sourceSnippets/redux.ts @@ -1,6 +1,6 @@ import { Placeholders, SnippetMapping } from '../types'; -type HookMappings = { +type ReduxMapping = { importReduxConnect: 'redux'; reduxAction: 'rxaction'; reduxConst: 'rxconst'; @@ -10,7 +10,7 @@ type HookMappings = { mappingToProps: 'reduxmap'; }; -export type ReduxSnippet = SnippetMapping; +export type ReduxSnippet = SnippetMapping; const importReduxConnect: ReduxSnippet = { key: 'importReduxConnect', diff --git a/src/types.ts b/src/types.ts index 0d2d726..19fa619 100644 --- a/src/types.ts +++ b/src/types.ts @@ -6,13 +6,13 @@ export type SnippetMapping = { }; export const Placeholders = { - FileName: 'FILE_NAME', - FirstTab: 'FIRST_TAB', - SecondTab: 'SECOND_TAB', - ThirdTab: 'THIRD_TAB', - Capitalize: 'CAPITALIZE', - TypeProps: 'TYPE_PROPS', - TypeState: 'TYPE_STATE', + FileName: 'file', + FirstTab: 'first', + SecondTab: 'second', + ThirdTab: 'third', + Capitalize: 'capitalize', + TypeProps: 'typeProps', + TypeState: 'typeState', } as const; export const Mappings = { From eb17ac8dc9b67bf83a418b9e0fa57698546e7553 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 22:46:12 +0100 Subject: [PATCH 098/110] chore: disable prettier by default --- package.json | 17 +---------------- src/helpers/extensionConfig.ts | 3 --- src/helpers/getPrettierConfig.ts | 6 +----- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index d1394f9..fceaf2e 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "properties": { "reactSnippets.settings.prettierEnabled": { "type": "boolean", - "markdownDescription": "Integrate prettier settings with code generated from snippets.", + "markdownDescription": "[EXPERIMENTAL: MIGHT NOT WORK]: Integrate prettier settings with code generated from snippets.", "default": false }, "reactSnippets.settings.importReactOnTop": { @@ -78,21 +78,6 @@ "markdownDescription": "Controls if React components have typescript Props typing.", "default": true }, - "reactSnippets.settings.semiColons": { - "type": "boolean", - "markdownDescription": "Controls if snippets should use semi colons.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", - "default": false - }, - "reactSnippets.settings.singleQuote": { - "type": "boolean", - "markdownDescription": "Controls if snippets should use single quotes.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", - "default": true - }, - "reactSnippets.settings.tabWidth": { - "type": "number", - "markdownDescription": "Controls how many spaces snippets will have.\nOnly applies when `#reactSnippets.settings.prettierEnabled#` is disabled", - "default": 2 - }, "reactSnippets.settings.languageScopes": { "type": "string", "markdownDescription": "defines the language scopes for which the snippets will be available.\nUse comma separated values.\nFor example: `typescript,typescriptreact,javascript,javascriptreact`", diff --git a/src/helpers/extensionConfig.ts b/src/helpers/extensionConfig.ts index 96d0a67..5301a46 100644 --- a/src/helpers/extensionConfig.ts +++ b/src/helpers/extensionConfig.ts @@ -3,11 +3,8 @@ import { workspace } from 'vscode'; export type ExtensionSettings = { languageScopes: string; prettierEnabled: boolean; - semiColons: boolean; importReactOnTop: boolean; - singleQuote: boolean; typescript: boolean; - tabWidth: number; typescriptPropsStatePrefix: 'type' | 'interface'; }; diff --git a/src/helpers/getPrettierConfig.ts b/src/helpers/getPrettierConfig.ts index 1b99d72..30fc1bd 100644 --- a/src/helpers/getPrettierConfig.ts +++ b/src/helpers/getPrettierConfig.ts @@ -8,14 +8,10 @@ prettier .then((config) => (prettierConfig = config)); const getPrettierConfig = (): Options => { - const { semiColons, singleQuote, tabWidth, prettierEnabled } = - extensionConfig(); + const { prettierEnabled } = extensionConfig(); return { parser: 'typescript', - semi: semiColons, - singleQuote, - tabWidth, ...(prettierEnabled && prettierConfig), }; }; From 3e6241663dc5190f020ad19cf186b60deac0d02f Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 22:46:30 +0100 Subject: [PATCH 099/110] 4.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fceaf2e..6e45bf1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.1.0", + "version": "4.2.0", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", From fbf6ab778143485624b737e7dbb2f38fbc1c5610 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Tue, 8 Feb 2022 23:23:53 +0100 Subject: [PATCH 100/110] feat: add removing react from imports in ts components --- .gitignore | 1 + CHANGELOG.md | 7 + package.json | 25 +- src/helpers/parseSnippetToBody.ts | 26 +- src/helpers/replaceOrRemoveReactImport.ts | 58 +- src/snippets/generated.json | 1894 --------------------- yarn.lock | 593 +++---- 7 files changed, 375 insertions(+), 2229 deletions(-) delete mode 100644 src/snippets/generated.json diff --git a/.gitignore b/.gitignore index 42ffe71..f9273d6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules *.log .DS_Store lib/ +src/snippets/generated.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 56298c0..2e616aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All info about changes # Released +[4.3.0] - 2020-12-18 + +- BREAKING CHANGES: + - From now on snippets have options for Language, React 17+ support, typescript and more. + - Added experimental prettier support, for now it's kinda buggy and needs some work. + - Refactored the codebase, moved snippets to ts files. + [3.1.0] - 2020-12-18 - Add couple of snippets and React 17 components diff --git a/package.json b/package.json index 6e45bf1..6dc9fe0 100644 --- a/package.json +++ b/package.json @@ -116,6 +116,7 @@ "scripts": { "vscode:prepublish": "yarn compile", "compile": "rm -rf lib; tsc -p ./ --noEmit false --module commonjs --outDir lib", + "compile:dev": "rm -rf lib; tsc -p ./ --noEmit false --module commonjs --outDir lib", "lint": "eslint --ext .js,.ts,.tsx ./src/", "watch": "tsc -watch -p ./", "typescript": "tsc --noEmit" @@ -127,24 +128,24 @@ "prettier": "^2" }, "devDependencies": { - "@babel/cli": "7.16.0", - "@babel/eslint-parser": "7.16.5", - "@babel/preset-typescript": "7.16.5", - "@types/node": "17.0.5", - "@types/prettier": "2.4.2", - "@types/vscode": "1.60.0", - "@typescript-eslint/eslint-plugin": "5.8.1", - "@typescript-eslint/parser": "5.8.1", - "eslint": "8.5.0", + "@babel/cli": "7.17.0", + "@babel/eslint-parser": "7.17.0", + "@babel/preset-typescript": "7.16.7", + "@types/node": "17.0.16", + "@types/prettier": "2.4.3", + "@types/vscode": "1.64.0", + "@typescript-eslint/eslint-plugin": "5.11.0", + "@typescript-eslint/parser": "5.11.0", + "eslint": "8.8.0", "eslint-config-prettier": "8.3.0", "eslint-plugin-babel": "5.3.1", "eslint-plugin-eslint-comments": "3.2.0", - "eslint-plugin-import": "2.25.3", - "eslint-plugin-jest": "25.3.3", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-jest": "26.1.0", "eslint-plugin-prettier": "4.0.0", "eslint-plugin-simple-import-sort": "7.0.0", "prettier": "2.5.1", - "typescript": "4.5.4" + "typescript": "4.5.5" }, "prettier": { "bracketSameLine": false, diff --git a/src/helpers/parseSnippetToBody.ts b/src/helpers/parseSnippetToBody.ts index 17c8ce6..b8a7e7e 100644 --- a/src/helpers/parseSnippetToBody.ts +++ b/src/helpers/parseSnippetToBody.ts @@ -3,25 +3,6 @@ import { formatSnippet } from './formatters'; import { Snippet } from './generateSnippets'; import replaceOrRemoveReactImport from './replaceOrRemoveReactImport'; -const withReactImport = [ - 'rfce', - 'rfc', - 'rfcp', - 'rafce', - 'rafc', - 'rafcp', - 'rnfe', - 'rnfes', - 'rnf', - 'rnfs', - 'stest', - 'sntest', - 'srtest', - 'snrtest', - 'hocredux', - 'hoc', -]; - const parseSnippetToBody = (snippet: Snippet) => { const { importReactOnTop } = extensionConfig(); const body = @@ -29,9 +10,10 @@ const parseSnippetToBody = (snippet: Snippet) => { const snippetBody = importReactOnTop ? body - : withReactImport.includes(snippet.prefix) - ? replaceOrRemoveReactImport(snippet.body) - : body; + : replaceOrRemoveReactImport({ + prefix: snippet.prefix, + body: snippet.body, + }); const formattedSnippet = formatSnippet(snippetBody).split('\n'); diff --git a/src/helpers/replaceOrRemoveReactImport.ts b/src/helpers/replaceOrRemoveReactImport.ts index b8a699f..74d4e51 100644 --- a/src/helpers/replaceOrRemoveReactImport.ts +++ b/src/helpers/replaceOrRemoveReactImport.ts @@ -1,16 +1,64 @@ -const replaceOrRemoveReactImport = (snippetBody: string[]) => { - const reactImportIndex = snippetBody.findIndex((line) => +import { Snippet } from './generateSnippets'; + +const snippetWithReactImportPrefixes = [ + 'rfce', + 'rfc', + 'rfcp', + 'rafce', + 'rafc', + 'rafcp', + 'rnfe', + 'rnfes', + 'rnf', + 'rnfs', + 'stest', + 'sntest', + 'srtest', + 'snrtest', + 'hocredux', + 'hoc', + 'tsrafc', + 'tsrafce', + 'tsrcc', + 'tsrcredux', + 'tsrce', + 'tsrpce', + 'tsrpc', + 'tsrfc', + 'tsrfce', + 'tsrnf', + 'tsrnfs', +]; + +const replaceOrRemoveReactImport = ({ + body, + prefix, +}: { + body: string[]; + prefix: Snippet['prefix']; +}) => { + if (!snippetWithReactImportPrefixes.includes(prefix)) { + return body.join('\n'); + } + + let bodyCopy = [...body]; + const reactImportIndex = bodyCopy.findIndex((line) => line.match(new RegExp(/import React/, 'g')), ); if (reactImportIndex !== -1) { - const line = snippetBody[reactImportIndex]; - snippetBody[reactImportIndex] = line + const line = bodyCopy[reactImportIndex]; + const newLine = line .replace(new RegExp(/^import React .*$/, 'g'), '') .replace(new RegExp(/^import React, /, 'g'), 'import '); + + bodyCopy[reactImportIndex] = newLine; + if (!newLine.length) { + bodyCopy = bodyCopy.filter(Boolean); + } } - return snippetBody.join('\n'); + return bodyCopy.join('\n'); }; export default replaceOrRemoveReactImport; diff --git a/src/snippets/generated.json b/src/snippets/generated.json deleted file mode 100644 index 863bbbd..0000000 --- a/src/snippets/generated.json +++ /dev/null @@ -1,1894 +0,0 @@ -{ - "exportType": { - "body": "export type ${1:first} = {${2:second}}", - "key": "exportType", - "prefix": "exptp", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportInterface": { - "key": "exportInterface", - "prefix": "expint", - "body": "export interface ${1:first} {${2:second}}", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassComponent": { - "key": "typescriptReactClassComponent", - "prefix": "tsrcc", - "description": "Creates a React component class with ES7 module system and TypeScript interfaces", - "body": [ - "import React, { Component } from 'react'", - "", - "type Props = {}", - "", - "type State = {}", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassExportComponent": { - "key": "typescriptReactClassExportComponent", - "prefix": "tsrce", - "body": [ - "import React, { Component } from 'react'", - "", - "type Props = {}", - "", - "type State = {}", - "", - "class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React component class with ES7 module system and TypeScript interfaces", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactFunctionalExportComponent": { - "key": "typescriptReactFunctionalExportComponent", - "prefix": "tsrfce", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "function ${1:${TM_FILENAME_BASE}}({}: Props) {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactFunctionalComponent": { - "key": "typescriptReactFunctionalComponent", - "prefix": "tsrfc", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", - " return (", - "
${1:first}
", - " )", - "}" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactArrowFunctionExportComponent": { - "key": "typescriptReactArrowFunctionExportComponent", - "prefix": "tsrafce", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactArrowFunctionComponent": { - "key": "typescriptReactArrowFunctionComponent", - "prefix": "tsrafc", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - "
${1:first}
", - " )", - "}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassPureComponent": { - "key": "typescriptReactClassPureComponent", - "prefix": "tsrpc", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "type Props = {}", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassExportPureComponent": { - "key": "typescriptReactClassExportPureComponent", - "prefix": "tsrpce", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "type Props = {}", - "", - "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassComponentRedux": { - "key": "typescriptReactClassComponentRedux", - "prefix": "tsrcredux", - "body": [ - "import { connect } from 'react-redux'", - "import React, { Component } from 'react'", - "", - "type Props = {}", - "", - "type State = {}", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactNativeArrowFunctionComponent": { - "key": "typescriptReactNativeArrowFunctionComponent", - "prefix": "tsrnf", - "body": [ - "import { View, Text } from 'react-native'", - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system in TypeScript", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactNativeArrowFunctionComponentWithStyles": { - "key": "typescriptReactNativeArrowFunctionComponentWithStyles", - "prefix": "tsrnfs", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "const styles = StyleSheet.create({})" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionComponent": { - "key": "reactArrowFunctionComponent", - "prefix": "rafc", - "body": [ - "import React from 'react'", - "", - "export const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - "
${1:first}
", - " )", - "}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionComponentWithPropTypes": { - "key": "reactArrowFunctionComponentWithPropTypes", - "prefix": "rafcp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "const ${1:${TM_FILENAME_BASE}} = props => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionExportComponent": { - "key": "reactArrowFunctionExportComponent", - "prefix": "rafce", - "body": [ - "import React from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponent": { - "key": "reactClassComponent", - "prefix": "rcc", - "body": [ - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentPropTypes": { - "key": "reactClassComponentPropTypes", - "prefix": "rccp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {${2:second}: ${3:third}}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with PropTypes and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentRedux": { - "key": "reactClassComponentRedux", - "prefix": "rcredux", - "body": [ - "import React, { Component } from 'react'", - "import { connect } from 'react-redux'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React component class with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentReduxPropTypes": { - "key": "reactClassComponentReduxPropTypes", - "prefix": "rcreduxp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { Component } from 'react'", - "import { connect } from 'react-redux'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {", - " ${2:second}: ${3:third}", - " }", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportComponent": { - "key": "reactClassExportComponent", - "prefix": "rce", - "body": [ - "import React, { Component } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportComponentWithPropTypes": { - "key": "reactClassExportComponentWithPropTypes", - "prefix": "rcep", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { Component } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportPureComponent": { - "key": "reactClassExportPureComponent", - "prefix": "rpce", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React pure component class with ES7 module system export", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassPureComponent": { - "key": "reactClassPureComponent", - "prefix": "rpc", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React pure component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassPureComponentWithPropTypes": { - "key": "reactClassPureComponentWithPropTypes", - "prefix": "rpcp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " static propTypes = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionMemoComponent": { - "key": "reactFunctionMemoComponent", - "prefix": "rmc", - "body": [ - "import React, { memo } from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = memo(() => {", - " return (", - "
${1:first}
", - " )", - "})", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Memo Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionMemoComponentWithPropTypes": { - "key": "reactFunctionMemoComponentWithPropTypes", - "prefix": "rmcp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { memo } from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = memo((props) => {", - " return (", - "
${1:first}
", - " )", - "})", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponent": { - "key": "reactFunctionalComponent", - "prefix": "rfc", - "body": [ - "import React from 'react'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - "
${1:first}
", - " )", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentRedux": { - "key": "reactFunctionalComponentRedux", - "prefix": "rfcredux", - "body": [ - "import React from 'react'", - "import { connect } from 'react-redux'", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React functional component with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentReduxPropTypes": { - "key": "reactFunctionalComponentReduxPropTypes", - "prefix": "rfcreduxp", - "body": [ - "import PropTypes from 'prop-types'", - "import React from 'react'", - "import { connect } from 'react-redux'", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - " ${2:second}: PropTypes.${3:third}", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentWithPropTypes": { - "key": "reactFunctionalComponentWithPropTypes", - "prefix": "rfcp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "function ${1:${TM_FILENAME_BASE}}(props) {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalExportComponent": { - "key": "reactFunctionalExportComponent", - "prefix": "rfce", - "body": [ - "import React from 'react'", - "", - "function ${1:${TM_FILENAME_BASE}}() {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Functional Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleAssert": { - "key": "consoleAssert", - "prefix": "cas", - "body": "console.assert(${1:first}, ${2:second})", - "description": "If the specified expression is false, the message is written to the console along with a stack trace", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleClear": { - "key": "consoleClear", - "prefix": "ccl", - "body": "console.clear()", - "description": "Clears the console", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleCount": { - "key": "consoleCount", - "prefix": "cco", - "body": "console.count(${1:first})", - "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleDir": { - "key": "consoleDir", - "prefix": "cdi", - "body": "console.dir(${1:first})", - "description": "Prints a JavaScript representation of the specified object", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleError": { - "key": "consoleError", - "prefix": "cer", - "body": "console.error(${1:first})", - "description": "Displays a message in the console and also includes a stack trace from where the method was called", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleGroup": { - "key": "consoleGroup", - "prefix": "cgr", - "body": "console.group('${1:first}')", - "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleGroupEnd": { - "key": "consoleGroupEnd", - "prefix": "cge", - "body": "console.groupEnd()", - "description": "Closes out the corresponding console.group().", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLog": { - "key": "consoleLog", - "prefix": "clg", - "body": "console.log(${1:first})", - "description": "Displays a message in the console", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTrace": { - "key": "consoleTrace", - "prefix": "ctr", - "body": "console.trace(${1:first})", - "description": "Prints a stack trace from the point where the method was called", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLogObject": { - "key": "consoleLogObject", - "prefix": "clo", - "body": "console.log('${1:first}', ${1:first})", - "description": "Logs property with name.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLogJson": { - "key": "consoleLogJson", - "prefix": "clj", - "body": "console.log('${1:first}', JSON.stringify(${1:first}, null, 2))", - "description": "Logs stringified JSON property with name.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTime": { - "key": "consoleTime", - "prefix": "ctm", - "body": "console.time('${1:first}')", - "description": "Console time wrapper", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTimeEnd": { - "key": "consoleTimeEnd", - "prefix": "cte", - "body": "console.timeEnd('${1:first}')", - "description": "Console time end wrapper", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleWarn": { - "key": "consoleWarn", - "prefix": "cwa", - "body": "console.warn(${1:first})", - "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleInfo": { - "key": "consoleInfo", - "prefix": "cin", - "body": "console.info(${1:first})", - "description": "Displays a message in the console but also displays a blue information icon along with the logged message", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useCallback": { - "key": "useCallback", - "prefix": "useCallbackSnippet", - "body": [ - "useCallback(", - " () => {", - " ${1:first}", - " },", - " [${2:second}],", - ")", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useContext": { - "key": "useContext", - "prefix": "useContextSnippet", - "body": "const ${1:first} = useContext(${2:second})", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useEffect": { - "key": "useEffect", - "prefix": "useEffectSnippet", - "body": [ - "useEffect(() => {", - " ${1:first}", - "", - " return () => {", - " ${2:second}", - " }", - "}, [${3:third}])", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useImperativeHandle": { - "key": "useImperativeHandle", - "prefix": "useImperativeHandleSnippet", - "body": [ - "useImperativeHandle(", - " ${1:first},", - " () => {", - " ${2:second}", - " },", - " [${3:third}],", - ")" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useLayoutEffect": { - "key": "useLayoutEffect", - "prefix": "useLayoutEffectSnippet", - "body": [ - "useLayoutEffect(() => {", - " ${1:first}", - "", - " return () => {", - " ${2:second}", - " };", - "}, [${3:third}])" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useMemo": { - "key": "useMemo", - "prefix": "useMemoSnippet", - "body": "useMemo(() => ${1:first}, [${2:second}])", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useReducer": { - "key": "useReducer", - "prefix": "useReducerSnippet", - "body": "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third})", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useRef": { - "key": "useRef", - "prefix": "useRefSnippet", - "body": "const ${1:first} = useRef(${2:second})", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useState": { - "key": "useState", - "prefix": "useStateSnippet", - "body": "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second})", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importAs": { - "key": "importAs", - "prefix": "ima", - "body": "import { ${2:second} as ${3:third} } from '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importBrowserRouter": { - "key": "importBrowserRouter", - "prefix": "imbr", - "body": "import { BrowserRouter as Router } from 'react-router-dom'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importBrowserRouterWithRouteAndNavLink": { - "key": "importBrowserRouterWithRouteAndNavLink", - "prefix": "imrr", - "body": [ - "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importDestructing": { - "key": "importDestructing", - "prefix": "imd", - "body": "import { ${2:second} } from '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importEverything": { - "key": "importEverything", - "prefix": "ime", - "body": "import * as ${2:second} from '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importNoModuleName": { - "key": "importNoModuleName", - "prefix": "imn", - "body": "import '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importPropTypes": { - "key": "importPropTypes", - "prefix": "impt", - "body": "import PropTypes from 'prop-types'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReact": { - "key": "importReact", - "prefix": "imr", - "body": "import React from 'react'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactDom": { - "key": "importReactDom", - "prefix": "imrd", - "body": "import ReactDOM from 'react-dom'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithComponent": { - "key": "importReactWithComponent", - "prefix": "imrc", - "body": "import React, { Component } from 'react'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithComponentAndPropTypes": { - "key": "importReactWithComponentAndPropTypes", - "prefix": "imrcp", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithMemo": { - "key": "importReactWithMemo", - "prefix": "imrm", - "body": "import React, { memo } from 'react'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithMemoAndPropTypes": { - "key": "importReactWithMemoAndPropTypes", - "prefix": "imrmp", - "body": [ - "import React, { memo } from 'react'", - "import PropTypes from 'prop-types'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithPureComponent": { - "key": "importReactWithPureComponent", - "prefix": "imrpc", - "body": "import React, { PureComponent } from 'react'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithPureComponentAndPropTypes": { - "key": "importReactWithPureComponentAndPropTypes", - "prefix": "imrpcp", - "body": [ - "import React, { PureComponent } from 'react'", - "import PropTypes from 'prop-types'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterLink": { - "key": "importRouterLink", - "prefix": "imbrl", - "body": "import { Link } from 'react-router-dom'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterNavLink": { - "key": "importRouterNavLink", - "prefix": "imbrnl", - "body": "import { NavLink } from 'react-router-dom'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterSetup": { - "key": "importRouterSetup", - "prefix": "imbrc", - "body": "import { Route, Switch, NavLink, Link } from 'react-router-dom'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterSwitch": { - "key": "importRouterSwitch", - "prefix": "imbrs", - "body": "import { Switch } from 'react-router-dom'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "import": { - "key": "import", - "prefix": "imp", - "body": "import ${2:second} from '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArray": { - "key": "propTypeArray", - "prefix": "pta", - "body": "PropTypes.array", - "description": "Array prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayRequired": { - "key": "propTypeArrayRequired", - "prefix": "ptar", - "body": "PropTypes.array.isRequired", - "description": "Array prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeBool": { - "key": "propTypeBool", - "prefix": "ptb", - "body": "PropTypes.bool", - "description": "Bool prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeBoolRequired": { - "key": "propTypeBoolRequired", - "prefix": "ptbr", - "body": "PropTypes.bool.isRequired", - "description": "Bool prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeFunc": { - "key": "propTypeFunc", - "prefix": "ptf", - "body": "PropTypes.func", - "description": "Func prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeFuncRequired": { - "key": "propTypeFuncRequired", - "prefix": "ptfr", - "body": "PropTypes.func.isRequired", - "description": "Func prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNumber": { - "key": "propTypeNumber", - "prefix": "ptn", - "body": "PropTypes.number", - "description": "Number prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNumberRequired": { - "key": "propTypeNumberRequired", - "prefix": "ptnr", - "body": "PropTypes.number.isRequired", - "description": "Number prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObject": { - "key": "propTypeObject", - "prefix": "pto", - "body": "PropTypes.object", - "description": "Object prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectRequired": { - "key": "propTypeObjectRequired", - "prefix": "ptor", - "body": "PropTypes.object.isRequired", - "description": "Object prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeString": { - "key": "propTypeString", - "prefix": "pts", - "body": "PropTypes.string", - "description": "String prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeStringRequired": { - "key": "propTypeStringRequired", - "prefix": "ptsr", - "body": "PropTypes.string.isRequired", - "description": "String prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNode": { - "key": "propTypeNode", - "prefix": "ptnd", - "body": "PropTypes.node", - "description": "Anything that can be rendered: numbers, strings, elements or an array", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNodeRequired": { - "key": "propTypeNodeRequired", - "prefix": "ptndr", - "body": "PropTypes.node.isRequired", - "description": "Anything that can be rendered: numbers, strings, elements or an array required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeElement": { - "key": "propTypeElement", - "prefix": "ptel", - "body": "PropTypes.element", - "description": "React element prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeElementRequired": { - "key": "propTypeElementRequired", - "prefix": "ptelr", - "body": "PropTypes.element.isRequired", - "description": "React element prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeInstanceOf": { - "key": "propTypeInstanceOf", - "prefix": "pti", - "body": "PropTypes.instanceOf($0)", - "description": "Is an instance of a class prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeInstanceOfRequired": { - "key": "propTypeInstanceOfRequired", - "prefix": "ptir", - "body": "PropTypes.instanceOf($0).isRequired", - "description": "Is an instance of a class prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeEnum": { - "key": "propTypeEnum", - "prefix": "pte", - "body": "PropTypes.oneOf(['$0'])", - "description": "Prop type limited to specific values by treating it as an enum", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeEnumRequired": { - "key": "propTypeEnumRequired", - "prefix": "pter", - "body": "PropTypes.oneOf(['$0']).isRequired", - "description": "Prop type limited to specific values by treating it as an enum required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeOneOfType": { - "key": "propTypeOneOfType", - "prefix": "ptet", - "body": ["PropTypes.oneOfType([", " $0", "])"], - "description": "An object that could be one of many types", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeOneOfTypeRequired": { - "key": "propTypeOneOfTypeRequired", - "prefix": "ptetr", - "body": ["PropTypes.oneOfType([", " $0", "]).isRequired"], - "description": "An object that could be one of many types required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayOf": { - "key": "propTypeArrayOf", - "prefix": "ptao", - "body": "PropTypes.arrayOf($0)", - "description": "An array of a certain type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayOfRequired": { - "key": "propTypeArrayOfRequired", - "prefix": "ptaor", - "body": "PropTypes.arrayOf($0).isRequired", - "description": "An array of a certain type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectOf": { - "key": "propTypeObjectOf", - "prefix": "ptoo", - "body": "PropTypes.objectOf($0)", - "description": "An object with property values of a certain type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectOfRequired": { - "key": "propTypeObjectOfRequired", - "prefix": "ptoor", - "body": "PropTypes.objectOf($0).isRequired", - "description": "An object with property values of a certain type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeShape": { - "key": "propTypeShape", - "prefix": "ptsh", - "body": ["PropTypes.shape({", " $0", "})"], - "description": "An object taking on a particular shape", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeShapeRequired": { - "key": "propTypeShapeRequired", - "prefix": "ptshr", - "body": ["PropTypes.shape({", " $0", "}).isRequired"], - "description": "An object taking on a particular shape required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeExact": { - "key": "propTypeExact", - "prefix": "ptex", - "body": ["PropTypes.exact({", " $0", "})"], - "description": "An object with warnings on extra properties", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeExactRequired": { - "key": "propTypeExactRequired", - "prefix": "ptexr", - "body": ["PropTypes.exact({", " $0", "}).isRequired"], - "description": "An object with warnings on extra properties required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeAny": { - "key": "propTypeAny", - "prefix": "ptany", - "body": "PropTypes.any", - "description": "Any prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponent": { - "key": "reactNativeComponent", - "prefix": "rnc", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponentExport": { - "key": "reactNativeComponentExport", - "prefix": "rnce", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { Component } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponentWithStyles": { - "key": "reactNativeComponentWithStyles", - "prefix": "rncs", - "body": [ - "import { Text, StyleSheet, View } from 'react-native'", - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}", - "", - "const styles = StyleSheet.create({})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalComponent": { - "key": "reactNativeFunctionalComponent", - "prefix": "rnf", - "body": [ - "import { View, Text } from 'react-native'", - "import React from 'react'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalComponentWithStyles": { - "key": "reactNativeFunctionalComponentWithStyles", - "prefix": "rnfs", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "import React from 'react'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "const styles = StyleSheet.create({})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalExportComponent": { - "key": "reactNativeFunctionalExportComponent", - "prefix": "rnfe", - "body": [ - "import { View, Text } from 'react-native'", - "import React from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalExportComponentWithStyles": { - "key": "reactNativeFunctionalExportComponentWithStyles", - "prefix": "rnfes", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "import React from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "const styles = StyleSheet.create({})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeImport": { - "key": "reactNativeImport", - "prefix": "imrn", - "body": "import { ${1:first} } from 'react-native'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativePureComponent": { - "key": "reactNativePureComponent", - "prefix": "rnpc", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativePureComponentExport": { - "key": "reactNativePureComponentExport", - "prefix": "rnpce", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { PureComponent } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeStyles": { - "key": "reactNativeStyles", - "prefix": "rnstyle", - "body": "const styles = StyleSheet.create({${1:first}})", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReduxConnect": { - "key": "importReduxConnect", - "prefix": "redux", - "body": "import { connect } from 'react-redux'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxAction": { - "key": "reduxAction", - "prefix": "rxaction", - "body": [ - "export const ${1:first} = (payload) => ({", - " type: ${2:second},", - " payload", - "})", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxConst": { - "key": "reduxConst", - "prefix": "rxconst", - "body": "export const ${1:first} = '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxReducer": { - "key": "reduxReducer", - "prefix": "rxreducer", - "body": [ - "const initialState = {}", - "", - "export default (state = initialState, { type, payload }) => {", - " switch (type) {", - "", - " case ${1:first}:", - " return { ...state, ...payload }", - "", - " default:", - " return state", - " }", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxSelector": { - "key": "reduxSelector", - "prefix": "rxselect", - "body": [ - "import { createSelector } from 'reselect'", - "", - "export const ${1:first} = state => state.${2:second}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxSlice": { - "key": "reduxSlice", - "prefix": "rxslice", - "body": [ - "import { createSlice } from '@reduxjs/toolkit'", - "", - "const initialState = {", - "", - "}", - "", - "const ${1:${TM_FILENAME_BASE}} = createSlice({", - " name: ${2:second},", - " initialState,", - " reducers: {}", - "});", - "", - "export const {} = ${1:${TM_FILENAME_BASE}}.actions", - "", - "export default ${1:${TM_FILENAME_BASE}}.reducer" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "mappingToProps": { - "key": "mappingToProps", - "prefix": "reduxmap", - "body": [ - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "describeBlock": { - "key": "describeBlock", - "prefix": "desc", - "body": "describe('${1:first}', () => { ${2:second} })", - "description": "Testing `describe` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "itAsyncBlock": { - "key": "itAsyncBlock", - "prefix": "tita", - "body": "it('should ${1:first}', async () => { ${2:second} })", - "description": "Testing asynchronous `it` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "itBlock": { - "key": "itBlock", - "prefix": "tit", - "body": "it('should ${1:first}', () => { ${2:second} })", - "description": "Testing `it` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactComponentTestWithRedux": { - "key": "setupReactComponentTestWithRedux", - "prefix": "srtest", - "body": [ - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from '~/store'", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(", - " ", - " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - " ,", - " )", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "description": "Create test component", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactNativeTest": { - "key": "setupReactNativeTest", - "prefix": "sntest", - "body": [ - "import 'react-native'", - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactNativeTestWithRedux": { - "key": "setupReactNativeTestWithRedux", - "prefix": "snrtest", - "body": [ - "import 'react-native'", - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from '~/store'", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(", - " ", - " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - " ,", - " )", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactTest": { - "key": "setupReactTest", - "prefix": "stest", - "body": [ - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "testAsyncBlock": { - "key": "testAsyncBlock", - "prefix": "testa", - "body": "test('should ${1:first}', async () => { ${2:second} })", - "description": "Testing `asynchronous test` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "testBlock": { - "key": "testBlock", - "prefix": "test", - "body": "test('should ${1:first}', () => { ${2:second} })", - "description": "Testing `test` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefault": { - "key": "exportDefault", - "prefix": "exp", - "body": "export default ${1:first}", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDestructing": { - "key": "exportDestructing", - "prefix": "exd", - "body": "export { ${2:second} } from '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportAs": { - "key": "exportAs", - "prefix": "exa", - "body": "export { ${2:second} as ${3:third} } from '${1:first}'", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportNamedFunction": { - "key": "exportNamedFunction", - "prefix": "enf", - "body": "export const ${1:first} = (${2:second}) => {${3:third}}", - "description": "Export named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefaultFunction": { - "key": "exportDefaultFunction", - "prefix": "edf", - "body": "export default (${1:first}) => {${2:second}}", - "description": "Export default function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefaultNamedFunction": { - "key": "exportDefaultNamedFunction", - "prefix": "ednf", - "body": "export default function ${1:first}(${2:second}) {${3:third}}", - "description": "Export default named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "method": { - "key": "method", - "prefix": "met", - "body": "${1:first} = (${2:second}) => {${3:third}}", - "description": "Creates a method inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propertyGet": { - "key": "propertyGet", - "prefix": "pge", - "body": ["get ${1:first}() {", " return this.${2:second}", "}"], - "description": "Creates a getter property inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propertySet": { - "key": "propertySet", - "prefix": "pse", - "body": "set ${1:first}(${2:second}) {${3:third}}", - "description": "Creates a setter property inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forEach": { - "key": "forEach", - "prefix": "fre", - "body": "${1:first}.forEach(${2:second} => {${3:third}})", - "description": "Creates a forEach statement", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forOf": { - "key": "forOf", - "prefix": "fof", - "body": "for(let ${1:first} of ${2:second}) {${3:third}}", - "description": "Iterating over property names of iterable objects", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forIn": { - "key": "forIn", - "prefix": "fin", - "body": "for(let ${1:first} in ${2:second}) {${3:third}}", - "description": "Iterating over property values of iterable objects", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "anonymousFunction": { - "key": "anonymousFunction", - "prefix": "anfn", - "body": "(${1:first}) => { ${2:second} }", - "description": "Creates an anonymous function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "namedFunction": { - "key": "namedFunction", - "prefix": "nfn", - "body": "const ${1:first} = (${2:second}) => { ${3:third} }", - "description": "Creates a named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructingObject": { - "key": "destructingObject", - "prefix": "dob", - "body": "const {${2:second}} = ${1:first}", - "description": "Creates and assigns a local variable using object destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructingArray": { - "key": "destructingArray", - "prefix": "dar", - "body": "const [${2:second}] = ${1:first}", - "description": "Creates and assigns a local variable using array destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setInterval": { - "key": "setInterval", - "prefix": "sti", - "body": "setInterval(() => { ${1:first} }, ${2:second})", - "description": "Executes the given function at specified intervals", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setTimeOut": { - "key": "setTimeOut", - "prefix": "sto", - "body": "setTimeout(() => { ${1:first} }, ${2:second})", - "description": "Executes the given function after the specified delay", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "promise": { - "key": "promise", - "prefix": "prom", - "body": "return new Promise((resolve, reject) => { ${1:first} })", - "description": "Creates and returns a new Promise in the standard ES7 syntax", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructProps": { - "key": "destructProps", - "prefix": "cp", - "body": "const { ${1:first} } = this.props", - "description": "Creates and assigns a local variable using props destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructState": { - "key": "destructState", - "prefix": "cs", - "body": "const { ${1:first} } = this.state", - "description": "Creates and assigns a local variable using state destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "classConstructor": { - "key": "classConstructor", - "prefix": "rconst", - "body": [ - "constructor(props) {", - " super(props)", - "", - " this.state = {", - " ${1:first}", - " }", - "}" - ], - "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "emptyState": { - "key": "emptyState", - "prefix": "est", - "body": "state = { ${1:first} }", - "description": "Creates empty state object. To be used in a constructor.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentDidMount": { - "key": "componentDidMount", - "prefix": "cdm", - "body": "componentDidMount() { ${1:first} }", - "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "shouldComponentUpdate": { - "key": "shouldComponentUpdate", - "prefix": "scu", - "body": "shouldComponentUpdate(nextProps, nextState) { ${1:first} }", - "description": "Invoked before rendering when new props or state are being received. ", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentDidUpdate": { - "key": "componentDidUpdate", - "prefix": "cdup", - "body": "componentDidUpdate(prevProps, prevState) { ${1:first}} ", - "description": "Invoked immediately after the component's updates are flushed to the DOM.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentWillUnmount": { - "key": "componentWillUnmount", - "prefix": "cwun", - "body": "componentWillUnmount() {${1:first} }", - "description": "Invoked immediately before a component is unmounted from the DOM.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "getDerivedStateFromProps": { - "key": "getDerivedStateFromProps", - "prefix": "gdsfp", - "body": "static getDerivedStateFromProps(props, state) {${1:first}}", - "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "getSnapshotBeforeUpdate": { - "key": "getSnapshotBeforeUpdate", - "prefix": "gsbu", - "body": "getSnapshotBeforeUpdate = (prevProps, prevState) => {${1:first}}", - "description": "Called right before mutations are made (e.g. before the DOM is updated)", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "createContext": { - "key": "createContext", - "prefix": "rcontext", - "body": "const ${1:first} = React.createContext()", - "description": "Create React context", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "createRef": { - "key": "createRef", - "prefix": "cref", - "body": "this.${1:first}Ref = React.createRef()", - "description": "Create ref statement used inside constructor", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentSetStateObject": { - "key": "componentSetStateObject", - "prefix": "sst", - "body": "this.setState({${1:first}})", - "description": "Performs a shallow merge of nextState into current state", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentSetStateFunc": { - "key": "componentSetStateFunc", - "prefix": "ssf", - "body": "this.setState((state, props) => { return { ${1:first} }})", - "description": "Performs a shallow merge of nextState into current state", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentProps": { - "key": "componentProps", - "prefix": "props", - "body": "this.props.${1:first}", - "description": "Access component's props", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentState": { - "key": "componentState", - "prefix": "state", - "body": "this.state.${1:first}", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "bindThis": { - "key": "bindThis", - "prefix": "bnd", - "body": "this.${1:first} = this.${1:first}.bind(this)", - "description": "Binds this to a method", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "commentBigBlock": { - "key": "commentBigBlock", - "prefix": "cmmb", - "body": ["/**", " * ${1:first}", " */"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "hocComponentWithRedux": { - "key": "hocComponentWithRedux", - "prefix": "hocredux", - "body": [ - "import React from 'react'", - "import { connect } from 'react-redux'", - "import PropTypes from 'prop-types'", - "", - "export const mapStateToProps = state => ({})", - "", - "export const mapDispatchToProps = {}", - "", - "export const ${1:first} = (WrappedComponent) => {", - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {}", - "", - " return hocComponent", - "}", - "", - "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent))", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "hocComponent": { - "key": "hocComponent", - "prefix": "hoc", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default (WrappedComponent) => {", - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {}", - "", - " return hocComponent", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typeofSnippet": { - "key": "typeofSnippet", - "prefix": "tpf", - "body": "typeof ${1:first}", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - } -} diff --git a/yarn.lock b/yarn.lock index d7a742c..95a761b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@babel/cli@7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.16.0.tgz#a729b7a48eb80b49f48a339529fc4129fd7bcef3" - integrity sha512-WLrM42vKX/4atIoQB+eb0ovUof53UUvecb4qGjU2PDDWRiZr50ZpiV8NpcLo7iSxeGYrRG0Mqembsa+UrTAV6Q== +"@babel/cli@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.17.0.tgz#9b932d8f08a2e218fcdd9bba456044eb0a2e0b2c" + integrity sha512-es10YH/ejXbg551vtnmEzIPe3MQRNOS644o3pf8vUr1tIeNzVNlP8BBvs1Eh7roh5A+k2fEHUas+ZptOWHA1fQ== dependencies: commander "^4.0.1" convert-source-map "^1.1.0" @@ -18,198 +18,198 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" - integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== +"@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== dependencies: - "@babel/highlight" "^7.16.0" + "@babel/highlight" "^7.16.7" -"@babel/eslint-parser@7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.16.5.tgz#48d3485091d6e36915358e4c0d0b2ebe6da90462" - integrity sha512-mUqYa46lgWqHKQ33Q6LNCGp/wPR3eqOYTUixHFsfrSQqRxH0+WOzca75iEjFr5RDGH1dDz622LaHhLOzOuQRUA== +"@babel/eslint-parser@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.17.0.tgz#eabb24ad9f0afa80e5849f8240d0e5facc2d90d6" + integrity sha512-PUEJ7ZBXbRkbq3qqM/jZ2nIuakUBqCYc7Qf52Lj7dlZ6zERnqisdHioL0l4wwQZnmskMeasqUNzLBFKs3nylXA== dependencies: eslint-scope "^5.1.1" eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.5.tgz#26e1192eb8f78e0a3acaf3eede3c6fc96d22bedf" - integrity sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA== +"@babel/generator@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.0.tgz#7bd890ba706cd86d3e2f727322346ffdbf98f65e" + integrity sha512-I3Omiv6FGOC29dtlZhkfXO6pgkmukJSlT26QjVvS1DGZe/NzSVCPG41X0tS21oZkJYlovfj9qDWgKP+Cn4bXxw== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.17.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz#9a1f0ebcda53d9a2d00108c4ceace6a5d5f1f08d" - integrity sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-create-class-features-plugin@^7.16.0": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz#5d1bcd096792c1ebec6249eebc6358eec55d0cad" - integrity sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.0" - "@babel/helper-environment-visitor" "^7.16.5" - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-member-expression-to-functions" "^7.16.5" - "@babel/helper-optimise-call-expression" "^7.16.0" - "@babel/helper-replace-supers" "^7.16.5" - "@babel/helper-split-export-declaration" "^7.16.0" - -"@babel/helper-environment-visitor@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz#f6a7f38b3c6d8b07c88faea083c46c09ef5451b8" - integrity sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-function-name@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" - integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== - dependencies: - "@babel/helper-get-function-arity" "^7.16.0" - "@babel/template" "^7.16.0" - "@babel/types" "^7.16.0" - -"@babel/helper-get-function-arity@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" - integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-hoist-variables@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" - integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-member-expression-to-functions@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz#1bc9f7e87354e86f8879c67b316cb03d3dc2caab" - integrity sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-optimise-call-expression@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" - integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz#afe37a45f39fce44a3d50a7958129ea5b1a5c074" - integrity sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ== - -"@babel/helper-replace-supers@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz#96d3988bd0ab0a2d22c88c6198c3d3234ca25326" - integrity sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ== - dependencies: - "@babel/helper-environment-visitor" "^7.16.5" - "@babel/helper-member-expression-to-functions" "^7.16.5" - "@babel/helper-optimise-call-expression" "^7.16.0" - "@babel/traverse" "^7.16.5" - "@babel/types" "^7.16.0" - -"@babel/helper-split-export-declaration@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" - integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/highlight@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" - integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== - dependencies: - "@babel/helper-validator-identifier" "^7.15.7" +"@babel/helper-annotate-as-pure@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" + integrity sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-create-class-features-plugin@^7.16.7": + version "7.17.1" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.1.tgz#9699f14a88833a7e055ce57dcd3ffdcd25186b21" + integrity sha512-JBdSr/LtyYIno/pNnJ75lBcqc3Z1XXujzPanHqjvvrhOA+DTceTFuJi8XjmWTZh4r3fsdfqaCMN0iZemdkxZHQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + +"@babel/helper-environment-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" + integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" + integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== + dependencies: + "@babel/helper-get-function-arity" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/helper-get-function-arity@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" + integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-hoist-variables@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" + integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-member-expression-to-functions@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz#42b9ca4b2b200123c3b7e726b0ae5153924905b0" + integrity sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-optimise-call-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz#a34e3560605abbd31a18546bd2aad3e6d9a174f2" + integrity sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-plugin-utils@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" + integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== + +"@babel/helper-replace-supers@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz#e9f5f5f32ac90429c1a4bdec0f231ef0c2838ab1" + integrity sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw== + dependencies: + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/helper-split-export-declaration@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" + integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== + +"@babel/helper-validator-option@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" + integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== + +"@babel/highlight@^7.16.7": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.16.0", "@babel/parser@^7.16.5": - version "7.16.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.6.tgz#8f194828193e8fa79166f34a4b4e52f3e769a314" - integrity sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ== - -"@babel/plugin-syntax-typescript@^7.16.0": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.5.tgz#f47a33e4eee38554f00fb6b2f894fa1f5649b0b3" - integrity sha512-/d4//lZ1Vqb4mZ5xTep3dDK888j7BGM/iKqBmndBaoYAFPlPKrGU608VVBz5JeyAb6YQDjRu1UKqj86UhwWVgw== - dependencies: - "@babel/helper-plugin-utils" "^7.16.5" - -"@babel/plugin-transform-typescript@^7.16.1": - version "7.16.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz#cc0670b2822b0338355bc1b3d2246a42b8166409" - integrity sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-typescript" "^7.16.0" - -"@babel/preset-typescript@7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.5.tgz#b86a5b0ae739ba741347d2f58c52f52e63cf1ba1" - integrity sha512-lmAWRoJ9iOSvs3DqOndQpj8XqXkzaiQs50VG/zESiI9D3eoZhGriU675xNCr0UwvsuXrhMAGvyk1w+EVWF3u8Q== - dependencies: - "@babel/helper-plugin-utils" "^7.16.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-typescript" "^7.16.1" - -"@babel/template@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" - integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/parser" "^7.16.0" - "@babel/types" "^7.16.0" - -"@babel/traverse@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.5.tgz#d7d400a8229c714a59b87624fc67b0f1fbd4b2b3" - integrity sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.5" - "@babel/helper-environment-visitor" "^7.16.5" - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-hoist-variables" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/parser" "^7.16.5" - "@babel/types" "^7.16.0" +"@babel/parser@^7.16.7", "@babel/parser@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.0.tgz#f0ac33eddbe214e4105363bb17c3341c5ffcc43c" + integrity sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw== + +"@babel/plugin-syntax-typescript@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" + integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + +"@babel/plugin-transform-typescript@^7.16.7": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz#591ce9b6b83504903fa9dd3652c357c2ba7a1ee0" + integrity sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-typescript" "^7.16.7" + +"@babel/preset-typescript@7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.7.tgz#ab114d68bb2020afc069cd51b37ff98a046a70b9" + integrity sha512-WbVEmgXdIyvzB77AQjGBEyYPZx+8tTsO50XtfozQrkW8QB2rLJpH2lgx0TRw5EJrBxOZQ+wCcyPVQvS8tjEHpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-option" "^7.16.7" + "@babel/plugin-transform-typescript" "^7.16.7" + +"@babel/template@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" + integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/traverse@^7.16.7": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.0.tgz#3143e5066796408ccc880a33ecd3184f3e75cd30" + integrity sha512-fpFIXvqD6kC7c7PUNnZ0Z8cQXlarCLtCUpt2S1Dx7PjoRtCFffvOkHHSom+m5HIxMZn5bIBVb71lhabcmjEsqg== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.0" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.17.0" + "@babel/types" "^7.17.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" - integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== +"@babel/types@^7.16.7", "@babel/types@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" + integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== dependencies: - "@babel/helper-validator-identifier" "^7.15.7" + "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" "@eslint/eslintrc@^1.0.5": @@ -277,28 +277,29 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/node@17.0.5": - version "17.0.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0" - integrity sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw== - -"@types/prettier@2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" - integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== - -"@types/vscode@1.60.0": - version "1.60.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.60.0.tgz#9330c317691b4f53441a18b598768faeeb71618a" - integrity sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow== - -"@typescript-eslint/eslint-plugin@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz#97dfaa39f38e99f86801fdf34f9f1bed66704258" - integrity sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw== - dependencies: - "@typescript-eslint/experimental-utils" "5.8.1" - "@typescript-eslint/scope-manager" "5.8.1" +"@types/node@17.0.16": + version "17.0.16" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.16.tgz#e3733f46797b9df9e853ca9f719c8a6f7b84cd26" + integrity sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA== + +"@types/prettier@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.3.tgz#a3c65525b91fca7da00ab1a3ac2b5a2a4afbffbf" + integrity sha512-QzSuZMBuG5u8HqYz01qtMdg/Jfctlnvj1z/lYnIDXs/golxw0fxtRAHd9KrzjR7Yxz1qVeI00o0kiO3PmVdJ9w== + +"@types/vscode@1.64.0": + version "1.64.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.64.0.tgz#bfd82c8d92dc7824c1be084be1ab46ce20d7fb55" + integrity sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA== + +"@typescript-eslint/eslint-plugin@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.11.0.tgz#3b866371d8d75c70f9b81535e7f7d3aa26527c7a" + integrity sha512-HJh33bgzXe6jGRocOj4FmefD7hRY4itgjzOrSs3JPrTNXsX7j5+nQPciAUj/1nZtwo2kAc3C75jZO+T23gzSGw== + dependencies: + "@typescript-eslint/scope-manager" "5.11.0" + "@typescript-eslint/type-utils" "5.11.0" + "@typescript-eslint/utils" "5.11.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -306,60 +307,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.8.1", "@typescript-eslint/experimental-utils@^5.0.0": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz#01861eb2f0749f07d02db342b794145a66ed346f" - integrity sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww== +"@typescript-eslint/parser@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.11.0.tgz#b4fcaf65513f9b34bdcbffdda055724a5efb7e04" + integrity sha512-x0DCjetHZYBRovJdr3U0zG9OOdNXUaFLJ82ehr1AlkArljJuwEsgnud+Q7umlGDFLFrs8tU8ybQDFocp/eX8mQ== dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.8.1" - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/typescript-estree" "5.8.1" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" + "@typescript-eslint/scope-manager" "5.11.0" + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/typescript-estree" "5.11.0" + debug "^4.3.2" -"@typescript-eslint/parser@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.8.1.tgz#380f5f1e596b540059998aa3fc80d78f0f9b0d0a" - integrity sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw== +"@typescript-eslint/scope-manager@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.11.0.tgz#f5aef83ff253f457ecbee5f46f762298f0101e4b" + integrity sha512-z+K4LlahDFVMww20t/0zcA7gq/NgOawaLuxgqGRVKS0PiZlCTIUtX0EJbC0BK1JtR4CelmkPK67zuCgpdlF4EA== dependencies: - "@typescript-eslint/scope-manager" "5.8.1" - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/typescript-estree" "5.8.1" - debug "^4.3.2" + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/visitor-keys" "5.11.0" -"@typescript-eslint/scope-manager@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz#7fc0604f7ade8833e4d42cebaa1e2debf8b932e4" - integrity sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q== +"@typescript-eslint/type-utils@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.11.0.tgz#58be0ba73d1f6ef8983d79f7f0bc2209b253fefe" + integrity sha512-wDqdsYO6ofLaD4DsGZ0jGwxp4HrzD2YKulpEZXmgN3xo4BHJwf7kq49JTRpV0Gx6bxkSUmc9s0EIK1xPbFFpIA== dependencies: - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/visitor-keys" "5.8.1" + "@typescript-eslint/utils" "5.11.0" + debug "^4.3.2" + tsutils "^3.21.0" -"@typescript-eslint/types@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" - integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== +"@typescript-eslint/types@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.11.0.tgz#ba345818a2540fdf2755c804dc2158517ab61188" + integrity sha512-cxgBFGSRCoBEhvSVLkKw39+kMzUKHlJGVwwMbPcTZX3qEhuXhrjwaZXWMxVfxDgyMm+b5Q5b29Llo2yow8Y7xQ== -"@typescript-eslint/typescript-estree@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" - integrity sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ== +"@typescript-eslint/typescript-estree@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.11.0.tgz#53f9e09b88368191e52020af77c312a4777ffa43" + integrity sha512-yVH9hKIv3ZN3lw8m/Jy5I4oXO4ZBMqijcXCdA4mY8ull6TPTAoQnKKrcZ0HDXg7Bsl0Unwwx7jcXMuNZc0m4lg== dependencies: - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/visitor-keys" "5.8.1" + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/visitor-keys" "5.11.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" - integrity sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg== +"@typescript-eslint/utils@5.11.0", "@typescript-eslint/utils@^5.10.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.11.0.tgz#d91548ef180d74c95d417950336d9260fdbe1dc5" + integrity sha512-g2I480tFE1iYRDyMhxPAtLQ9HAn0jjBtipgTCZmd9I9s11OV8CTsG+YfFciuNDcHqm4csbAgC2aVZCHzLxMSUw== dependencies: - "@typescript-eslint/types" "5.8.1" + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.11.0" + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/typescript-estree" "5.11.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/visitor-keys@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.11.0.tgz#888542381f1a2ac745b06d110c83c0b261487ebb" + integrity sha512-E8w/vJReMGuloGxJDkpPlGwhxocxOpSVgSvjiLO5IxZPmxZF30weOeJYyPSEACwM+X4NziYS9q+WkN/2DHYQwA== + dependencies: + "@typescript-eslint/types" "5.11.0" eslint-visitor-keys "^3.0.0" acorn-jsx@^5.3.1: @@ -372,6 +382,11 @@ acorn@^8.6.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== +acorn@^8.7.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== + ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -382,11 +397,6 @@ ajv@^6.10.0, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -618,13 +628,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - es-abstract@^1.19.0, es-abstract@^1.19.1: version "1.19.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" @@ -683,14 +686,13 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-module-utils@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" - integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== +eslint-module-utils@^2.7.2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" + integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== dependencies: debug "^3.2.7" find-up "^2.1.0" - pkg-dir "^2.0.0" eslint-plugin-babel@5.3.1: version "5.3.1" @@ -707,31 +709,31 @@ eslint-plugin-eslint-comments@3.2.0: escape-string-regexp "^1.0.5" ignore "^5.0.5" -eslint-plugin-import@2.25.3: - version "2.25.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766" - integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg== +eslint-plugin-import@2.25.4: + version "2.25.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" + integrity sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA== dependencies: array-includes "^3.1.4" array.prototype.flat "^1.2.5" debug "^2.6.9" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.7.1" + eslint-module-utils "^2.7.2" has "^1.0.3" is-core-module "^2.8.0" is-glob "^4.0.3" minimatch "^3.0.4" object.values "^1.1.5" resolve "^1.20.0" - tsconfig-paths "^3.11.0" + tsconfig-paths "^3.12.0" -eslint-plugin-jest@25.3.3: - version "25.3.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-25.3.3.tgz#60bb52a08ff37933adf8b19ba9b216c13c22fdc7" - integrity sha512-qi7aduaU4/oWegWo0zH4kbJbx8+Be+ABTr72OnO68zTMcJeeSuyH1CduTGF4ATyNFgpE1zp0u10/gIhe+QDSfg== +eslint-plugin-jest@26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.1.0.tgz#9f6c33e66f3cef3f2832c3a4d2caa21a75792dee" + integrity sha512-vjF6RvcKm4xZSJgCmXb9fXmhzTva+I9jtj9Qv5JeZQTRocU7WT1g3Kx0cZ+00SekPe2DtSWDawHtSj4RaxFhXQ== dependencies: - "@typescript-eslint/experimental-utils" "^5.0.0" + "@typescript-eslint/utils" "^5.10.0" eslint-plugin-prettier@4.0.0: version "4.0.0" @@ -783,10 +785,15 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== -eslint@8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f" - integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg== +eslint-visitor-keys@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" + integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== + +eslint@8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.8.0.tgz#9762b49abad0cb4952539ffdb0a046392e571a2d" + integrity sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" @@ -795,12 +802,11 @@ eslint@8.5.0: cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" eslint-scope "^7.1.0" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.1.0" - espree "^9.2.0" + eslint-visitor-keys "^3.2.0" + espree "^9.3.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -808,7 +814,7 @@ eslint@8.5.0: functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.6.0" - ignore "^4.0.6" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" @@ -819,9 +825,7 @@ eslint@8.5.0: minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" - progress "^2.0.0" regexpp "^3.2.0" - semver "^7.2.1" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" @@ -836,6 +840,15 @@ espree@^9.2.0: acorn-jsx "^5.3.1" eslint-visitor-keys "^3.1.0" +espree@^9.3.0: + version "9.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8" + integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ== + dependencies: + acorn "^8.7.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^3.1.0" + esquery@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" @@ -1068,7 +1081,7 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.5, ignore@^5.1.4, ignore@^5.1.8: +ignore@^5.0.5, ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== @@ -1446,13 +1459,6 @@ pify@^4.0.1: resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -1470,11 +1476,6 @@ prettier@2.5.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -1544,7 +1545,7 @@ semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.5: +semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -1651,7 +1652,7 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tsconfig-paths@^3.11.0: +tsconfig-paths@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== @@ -1685,10 +1686,10 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -typescript@4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" - integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== +typescript@4.5.5: + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== unbox-primitive@^1.0.1: version "1.0.1" From d6fbc63e1192f9b4771abf9b413e766ecec3beb4 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 9 Feb 2022 00:09:09 +0100 Subject: [PATCH 101/110] fix: load snippets dynamically inside search --- .gitignore | 1 - package.json | 2 +- src/helpers/snippetSearch.ts | 13 ++++++++++--- src/index.ts | 6 +++++- src/snippets/generated.json | 1 + yarn.lock | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 src/snippets/generated.json diff --git a/.gitignore b/.gitignore index f9273d6..42ffe71 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ node_modules *.log .DS_Store lib/ -src/snippets/generated.json diff --git a/package.json b/package.json index 6dc9fe0..6e7be68 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "@babel/preset-typescript": "7.16.7", "@types/node": "17.0.16", "@types/prettier": "2.4.3", - "@types/vscode": "1.64.0", + "@types/vscode": "^1.60.0", "@typescript-eslint/eslint-plugin": "5.11.0", "@typescript-eslint/parser": "5.11.0", "eslint": "8.8.0", diff --git a/src/helpers/snippetSearch.ts b/src/helpers/snippetSearch.ts index 95c70df..bb2855a 100644 --- a/src/helpers/snippetSearch.ts +++ b/src/helpers/snippetSearch.ts @@ -1,14 +1,21 @@ +import { readFileSync } from 'fs'; import { SnippetString, window } from 'vscode'; -import snippets from '../snippets/generated.json'; - import { parseSnippet } from './formatters'; import { Snippet } from './generateSnippets'; const snippetSearch = async () => { const { showQuickPick, activeTextEditor } = window; - const snippetsArray = Object.entries(snippets) as [string, Snippet][]; + const snippets = readFileSync( + __dirname + '/../snippets/generated.json', + 'utf8', + ); + + const snippetsArray = Object.entries(JSON.parse(snippets)) as [ + string, + Snippet, + ][]; const items = snippetsArray.map( ([shortDescription, { body, description, prefix: label }]) => ({ diff --git a/src/index.ts b/src/index.ts index e7c3e87..a111de3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,7 @@ import { import generateSnippets from './helpers/generateSnippets'; import snippetSearch from './helpers/snippetSearch'; +import generatedSnippets from './snippets/generated.json'; const showRestartMessage = async ({ affectsConfiguration, @@ -30,8 +31,11 @@ const showRestartMessage = async ({ } }; -export function activate(context: ExtensionContext) { +export async function activate(context: ExtensionContext) { workspace.onDidChangeConfiguration(showRestartMessage); + if (JSON.stringify(generatedSnippets).length < 10) { + await generateSnippets(); + } const snippetSearchCommand = commands.registerCommand( 'reactSnippets.search', snippetSearch, diff --git a/src/snippets/generated.json b/src/snippets/generated.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/snippets/generated.json @@ -0,0 +1 @@ +{} diff --git a/yarn.lock b/yarn.lock index 95a761b..598ecad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -287,7 +287,7 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.3.tgz#a3c65525b91fca7da00ab1a3ac2b5a2a4afbffbf" integrity sha512-QzSuZMBuG5u8HqYz01qtMdg/Jfctlnvj1z/lYnIDXs/golxw0fxtRAHd9KrzjR7Yxz1qVeI00o0kiO3PmVdJ9w== -"@types/vscode@1.64.0": +"@types/vscode@^1.60.0": version "1.64.0" resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.64.0.tgz#bfd82c8d92dc7824c1be084be1ab46ce20d7fb55" integrity sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA== From 99f6ff6b306fbfdfbd8f3d7c1967da9a61d6533f Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 9 Feb 2022 00:09:27 +0100 Subject: [PATCH 102/110] 4.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e7be68..35d408b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.2.0", + "version": "4.3.0", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", From 8719d5a3397e255ab8757618bc00ebc152d44060 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 9 Feb 2022 00:15:08 +0100 Subject: [PATCH 103/110] docs: add Duckly sponsor --- README.md | 15 +- src/snippets/generated.json | 1901 ++++++++++++++++++++++++++++++++++- 2 files changed, 1911 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 726bb92..b00b32a 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,13 @@ Manage pull requests and conduct code reviews in your IDE with full source-tree
+ + +

Easy pair programming with any IDE. Duckly enables you to talk, share your code inreal-time, server and terminal with people using different IDEs Try it out for free +

+ +
+ ### Conquer of Completion It is possible to use this package in your vim/neovim text editor, to make this possible, make sure you have the `coc.nvim` previously configured, then add this command to your `init.vim` @@ -55,17 +62,17 @@ Note: This example uses `vim-plug` as a package manager, feel free to use some o
-### Packer +### Packer For use with packer the syntax is a little different. Just add in your `init.vim` or `init.lua`: ```shell -use {'dsznajder/vscode-es7-javascript-react-snippets', +use {'dsznajder/vscode-es7-javascript-react-snippets', run = 'yarn install --frozen-lockfile && yarn compile' } -``` +``` -When saving the file, the update will be done ( `:w` ) +When saving the file, the update will be done ( `:w` )
diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 0967ef4..8ffd24a 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -1 +1,1900 @@ -{} +{ + "exportType": { + "body": ["export type ${1:first} = {${2:second}}"], + "key": "exportType", + "prefix": "exptp", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportInterface": { + "key": "exportInterface", + "prefix": "expint", + "body": ["export interface ${1:first} {${2:second}}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponent": { + "key": "typescriptReactClassComponent", + "prefix": "tsrcc", + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "body": [ + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportComponent": { + "key": "typescriptReactClassExportComponent", + "prefix": "tsrce", + "body": [ + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalExportComponent": { + "key": "typescriptReactFunctionalExportComponent", + "prefix": "tsrfce", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalComponent": { + "key": "typescriptReactFunctionalComponent", + "prefix": "tsrfc", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return (", + "
${1:first}
", + " )", + "}" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionExportComponent": { + "key": "typescriptReactArrowFunctionExportComponent", + "prefix": "tsrafce", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionComponent": { + "key": "typescriptReactArrowFunctionComponent", + "prefix": "tsrafc", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + "
${1:first}
", + " )", + "}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassPureComponent": { + "key": "typescriptReactClassPureComponent", + "prefix": "tsrpc", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "type Props = {}", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportPureComponent": { + "key": "typescriptReactClassExportPureComponent", + "prefix": "tsrpce", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "type Props = {}", + "", + "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponentRedux": { + "key": "typescriptReactClassComponentRedux", + "prefix": "tsrcredux", + "body": [ + "import { connect } from 'react-redux'", + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponent": { + "key": "typescriptReactNativeArrowFunctionComponent", + "prefix": "tsrnf", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system in TypeScript", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponentWithStyles": { + "key": "typescriptReactNativeArrowFunctionComponentWithStyles", + "prefix": "tsrnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionComponent": { + "key": "reactArrowFunctionComponent", + "prefix": "rafc", + "body": [ + "import React from 'react'", + "", + "export const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + "
${1:first}
", + " )", + "}", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionComponentWithPropTypes": { + "key": "reactArrowFunctionComponentWithPropTypes", + "prefix": "rafcp", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "const ${1:${TM_FILENAME_BASE}} = props => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionExportComponent": { + "key": "reactArrowFunctionExportComponent", + "prefix": "rafce", + "body": [ + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponent": { + "key": "reactClassComponent", + "prefix": "rcc", + "body": [ + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentPropTypes": { + "key": "reactClassComponentPropTypes", + "prefix": "rccp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {${2:second}: ${3:third}}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with PropTypes and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentRedux": { + "key": "reactClassComponentRedux", + "prefix": "rcredux", + "body": [ + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentReduxPropTypes": { + "key": "reactClassComponentReduxPropTypes", + "prefix": "rcreduxp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {", + " ${2:second}: ${3:third}", + " }", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportComponent": { + "key": "reactClassExportComponent", + "prefix": "rce", + "body": [ + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportComponentWithPropTypes": { + "key": "reactClassExportComponentWithPropTypes", + "prefix": "rcep", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportPureComponent": { + "key": "reactClassExportPureComponent", + "prefix": "rpce", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React pure component class with ES7 module system export", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassPureComponent": { + "key": "reactClassPureComponent", + "prefix": "rpc", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React pure component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassPureComponentWithPropTypes": { + "key": "reactClassPureComponentWithPropTypes", + "prefix": "rpcp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " static propTypes = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionMemoComponent": { + "key": "reactFunctionMemoComponent", + "prefix": "rmc", + "body": [ + "import React, { memo } from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = memo(() => {", + " return (", + "
${1:first}
", + " )", + "})", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Memo Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionMemoComponentWithPropTypes": { + "key": "reactFunctionMemoComponentWithPropTypes", + "prefix": "rmcp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { memo } from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = memo((props) => {", + " return (", + "
${1:first}
", + " )", + "})", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponent": { + "key": "reactFunctionalComponent", + "prefix": "rfc", + "body": [ + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + "
${1:first}
", + " )", + "}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentRedux": { + "key": "reactFunctionalComponentRedux", + "prefix": "rfcredux", + "body": [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React functional component with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentReduxPropTypes": { + "key": "reactFunctionalComponentReduxPropTypes", + "prefix": "rfcreduxp", + "body": [ + "import PropTypes from 'prop-types'", + "import React from 'react'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {", + " ${2:second}: PropTypes.${3:third}", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentWithPropTypes": { + "key": "reactFunctionalComponentWithPropTypes", + "prefix": "rfcp", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "function ${1:${TM_FILENAME_BASE}}(props) {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalExportComponent": { + "key": "reactFunctionalExportComponent", + "prefix": "rfce", + "body": [ + "import React from 'react'", + "", + "function ${1:${TM_FILENAME_BASE}}() {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleAssert": { + "key": "consoleAssert", + "prefix": "cas", + "body": ["console.assert(${1:first}, ${2:second})"], + "description": "If the specified expression is false, the message is written to the console along with a stack trace", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleClear": { + "key": "consoleClear", + "prefix": "ccl", + "body": ["console.clear()"], + "description": "Clears the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleCount": { + "key": "consoleCount", + "prefix": "cco", + "body": ["console.count(${1:first})"], + "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleDir": { + "key": "consoleDir", + "prefix": "cdi", + "body": ["console.dir(${1:first})"], + "description": "Prints a JavaScript representation of the specified object", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleError": { + "key": "consoleError", + "prefix": "cer", + "body": ["console.error(${1:first})"], + "description": "Displays a message in the console and also includes a stack trace from where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleGroup": { + "key": "consoleGroup", + "prefix": "cgr", + "body": ["console.group('${1:first}')"], + "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleGroupEnd": { + "key": "consoleGroupEnd", + "prefix": "cge", + "body": ["console.groupEnd()"], + "description": "Closes out the corresponding console.group().", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLog": { + "key": "consoleLog", + "prefix": "clg", + "body": ["console.log(${1:first})"], + "description": "Displays a message in the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTrace": { + "key": "consoleTrace", + "prefix": "ctr", + "body": ["console.trace(${1:first})"], + "description": "Prints a stack trace from the point where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLogObject": { + "key": "consoleLogObject", + "prefix": "clo", + "body": ["console.log('${1:first}', ${1:first})"], + "description": "Logs property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLogJson": { + "key": "consoleLogJson", + "prefix": "clj", + "body": ["console.log('${1:first}', JSON.stringify(${1:first}, null, 2))"], + "description": "Logs stringified JSON property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTime": { + "key": "consoleTime", + "prefix": "ctm", + "body": ["console.time('${1:first}')"], + "description": "Console time wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTimeEnd": { + "key": "consoleTimeEnd", + "prefix": "cte", + "body": ["console.timeEnd('${1:first}')"], + "description": "Console time end wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleWarn": { + "key": "consoleWarn", + "prefix": "cwa", + "body": ["console.warn(${1:first})"], + "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleInfo": { + "key": "consoleInfo", + "prefix": "cin", + "body": ["console.info(${1:first})"], + "description": "Displays a message in the console but also displays a blue information icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useCallback": { + "key": "useCallback", + "prefix": "useCallbackSnippet", + "body": [ + "useCallback(", + " () => {", + " ${1:first}", + " },", + " [${2:second}],", + ")", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useContext": { + "key": "useContext", + "prefix": "useContextSnippet", + "body": ["const ${1:first} = useContext(${2:second})"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useEffect": { + "key": "useEffect", + "prefix": "useEffectSnippet", + "body": [ + "useEffect(() => {", + " ${1:first}", + "", + " return () => {", + " ${2:second}", + " }", + "}, [${3:third}])", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useImperativeHandle": { + "key": "useImperativeHandle", + "prefix": "useImperativeHandleSnippet", + "body": [ + "useImperativeHandle(", + " ${1:first},", + " () => {", + " ${2:second}", + " },", + " [${3:third}],", + ")" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useLayoutEffect": { + "key": "useLayoutEffect", + "prefix": "useLayoutEffectSnippet", + "body": [ + "useLayoutEffect(() => {", + " ${1:first}", + "", + " return () => {", + " ${2:second}", + " };", + "}, [${3:third}])" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useMemo": { + "key": "useMemo", + "prefix": "useMemoSnippet", + "body": ["useMemo(() => ${1:first}, [${2:second}])"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useReducer": { + "key": "useReducer", + "prefix": "useReducerSnippet", + "body": [ + "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useRef": { + "key": "useRef", + "prefix": "useRefSnippet", + "body": ["const ${1:first} = useRef(${2:second})"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useState": { + "key": "useState", + "prefix": "useStateSnippet", + "body": [ + "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importAs": { + "key": "importAs", + "prefix": "ima", + "body": ["import { ${2:second} as ${3:third} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importBrowserRouter": { + "key": "importBrowserRouter", + "prefix": "imbr", + "body": ["import { BrowserRouter as Router } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importBrowserRouterWithRouteAndNavLink": { + "key": "importBrowserRouterWithRouteAndNavLink", + "prefix": "imrr", + "body": [ + "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importDestructing": { + "key": "importDestructing", + "prefix": "imd", + "body": ["import { ${2:second} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importEverything": { + "key": "importEverything", + "prefix": "ime", + "body": ["import * as ${2:second} from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importNoModuleName": { + "key": "importNoModuleName", + "prefix": "imn", + "body": ["import '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importPropTypes": { + "key": "importPropTypes", + "prefix": "impt", + "body": ["import PropTypes from 'prop-types'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReact": { + "key": "importReact", + "prefix": "imr", + "body": ["import React from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactDom": { + "key": "importReactDom", + "prefix": "imrd", + "body": ["import ReactDOM from 'react-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithComponent": { + "key": "importReactWithComponent", + "prefix": "imrc", + "body": ["import React, { Component } from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithComponentAndPropTypes": { + "key": "importReactWithComponentAndPropTypes", + "prefix": "imrcp", + "body": [ + "import React, { Component } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithMemo": { + "key": "importReactWithMemo", + "prefix": "imrm", + "body": ["import React, { memo } from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithMemoAndPropTypes": { + "key": "importReactWithMemoAndPropTypes", + "prefix": "imrmp", + "body": [ + "import React, { memo } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithPureComponent": { + "key": "importReactWithPureComponent", + "prefix": "imrpc", + "body": ["import React, { PureComponent } from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithPureComponentAndPropTypes": { + "key": "importReactWithPureComponentAndPropTypes", + "prefix": "imrpcp", + "body": [ + "import React, { PureComponent } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterLink": { + "key": "importRouterLink", + "prefix": "imbrl", + "body": ["import { Link } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterNavLink": { + "key": "importRouterNavLink", + "prefix": "imbrnl", + "body": ["import { NavLink } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterSetup": { + "key": "importRouterSetup", + "prefix": "imbrc", + "body": ["import { Route, Switch, NavLink, Link } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterSwitch": { + "key": "importRouterSwitch", + "prefix": "imbrs", + "body": ["import { Switch } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "import": { + "key": "import", + "prefix": "imp", + "body": ["import ${2:second} from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArray": { + "key": "propTypeArray", + "prefix": "pta", + "body": ["PropTypes.array"], + "description": "Array prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayRequired": { + "key": "propTypeArrayRequired", + "prefix": "ptar", + "body": ["PropTypes.array.isRequired"], + "description": "Array prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeBool": { + "key": "propTypeBool", + "prefix": "ptb", + "body": ["PropTypes.bool"], + "description": "Bool prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeBoolRequired": { + "key": "propTypeBoolRequired", + "prefix": "ptbr", + "body": ["PropTypes.bool.isRequired"], + "description": "Bool prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeFunc": { + "key": "propTypeFunc", + "prefix": "ptf", + "body": ["PropTypes.func"], + "description": "Func prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeFuncRequired": { + "key": "propTypeFuncRequired", + "prefix": "ptfr", + "body": ["PropTypes.func.isRequired"], + "description": "Func prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNumber": { + "key": "propTypeNumber", + "prefix": "ptn", + "body": ["PropTypes.number"], + "description": "Number prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNumberRequired": { + "key": "propTypeNumberRequired", + "prefix": "ptnr", + "body": ["PropTypes.number.isRequired"], + "description": "Number prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObject": { + "key": "propTypeObject", + "prefix": "pto", + "body": ["PropTypes.object"], + "description": "Object prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectRequired": { + "key": "propTypeObjectRequired", + "prefix": "ptor", + "body": ["PropTypes.object.isRequired"], + "description": "Object prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeString": { + "key": "propTypeString", + "prefix": "pts", + "body": ["PropTypes.string"], + "description": "String prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeStringRequired": { + "key": "propTypeStringRequired", + "prefix": "ptsr", + "body": ["PropTypes.string.isRequired"], + "description": "String prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNode": { + "key": "propTypeNode", + "prefix": "ptnd", + "body": ["PropTypes.node"], + "description": "Anything that can be rendered: numbers, strings, elements or an array", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNodeRequired": { + "key": "propTypeNodeRequired", + "prefix": "ptndr", + "body": ["PropTypes.node.isRequired"], + "description": "Anything that can be rendered: numbers, strings, elements or an array required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeElement": { + "key": "propTypeElement", + "prefix": "ptel", + "body": ["PropTypes.element"], + "description": "React element prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeElementRequired": { + "key": "propTypeElementRequired", + "prefix": "ptelr", + "body": ["PropTypes.element.isRequired"], + "description": "React element prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeInstanceOf": { + "key": "propTypeInstanceOf", + "prefix": "pti", + "body": ["PropTypes.instanceOf($0)"], + "description": "Is an instance of a class prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeInstanceOfRequired": { + "key": "propTypeInstanceOfRequired", + "prefix": "ptir", + "body": ["PropTypes.instanceOf($0).isRequired"], + "description": "Is an instance of a class prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeEnum": { + "key": "propTypeEnum", + "prefix": "pte", + "body": ["PropTypes.oneOf(['$0'])"], + "description": "Prop type limited to specific values by treating it as an enum", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeEnumRequired": { + "key": "propTypeEnumRequired", + "prefix": "pter", + "body": ["PropTypes.oneOf(['$0']).isRequired"], + "description": "Prop type limited to specific values by treating it as an enum required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeOneOfType": { + "key": "propTypeOneOfType", + "prefix": "ptet", + "body": ["PropTypes.oneOfType([", " $0", "])"], + "description": "An object that could be one of many types", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeOneOfTypeRequired": { + "key": "propTypeOneOfTypeRequired", + "prefix": "ptetr", + "body": ["PropTypes.oneOfType([", " $0", "]).isRequired"], + "description": "An object that could be one of many types required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayOf": { + "key": "propTypeArrayOf", + "prefix": "ptao", + "body": ["PropTypes.arrayOf($0)"], + "description": "An array of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayOfRequired": { + "key": "propTypeArrayOfRequired", + "prefix": "ptaor", + "body": ["PropTypes.arrayOf($0).isRequired"], + "description": "An array of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectOf": { + "key": "propTypeObjectOf", + "prefix": "ptoo", + "body": ["PropTypes.objectOf($0)"], + "description": "An object with property values of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectOfRequired": { + "key": "propTypeObjectOfRequired", + "prefix": "ptoor", + "body": ["PropTypes.objectOf($0).isRequired"], + "description": "An object with property values of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeShape": { + "key": "propTypeShape", + "prefix": "ptsh", + "body": ["PropTypes.shape({", " $0", "})"], + "description": "An object taking on a particular shape", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeShapeRequired": { + "key": "propTypeShapeRequired", + "prefix": "ptshr", + "body": ["PropTypes.shape({", " $0", "}).isRequired"], + "description": "An object taking on a particular shape required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeExact": { + "key": "propTypeExact", + "prefix": "ptex", + "body": ["PropTypes.exact({", " $0", "})"], + "description": "An object with warnings on extra properties", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeExactRequired": { + "key": "propTypeExactRequired", + "prefix": "ptexr", + "body": ["PropTypes.exact({", " $0", "}).isRequired"], + "description": "An object with warnings on extra properties required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeAny": { + "key": "propTypeAny", + "prefix": "ptany", + "body": ["PropTypes.any"], + "description": "Any prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponent": { + "key": "reactNativeComponent", + "prefix": "rnc", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponentExport": { + "key": "reactNativeComponentExport", + "prefix": "rnce", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponentWithStyles": { + "key": "reactNativeComponentWithStyles", + "prefix": "rncs", + "body": [ + "import { Text, StyleSheet, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalComponent": { + "key": "reactNativeFunctionalComponent", + "prefix": "rnf", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalComponentWithStyles": { + "key": "reactNativeFunctionalComponentWithStyles", + "prefix": "rnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalExportComponent": { + "key": "reactNativeFunctionalExportComponent", + "prefix": "rnfe", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalExportComponentWithStyles": { + "key": "reactNativeFunctionalExportComponentWithStyles", + "prefix": "rnfes", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeImport": { + "key": "reactNativeImport", + "prefix": "imrn", + "body": ["import { ${1:first} } from 'react-native'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativePureComponent": { + "key": "reactNativePureComponent", + "prefix": "rnpc", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativePureComponentExport": { + "key": "reactNativePureComponentExport", + "prefix": "rnpce", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { PureComponent } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeStyles": { + "key": "reactNativeStyles", + "prefix": "rnstyle", + "body": ["const styles = StyleSheet.create({${1:first}})"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReduxConnect": { + "key": "importReduxConnect", + "prefix": "redux", + "body": ["import { connect } from 'react-redux'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxAction": { + "key": "reduxAction", + "prefix": "rxaction", + "body": [ + "export const ${1:first} = (payload) => ({", + " type: ${2:second},", + " payload", + "})", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxConst": { + "key": "reduxConst", + "prefix": "rxconst", + "body": ["export const ${1:first} = '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxReducer": { + "key": "reduxReducer", + "prefix": "rxreducer", + "body": [ + "const initialState = {}", + "", + "export default (state = initialState, { type, payload }) => {", + " switch (type) {", + "", + " case ${1:first}:", + " return { ...state, ...payload }", + "", + " default:", + " return state", + " }", + "}", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxSelector": { + "key": "reduxSelector", + "prefix": "rxselect", + "body": [ + "import { createSelector } from 'reselect'", + "", + "export const ${1:first} = state => state.${2:second}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxSlice": { + "key": "reduxSlice", + "prefix": "rxslice", + "body": [ + "import { createSlice } from '@reduxjs/toolkit'", + "", + "const initialState = {", + "", + "}", + "", + "const ${1:${TM_FILENAME_BASE}} = createSlice({", + " name: ${2:second},", + " initialState,", + " reducers: {}", + "});", + "", + "export const {} = ${1:${TM_FILENAME_BASE}}.actions", + "", + "export default ${1:${TM_FILENAME_BASE}}.reducer" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "mappingToProps": { + "key": "mappingToProps", + "prefix": "reduxmap", + "body": [ + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "describeBlock": { + "key": "describeBlock", + "prefix": "desc", + "body": ["describe('${1:first}', () => { ${2:second} })"], + "description": "Testing `describe` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "itAsyncBlock": { + "key": "itAsyncBlock", + "prefix": "tita", + "body": ["it('should ${1:first}', async () => { ${2:second} })"], + "description": "Testing asynchronous `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "itBlock": { + "key": "itBlock", + "prefix": "tit", + "body": ["it('should ${1:first}', () => { ${2:second} })"], + "description": "Testing `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactComponentTestWithRedux": { + "key": "setupReactComponentTestWithRedux", + "prefix": "srtest", + "body": [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "description": "Create test component", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactNativeTest": { + "key": "setupReactNativeTest", + "prefix": "sntest", + "body": [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactNativeTestWithRedux": { + "key": "setupReactNativeTestWithRedux", + "prefix": "snrtest", + "body": [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactTest": { + "key": "setupReactTest", + "prefix": "stest", + "body": [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "testAsyncBlock": { + "key": "testAsyncBlock", + "prefix": "testa", + "body": ["test('should ${1:first}', async () => { ${2:second} })"], + "description": "Testing `asynchronous test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "testBlock": { + "key": "testBlock", + "prefix": "test", + "body": ["test('should ${1:first}', () => { ${2:second} })"], + "description": "Testing `test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefault": { + "key": "exportDefault", + "prefix": "exp", + "body": ["export default ${1:first}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDestructing": { + "key": "exportDestructing", + "prefix": "exd", + "body": ["export { ${2:second} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportAs": { + "key": "exportAs", + "prefix": "exa", + "body": ["export { ${2:second} as ${3:third} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportNamedFunction": { + "key": "exportNamedFunction", + "prefix": "enf", + "body": ["export const ${1:first} = (${2:second}) => {${3:third}}"], + "description": "Export named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultFunction": { + "key": "exportDefaultFunction", + "prefix": "edf", + "body": ["export default (${1:first}) => {${2:second}}"], + "description": "Export default function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultNamedFunction": { + "key": "exportDefaultNamedFunction", + "prefix": "ednf", + "body": ["export default function ${1:first}(${2:second}) {${3:third}}"], + "description": "Export default named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "method": { + "key": "method", + "prefix": "met", + "body": ["${1:first} = (${2:second}) => {${3:third}}"], + "description": "Creates a method inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertyGet": { + "key": "propertyGet", + "prefix": "pge", + "body": ["get ${1:first}() {", " return this.${2:second}", "}"], + "description": "Creates a getter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertySet": { + "key": "propertySet", + "prefix": "pse", + "body": ["set ${1:first}(${2:second}) {${3:third}}"], + "description": "Creates a setter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forEach": { + "key": "forEach", + "prefix": "fre", + "body": ["${1:first}.forEach(${2:second} => {${3:third}})"], + "description": "Creates a forEach statement", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forOf": { + "key": "forOf", + "prefix": "fof", + "body": ["for(let ${1:first} of ${2:second}) {${3:third}}"], + "description": "Iterating over property names of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forIn": { + "key": "forIn", + "prefix": "fin", + "body": ["for(let ${1:first} in ${2:second}) {${3:third}}"], + "description": "Iterating over property values of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "anonymousFunction": { + "key": "anonymousFunction", + "prefix": "anfn", + "body": ["(${1:first}) => { ${2:second} }"], + "description": "Creates an anonymous function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "namedFunction": { + "key": "namedFunction", + "prefix": "nfn", + "body": ["const ${1:first} = (${2:second}) => { ${3:third} }"], + "description": "Creates a named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingObject": { + "key": "destructingObject", + "prefix": "dob", + "body": ["const {${2:second}} = ${1:first}"], + "description": "Creates and assigns a local variable using object destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingArray": { + "key": "destructingArray", + "prefix": "dar", + "body": ["const [${2:second}] = ${1:first}"], + "description": "Creates and assigns a local variable using array destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setInterval": { + "key": "setInterval", + "prefix": "sti", + "body": ["setInterval(() => { ${1:first} }, ${2:second})"], + "description": "Executes the given function at specified intervals", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setTimeOut": { + "key": "setTimeOut", + "prefix": "sto", + "body": ["setTimeout(() => { ${1:first} }, ${2:second})"], + "description": "Executes the given function after the specified delay", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "promise": { + "key": "promise", + "prefix": "prom", + "body": ["return new Promise((resolve, reject) => { ${1:first} })"], + "description": "Creates and returns a new Promise in the standard ES7 syntax", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructProps": { + "key": "destructProps", + "prefix": "cp", + "body": ["const { ${1:first} } = this.props"], + "description": "Creates and assigns a local variable using props destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructState": { + "key": "destructState", + "prefix": "cs", + "body": ["const { ${1:first} } = this.state"], + "description": "Creates and assigns a local variable using state destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "classConstructor": { + "key": "classConstructor", + "prefix": "rconst", + "body": [ + "constructor(props) {", + " super(props)", + "", + " this.state = {", + " ${1:first}", + " }", + "}" + ], + "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "emptyState": { + "key": "emptyState", + "prefix": "est", + "body": ["state = { ${1:first} }"], + "description": "Creates empty state object. To be used in a constructor.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidMount": { + "key": "componentDidMount", + "prefix": "cdm", + "body": ["componentDidMount() { ${1:first} }"], + "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "shouldComponentUpdate": { + "key": "shouldComponentUpdate", + "prefix": "scu", + "body": ["shouldComponentUpdate(nextProps, nextState) { ${1:first} }"], + "description": "Invoked before rendering when new props or state are being received. ", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidUpdate": { + "key": "componentDidUpdate", + "prefix": "cdup", + "body": ["componentDidUpdate(prevProps, prevState) { ${1:first}} "], + "description": "Invoked immediately after the component's updates are flushed to the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentWillUnmount": { + "key": "componentWillUnmount", + "prefix": "cwun", + "body": ["componentWillUnmount() {${1:first} }"], + "description": "Invoked immediately before a component is unmounted from the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getDerivedStateFromProps": { + "key": "getDerivedStateFromProps", + "prefix": "gdsfp", + "body": ["static getDerivedStateFromProps(props, state) {${1:first}}"], + "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getSnapshotBeforeUpdate": { + "key": "getSnapshotBeforeUpdate", + "prefix": "gsbu", + "body": [ + "getSnapshotBeforeUpdate = (prevProps, prevState) => {${1:first}}" + ], + "description": "Called right before mutations are made (e.g. before the DOM is updated)", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createContext": { + "key": "createContext", + "prefix": "rcontext", + "body": ["const ${1:first} = React.createContext()"], + "description": "Create React context", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createRef": { + "key": "createRef", + "prefix": "cref", + "body": ["this.${1:first}Ref = React.createRef()"], + "description": "Create ref statement used inside constructor", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateObject": { + "key": "componentSetStateObject", + "prefix": "sst", + "body": ["this.setState({${1:first}})"], + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateFunc": { + "key": "componentSetStateFunc", + "prefix": "ssf", + "body": ["this.setState((state, props) => { return { ${1:first} }})"], + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentProps": { + "key": "componentProps", + "prefix": "props", + "body": ["this.props.${1:first}"], + "description": "Access component's props", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentState": { + "key": "componentState", + "prefix": "state", + "body": ["this.state.${1:first}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "bindThis": { + "key": "bindThis", + "prefix": "bnd", + "body": ["this.${1:first} = this.${1:first}.bind(this)"], + "description": "Binds this to a method", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "commentBigBlock": { + "key": "commentBigBlock", + "prefix": "cmmb", + "body": ["/**", " * ${1:first}", " */"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponentWithRedux": { + "key": "hocComponentWithRedux", + "prefix": "hocredux", + "body": [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "import PropTypes from 'prop-types'", + "", + "export const mapStateToProps = state => ({})", + "", + "export const mapDispatchToProps = {}", + "", + "export const ${1:first} = (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "", + "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent))", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponent": { + "key": "hocComponent", + "prefix": "hoc", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "export default (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typeofSnippet": { + "key": "typeofSnippet", + "prefix": "tpf", + "body": ["typeof ${1:first}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + } +} From 0c5b0e47c5b1ccb5def1bfcbdebb5ebefe84004d Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 9 Feb 2022 00:23:19 +0100 Subject: [PATCH 104/110] 4.3.1 --- package.json | 2 +- src/snippets/generated.json | 1901 +---------------------------------- 2 files changed, 2 insertions(+), 1901 deletions(-) diff --git a/package.json b/package.json index 35d408b..676c144 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.3.0", + "version": "4.3.1", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 8ffd24a..0967ef4 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -1,1900 +1 @@ -{ - "exportType": { - "body": ["export type ${1:first} = {${2:second}}"], - "key": "exportType", - "prefix": "exptp", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportInterface": { - "key": "exportInterface", - "prefix": "expint", - "body": ["export interface ${1:first} {${2:second}}"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassComponent": { - "key": "typescriptReactClassComponent", - "prefix": "tsrcc", - "description": "Creates a React component class with ES7 module system and TypeScript interfaces", - "body": [ - "import React, { Component } from 'react'", - "", - "type Props = {}", - "", - "type State = {}", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassExportComponent": { - "key": "typescriptReactClassExportComponent", - "prefix": "tsrce", - "body": [ - "import React, { Component } from 'react'", - "", - "type Props = {}", - "", - "type State = {}", - "", - "class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React component class with ES7 module system and TypeScript interfaces", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactFunctionalExportComponent": { - "key": "typescriptReactFunctionalExportComponent", - "prefix": "tsrfce", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "function ${1:${TM_FILENAME_BASE}}({}: Props) {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactFunctionalComponent": { - "key": "typescriptReactFunctionalComponent", - "prefix": "tsrfc", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", - " return (", - "
${1:first}
", - " )", - "}" - ], - "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactArrowFunctionExportComponent": { - "key": "typescriptReactArrowFunctionExportComponent", - "prefix": "tsrafce", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactArrowFunctionComponent": { - "key": "typescriptReactArrowFunctionComponent", - "prefix": "tsrafc", - "body": [ - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - "
${1:first}
", - " )", - "}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassPureComponent": { - "key": "typescriptReactClassPureComponent", - "prefix": "tsrpc", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "type Props = {}", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassExportPureComponent": { - "key": "typescriptReactClassExportPureComponent", - "prefix": "tsrpce", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "type Props = {}", - "", - "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React pure component class with ES7 module system and TypeScript interface", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactClassComponentRedux": { - "key": "typescriptReactClassComponentRedux", - "prefix": "tsrcredux", - "body": [ - "import { connect } from 'react-redux'", - "import React, { Component } from 'react'", - "", - "type Props = {}", - "", - "type State = {}", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " state = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactNativeArrowFunctionComponent": { - "key": "typescriptReactNativeArrowFunctionComponent", - "prefix": "tsrnf", - "body": [ - "import { View, Text } from 'react-native'", - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system in TypeScript", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typescriptReactNativeArrowFunctionComponentWithStyles": { - "key": "typescriptReactNativeArrowFunctionComponentWithStyles", - "prefix": "tsrnfs", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "import React from 'react'", - "", - "type Props = {}", - "", - "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "const styles = StyleSheet.create({})" - ], - "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionComponent": { - "key": "reactArrowFunctionComponent", - "prefix": "rafc", - "body": [ - "import React from 'react'", - "", - "export const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - "
${1:first}
", - " )", - "}", - "" - ], - "description": "Creates a React Arrow Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionComponentWithPropTypes": { - "key": "reactArrowFunctionComponentWithPropTypes", - "prefix": "rafcp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "const ${1:${TM_FILENAME_BASE}} = props => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactArrowFunctionExportComponent": { - "key": "reactArrowFunctionExportComponent", - "prefix": "rafce", - "body": [ - "import React from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Arrow Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponent": { - "key": "reactClassComponent", - "prefix": "rcc", - "body": [ - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentPropTypes": { - "key": "reactClassComponentPropTypes", - "prefix": "rccp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {${2:second}: ${3:third}}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with PropTypes and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentRedux": { - "key": "reactClassComponentRedux", - "prefix": "rcredux", - "body": [ - "import React, { Component } from 'react'", - "import { connect } from 'react-redux'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React component class with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassComponentReduxPropTypes": { - "key": "reactClassComponentReduxPropTypes", - "prefix": "rcreduxp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { Component } from 'react'", - "import { connect } from 'react-redux'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {", - " ${2:second}: ${3:third}", - " }", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportComponent": { - "key": "reactClassExportComponent", - "prefix": "rce", - "body": [ - "import React, { Component } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportComponentWithPropTypes": { - "key": "reactClassExportComponentWithPropTypes", - "prefix": "rcep", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { Component } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " static propTypes = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassExportPureComponent": { - "key": "reactClassExportPureComponent", - "prefix": "rpce", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React pure component class with ES7 module system export", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassPureComponent": { - "key": "reactClassPureComponent", - "prefix": "rpc", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React pure component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactClassPureComponentWithPropTypes": { - "key": "reactClassPureComponentWithPropTypes", - "prefix": "rpcp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " static propTypes = {}", - "", - " render() {", - " return (", - "
${1:first}
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionMemoComponent": { - "key": "reactFunctionMemoComponent", - "prefix": "rmc", - "body": [ - "import React, { memo } from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = memo(() => {", - " return (", - "
${1:first}
", - " )", - "})", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Memo Function Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionMemoComponentWithPropTypes": { - "key": "reactFunctionMemoComponentWithPropTypes", - "prefix": "rmcp", - "body": [ - "import PropTypes from 'prop-types'", - "import React, { memo } from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = memo((props) => {", - " return (", - "
${1:first}
", - " )", - "})", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponent": { - "key": "reactFunctionalComponent", - "prefix": "rfc", - "body": [ - "import React from 'react'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - "
${1:first}
", - " )", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentRedux": { - "key": "reactFunctionalComponentRedux", - "prefix": "rfcredux", - "body": [ - "import React from 'react'", - "import { connect } from 'react-redux'", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "Creates a React functional component with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentReduxPropTypes": { - "key": "reactFunctionalComponentReduxPropTypes", - "prefix": "rfcreduxp", - "body": [ - "import PropTypes from 'prop-types'", - "import React from 'react'", - "import { connect } from 'react-redux'", - "", - "export const ${1:${TM_FILENAME_BASE}} = (props) => {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {", - " ${2:second}: PropTypes.${3:third}", - "}", - "", - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" - ], - "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalComponentWithPropTypes": { - "key": "reactFunctionalComponentWithPropTypes", - "prefix": "rfcp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "function ${1:${TM_FILENAME_BASE}}(props) {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "${1:${TM_FILENAME_BASE}}.propTypes = {}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system with PropTypes", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactFunctionalExportComponent": { - "key": "reactFunctionalExportComponent", - "prefix": "rfce", - "body": [ - "import React from 'react'", - "", - "function ${1:${TM_FILENAME_BASE}}() {", - " return (", - "
${1:first}
", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "description": "Creates a React Functional Component with ES7 module system", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleAssert": { - "key": "consoleAssert", - "prefix": "cas", - "body": ["console.assert(${1:first}, ${2:second})"], - "description": "If the specified expression is false, the message is written to the console along with a stack trace", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleClear": { - "key": "consoleClear", - "prefix": "ccl", - "body": ["console.clear()"], - "description": "Clears the console", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleCount": { - "key": "consoleCount", - "prefix": "cco", - "body": ["console.count(${1:first})"], - "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleDir": { - "key": "consoleDir", - "prefix": "cdi", - "body": ["console.dir(${1:first})"], - "description": "Prints a JavaScript representation of the specified object", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleError": { - "key": "consoleError", - "prefix": "cer", - "body": ["console.error(${1:first})"], - "description": "Displays a message in the console and also includes a stack trace from where the method was called", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleGroup": { - "key": "consoleGroup", - "prefix": "cgr", - "body": ["console.group('${1:first}')"], - "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleGroupEnd": { - "key": "consoleGroupEnd", - "prefix": "cge", - "body": ["console.groupEnd()"], - "description": "Closes out the corresponding console.group().", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLog": { - "key": "consoleLog", - "prefix": "clg", - "body": ["console.log(${1:first})"], - "description": "Displays a message in the console", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTrace": { - "key": "consoleTrace", - "prefix": "ctr", - "body": ["console.trace(${1:first})"], - "description": "Prints a stack trace from the point where the method was called", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLogObject": { - "key": "consoleLogObject", - "prefix": "clo", - "body": ["console.log('${1:first}', ${1:first})"], - "description": "Logs property with name.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleLogJson": { - "key": "consoleLogJson", - "prefix": "clj", - "body": ["console.log('${1:first}', JSON.stringify(${1:first}, null, 2))"], - "description": "Logs stringified JSON property with name.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTime": { - "key": "consoleTime", - "prefix": "ctm", - "body": ["console.time('${1:first}')"], - "description": "Console time wrapper", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleTimeEnd": { - "key": "consoleTimeEnd", - "prefix": "cte", - "body": ["console.timeEnd('${1:first}')"], - "description": "Console time end wrapper", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleWarn": { - "key": "consoleWarn", - "prefix": "cwa", - "body": ["console.warn(${1:first})"], - "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "consoleInfo": { - "key": "consoleInfo", - "prefix": "cin", - "body": ["console.info(${1:first})"], - "description": "Displays a message in the console but also displays a blue information icon along with the logged message", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useCallback": { - "key": "useCallback", - "prefix": "useCallbackSnippet", - "body": [ - "useCallback(", - " () => {", - " ${1:first}", - " },", - " [${2:second}],", - ")", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useContext": { - "key": "useContext", - "prefix": "useContextSnippet", - "body": ["const ${1:first} = useContext(${2:second})"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useEffect": { - "key": "useEffect", - "prefix": "useEffectSnippet", - "body": [ - "useEffect(() => {", - " ${1:first}", - "", - " return () => {", - " ${2:second}", - " }", - "}, [${3:third}])", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useImperativeHandle": { - "key": "useImperativeHandle", - "prefix": "useImperativeHandleSnippet", - "body": [ - "useImperativeHandle(", - " ${1:first},", - " () => {", - " ${2:second}", - " },", - " [${3:third}],", - ")" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useLayoutEffect": { - "key": "useLayoutEffect", - "prefix": "useLayoutEffectSnippet", - "body": [ - "useLayoutEffect(() => {", - " ${1:first}", - "", - " return () => {", - " ${2:second}", - " };", - "}, [${3:third}])" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useMemo": { - "key": "useMemo", - "prefix": "useMemoSnippet", - "body": ["useMemo(() => ${1:first}, [${2:second}])"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useReducer": { - "key": "useReducer", - "prefix": "useReducerSnippet", - "body": [ - "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useRef": { - "key": "useRef", - "prefix": "useRefSnippet", - "body": ["const ${1:first} = useRef(${2:second})"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "useState": { - "key": "useState", - "prefix": "useStateSnippet", - "body": [ - "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importAs": { - "key": "importAs", - "prefix": "ima", - "body": ["import { ${2:second} as ${3:third} } from '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importBrowserRouter": { - "key": "importBrowserRouter", - "prefix": "imbr", - "body": ["import { BrowserRouter as Router } from 'react-router-dom'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importBrowserRouterWithRouteAndNavLink": { - "key": "importBrowserRouterWithRouteAndNavLink", - "prefix": "imrr", - "body": [ - "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importDestructing": { - "key": "importDestructing", - "prefix": "imd", - "body": ["import { ${2:second} } from '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importEverything": { - "key": "importEverything", - "prefix": "ime", - "body": ["import * as ${2:second} from '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importNoModuleName": { - "key": "importNoModuleName", - "prefix": "imn", - "body": ["import '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importPropTypes": { - "key": "importPropTypes", - "prefix": "impt", - "body": ["import PropTypes from 'prop-types'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReact": { - "key": "importReact", - "prefix": "imr", - "body": ["import React from 'react'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactDom": { - "key": "importReactDom", - "prefix": "imrd", - "body": ["import ReactDOM from 'react-dom'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithComponent": { - "key": "importReactWithComponent", - "prefix": "imrc", - "body": ["import React, { Component } from 'react'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithComponentAndPropTypes": { - "key": "importReactWithComponentAndPropTypes", - "prefix": "imrcp", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithMemo": { - "key": "importReactWithMemo", - "prefix": "imrm", - "body": ["import React, { memo } from 'react'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithMemoAndPropTypes": { - "key": "importReactWithMemoAndPropTypes", - "prefix": "imrmp", - "body": [ - "import React, { memo } from 'react'", - "import PropTypes from 'prop-types'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithPureComponent": { - "key": "importReactWithPureComponent", - "prefix": "imrpc", - "body": ["import React, { PureComponent } from 'react'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReactWithPureComponentAndPropTypes": { - "key": "importReactWithPureComponentAndPropTypes", - "prefix": "imrpcp", - "body": [ - "import React, { PureComponent } from 'react'", - "import PropTypes from 'prop-types'", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterLink": { - "key": "importRouterLink", - "prefix": "imbrl", - "body": ["import { Link } from 'react-router-dom'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterNavLink": { - "key": "importRouterNavLink", - "prefix": "imbrnl", - "body": ["import { NavLink } from 'react-router-dom'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterSetup": { - "key": "importRouterSetup", - "prefix": "imbrc", - "body": ["import { Route, Switch, NavLink, Link } from 'react-router-dom'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importRouterSwitch": { - "key": "importRouterSwitch", - "prefix": "imbrs", - "body": ["import { Switch } from 'react-router-dom'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "import": { - "key": "import", - "prefix": "imp", - "body": ["import ${2:second} from '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArray": { - "key": "propTypeArray", - "prefix": "pta", - "body": ["PropTypes.array"], - "description": "Array prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayRequired": { - "key": "propTypeArrayRequired", - "prefix": "ptar", - "body": ["PropTypes.array.isRequired"], - "description": "Array prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeBool": { - "key": "propTypeBool", - "prefix": "ptb", - "body": ["PropTypes.bool"], - "description": "Bool prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeBoolRequired": { - "key": "propTypeBoolRequired", - "prefix": "ptbr", - "body": ["PropTypes.bool.isRequired"], - "description": "Bool prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeFunc": { - "key": "propTypeFunc", - "prefix": "ptf", - "body": ["PropTypes.func"], - "description": "Func prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeFuncRequired": { - "key": "propTypeFuncRequired", - "prefix": "ptfr", - "body": ["PropTypes.func.isRequired"], - "description": "Func prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNumber": { - "key": "propTypeNumber", - "prefix": "ptn", - "body": ["PropTypes.number"], - "description": "Number prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNumberRequired": { - "key": "propTypeNumberRequired", - "prefix": "ptnr", - "body": ["PropTypes.number.isRequired"], - "description": "Number prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObject": { - "key": "propTypeObject", - "prefix": "pto", - "body": ["PropTypes.object"], - "description": "Object prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectRequired": { - "key": "propTypeObjectRequired", - "prefix": "ptor", - "body": ["PropTypes.object.isRequired"], - "description": "Object prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeString": { - "key": "propTypeString", - "prefix": "pts", - "body": ["PropTypes.string"], - "description": "String prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeStringRequired": { - "key": "propTypeStringRequired", - "prefix": "ptsr", - "body": ["PropTypes.string.isRequired"], - "description": "String prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNode": { - "key": "propTypeNode", - "prefix": "ptnd", - "body": ["PropTypes.node"], - "description": "Anything that can be rendered: numbers, strings, elements or an array", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeNodeRequired": { - "key": "propTypeNodeRequired", - "prefix": "ptndr", - "body": ["PropTypes.node.isRequired"], - "description": "Anything that can be rendered: numbers, strings, elements or an array required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeElement": { - "key": "propTypeElement", - "prefix": "ptel", - "body": ["PropTypes.element"], - "description": "React element prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeElementRequired": { - "key": "propTypeElementRequired", - "prefix": "ptelr", - "body": ["PropTypes.element.isRequired"], - "description": "React element prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeInstanceOf": { - "key": "propTypeInstanceOf", - "prefix": "pti", - "body": ["PropTypes.instanceOf($0)"], - "description": "Is an instance of a class prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeInstanceOfRequired": { - "key": "propTypeInstanceOfRequired", - "prefix": "ptir", - "body": ["PropTypes.instanceOf($0).isRequired"], - "description": "Is an instance of a class prop type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeEnum": { - "key": "propTypeEnum", - "prefix": "pte", - "body": ["PropTypes.oneOf(['$0'])"], - "description": "Prop type limited to specific values by treating it as an enum", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeEnumRequired": { - "key": "propTypeEnumRequired", - "prefix": "pter", - "body": ["PropTypes.oneOf(['$0']).isRequired"], - "description": "Prop type limited to specific values by treating it as an enum required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeOneOfType": { - "key": "propTypeOneOfType", - "prefix": "ptet", - "body": ["PropTypes.oneOfType([", " $0", "])"], - "description": "An object that could be one of many types", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeOneOfTypeRequired": { - "key": "propTypeOneOfTypeRequired", - "prefix": "ptetr", - "body": ["PropTypes.oneOfType([", " $0", "]).isRequired"], - "description": "An object that could be one of many types required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayOf": { - "key": "propTypeArrayOf", - "prefix": "ptao", - "body": ["PropTypes.arrayOf($0)"], - "description": "An array of a certain type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeArrayOfRequired": { - "key": "propTypeArrayOfRequired", - "prefix": "ptaor", - "body": ["PropTypes.arrayOf($0).isRequired"], - "description": "An array of a certain type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectOf": { - "key": "propTypeObjectOf", - "prefix": "ptoo", - "body": ["PropTypes.objectOf($0)"], - "description": "An object with property values of a certain type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeObjectOfRequired": { - "key": "propTypeObjectOfRequired", - "prefix": "ptoor", - "body": ["PropTypes.objectOf($0).isRequired"], - "description": "An object with property values of a certain type required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeShape": { - "key": "propTypeShape", - "prefix": "ptsh", - "body": ["PropTypes.shape({", " $0", "})"], - "description": "An object taking on a particular shape", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeShapeRequired": { - "key": "propTypeShapeRequired", - "prefix": "ptshr", - "body": ["PropTypes.shape({", " $0", "}).isRequired"], - "description": "An object taking on a particular shape required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeExact": { - "key": "propTypeExact", - "prefix": "ptex", - "body": ["PropTypes.exact({", " $0", "})"], - "description": "An object with warnings on extra properties", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeExactRequired": { - "key": "propTypeExactRequired", - "prefix": "ptexr", - "body": ["PropTypes.exact({", " $0", "}).isRequired"], - "description": "An object with warnings on extra properties required", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propTypeAny": { - "key": "propTypeAny", - "prefix": "ptany", - "body": ["PropTypes.any"], - "description": "Any prop type", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponent": { - "key": "reactNativeComponent", - "prefix": "rnc", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponentExport": { - "key": "reactNativeComponentExport", - "prefix": "rnce", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { Component } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeComponentWithStyles": { - "key": "reactNativeComponentWithStyles", - "prefix": "rncs", - "body": [ - "import { Text, StyleSheet, View } from 'react-native'", - "import React, { Component } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends Component {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}", - "", - "const styles = StyleSheet.create({})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalComponent": { - "key": "reactNativeFunctionalComponent", - "prefix": "rnf", - "body": [ - "import { View, Text } from 'react-native'", - "import React from 'react'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalComponentWithStyles": { - "key": "reactNativeFunctionalComponentWithStyles", - "prefix": "rnfs", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "import React from 'react'", - "", - "export default function ${1:${TM_FILENAME_BASE}}() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "const styles = StyleSheet.create({})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalExportComponent": { - "key": "reactNativeFunctionalExportComponent", - "prefix": "rnfe", - "body": [ - "import { View, Text } from 'react-native'", - "import React from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeFunctionalExportComponentWithStyles": { - "key": "reactNativeFunctionalExportComponentWithStyles", - "prefix": "rnfes", - "body": [ - "import { StyleSheet, Text, View } from 'react-native'", - "import React from 'react'", - "", - "const ${1:${TM_FILENAME_BASE}} = () => {", - " return (", - " ", - " ${1:first}", - " ", - " )", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}", - "", - "const styles = StyleSheet.create({})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeImport": { - "key": "reactNativeImport", - "prefix": "imrn", - "body": ["import { ${1:first} } from 'react-native'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativePureComponent": { - "key": "reactNativePureComponent", - "prefix": "rnpc", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativePureComponentExport": { - "key": "reactNativePureComponentExport", - "prefix": "rnpce", - "body": [ - "import { Text, View } from 'react-native'", - "import React, { PureComponent } from 'react'", - "", - "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", - " render() {", - " return (", - " ", - " ${1:first}", - " ", - " )", - " }", - "}", - "", - "export default ${1:${TM_FILENAME_BASE}}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reactNativeStyles": { - "key": "reactNativeStyles", - "prefix": "rnstyle", - "body": ["const styles = StyleSheet.create({${1:first}})"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "importReduxConnect": { - "key": "importReduxConnect", - "prefix": "redux", - "body": ["import { connect } from 'react-redux'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxAction": { - "key": "reduxAction", - "prefix": "rxaction", - "body": [ - "export const ${1:first} = (payload) => ({", - " type: ${2:second},", - " payload", - "})", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxConst": { - "key": "reduxConst", - "prefix": "rxconst", - "body": ["export const ${1:first} = '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxReducer": { - "key": "reduxReducer", - "prefix": "rxreducer", - "body": [ - "const initialState = {}", - "", - "export default (state = initialState, { type, payload }) => {", - " switch (type) {", - "", - " case ${1:first}:", - " return { ...state, ...payload }", - "", - " default:", - " return state", - " }", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxSelector": { - "key": "reduxSelector", - "prefix": "rxselect", - "body": [ - "import { createSelector } from 'reselect'", - "", - "export const ${1:first} = state => state.${2:second}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "reduxSlice": { - "key": "reduxSlice", - "prefix": "rxslice", - "body": [ - "import { createSlice } from '@reduxjs/toolkit'", - "", - "const initialState = {", - "", - "}", - "", - "const ${1:${TM_FILENAME_BASE}} = createSlice({", - " name: ${2:second},", - " initialState,", - " reducers: {}", - "});", - "", - "export const {} = ${1:${TM_FILENAME_BASE}}.actions", - "", - "export default ${1:${TM_FILENAME_BASE}}.reducer" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "mappingToProps": { - "key": "mappingToProps", - "prefix": "reduxmap", - "body": [ - "const mapStateToProps = (state) => ({})", - "", - "const mapDispatchToProps = {}" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "describeBlock": { - "key": "describeBlock", - "prefix": "desc", - "body": ["describe('${1:first}', () => { ${2:second} })"], - "description": "Testing `describe` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "itAsyncBlock": { - "key": "itAsyncBlock", - "prefix": "tita", - "body": ["it('should ${1:first}', async () => { ${2:second} })"], - "description": "Testing asynchronous `it` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "itBlock": { - "key": "itBlock", - "prefix": "tit", - "body": ["it('should ${1:first}', () => { ${2:second} })"], - "description": "Testing `it` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactComponentTestWithRedux": { - "key": "setupReactComponentTestWithRedux", - "prefix": "srtest", - "body": [ - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from '~/store'", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(", - " ", - " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - " ,", - " )", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "description": "Create test component", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactNativeTest": { - "key": "setupReactNativeTest", - "prefix": "sntest", - "body": [ - "import 'react-native'", - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactNativeTestWithRedux": { - "key": "setupReactNativeTestWithRedux", - "prefix": "snrtest", - "body": [ - "import 'react-native'", - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "import { Provider } from 'react-redux'", - "", - "import store from '~/store'", - "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(", - " ", - " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", - " ,", - " )", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setupReactTest": { - "key": "setupReactTest", - "prefix": "stest", - "body": [ - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "", - "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", - "", - "describe('<${1:${TM_FILENAME_BASE}} />', () => {", - " const defaultProps = {}", - " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "testAsyncBlock": { - "key": "testAsyncBlock", - "prefix": "testa", - "body": ["test('should ${1:first}', async () => { ${2:second} })"], - "description": "Testing `asynchronous test` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "testBlock": { - "key": "testBlock", - "prefix": "test", - "body": ["test('should ${1:first}', () => { ${2:second} })"], - "description": "Testing `test` block", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefault": { - "key": "exportDefault", - "prefix": "exp", - "body": ["export default ${1:first}"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDestructing": { - "key": "exportDestructing", - "prefix": "exd", - "body": ["export { ${2:second} } from '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportAs": { - "key": "exportAs", - "prefix": "exa", - "body": ["export { ${2:second} as ${3:third} } from '${1:first}'"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportNamedFunction": { - "key": "exportNamedFunction", - "prefix": "enf", - "body": ["export const ${1:first} = (${2:second}) => {${3:third}}"], - "description": "Export named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefaultFunction": { - "key": "exportDefaultFunction", - "prefix": "edf", - "body": ["export default (${1:first}) => {${2:second}}"], - "description": "Export default function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "exportDefaultNamedFunction": { - "key": "exportDefaultNamedFunction", - "prefix": "ednf", - "body": ["export default function ${1:first}(${2:second}) {${3:third}}"], - "description": "Export default named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "method": { - "key": "method", - "prefix": "met", - "body": ["${1:first} = (${2:second}) => {${3:third}}"], - "description": "Creates a method inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propertyGet": { - "key": "propertyGet", - "prefix": "pge", - "body": ["get ${1:first}() {", " return this.${2:second}", "}"], - "description": "Creates a getter property inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "propertySet": { - "key": "propertySet", - "prefix": "pse", - "body": ["set ${1:first}(${2:second}) {${3:third}}"], - "description": "Creates a setter property inside a class", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forEach": { - "key": "forEach", - "prefix": "fre", - "body": ["${1:first}.forEach(${2:second} => {${3:third}})"], - "description": "Creates a forEach statement", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forOf": { - "key": "forOf", - "prefix": "fof", - "body": ["for(let ${1:first} of ${2:second}) {${3:third}}"], - "description": "Iterating over property names of iterable objects", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "forIn": { - "key": "forIn", - "prefix": "fin", - "body": ["for(let ${1:first} in ${2:second}) {${3:third}}"], - "description": "Iterating over property values of iterable objects", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "anonymousFunction": { - "key": "anonymousFunction", - "prefix": "anfn", - "body": ["(${1:first}) => { ${2:second} }"], - "description": "Creates an anonymous function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "namedFunction": { - "key": "namedFunction", - "prefix": "nfn", - "body": ["const ${1:first} = (${2:second}) => { ${3:third} }"], - "description": "Creates a named function", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructingObject": { - "key": "destructingObject", - "prefix": "dob", - "body": ["const {${2:second}} = ${1:first}"], - "description": "Creates and assigns a local variable using object destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructingArray": { - "key": "destructingArray", - "prefix": "dar", - "body": ["const [${2:second}] = ${1:first}"], - "description": "Creates and assigns a local variable using array destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setInterval": { - "key": "setInterval", - "prefix": "sti", - "body": ["setInterval(() => { ${1:first} }, ${2:second})"], - "description": "Executes the given function at specified intervals", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "setTimeOut": { - "key": "setTimeOut", - "prefix": "sto", - "body": ["setTimeout(() => { ${1:first} }, ${2:second})"], - "description": "Executes the given function after the specified delay", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "promise": { - "key": "promise", - "prefix": "prom", - "body": ["return new Promise((resolve, reject) => { ${1:first} })"], - "description": "Creates and returns a new Promise in the standard ES7 syntax", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructProps": { - "key": "destructProps", - "prefix": "cp", - "body": ["const { ${1:first} } = this.props"], - "description": "Creates and assigns a local variable using props destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "destructState": { - "key": "destructState", - "prefix": "cs", - "body": ["const { ${1:first} } = this.state"], - "description": "Creates and assigns a local variable using state destructing", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "classConstructor": { - "key": "classConstructor", - "prefix": "rconst", - "body": [ - "constructor(props) {", - " super(props)", - "", - " this.state = {", - " ${1:first}", - " }", - "}" - ], - "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "emptyState": { - "key": "emptyState", - "prefix": "est", - "body": ["state = { ${1:first} }"], - "description": "Creates empty state object. To be used in a constructor.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentDidMount": { - "key": "componentDidMount", - "prefix": "cdm", - "body": ["componentDidMount() { ${1:first} }"], - "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "shouldComponentUpdate": { - "key": "shouldComponentUpdate", - "prefix": "scu", - "body": ["shouldComponentUpdate(nextProps, nextState) { ${1:first} }"], - "description": "Invoked before rendering when new props or state are being received. ", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentDidUpdate": { - "key": "componentDidUpdate", - "prefix": "cdup", - "body": ["componentDidUpdate(prevProps, prevState) { ${1:first}} "], - "description": "Invoked immediately after the component's updates are flushed to the DOM.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentWillUnmount": { - "key": "componentWillUnmount", - "prefix": "cwun", - "body": ["componentWillUnmount() {${1:first} }"], - "description": "Invoked immediately before a component is unmounted from the DOM.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "getDerivedStateFromProps": { - "key": "getDerivedStateFromProps", - "prefix": "gdsfp", - "body": ["static getDerivedStateFromProps(props, state) {${1:first}}"], - "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "getSnapshotBeforeUpdate": { - "key": "getSnapshotBeforeUpdate", - "prefix": "gsbu", - "body": [ - "getSnapshotBeforeUpdate = (prevProps, prevState) => {${1:first}}" - ], - "description": "Called right before mutations are made (e.g. before the DOM is updated)", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "createContext": { - "key": "createContext", - "prefix": "rcontext", - "body": ["const ${1:first} = React.createContext()"], - "description": "Create React context", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "createRef": { - "key": "createRef", - "prefix": "cref", - "body": ["this.${1:first}Ref = React.createRef()"], - "description": "Create ref statement used inside constructor", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentSetStateObject": { - "key": "componentSetStateObject", - "prefix": "sst", - "body": ["this.setState({${1:first}})"], - "description": "Performs a shallow merge of nextState into current state", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentSetStateFunc": { - "key": "componentSetStateFunc", - "prefix": "ssf", - "body": ["this.setState((state, props) => { return { ${1:first} }})"], - "description": "Performs a shallow merge of nextState into current state", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentProps": { - "key": "componentProps", - "prefix": "props", - "body": ["this.props.${1:first}"], - "description": "Access component's props", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "componentState": { - "key": "componentState", - "prefix": "state", - "body": ["this.state.${1:first}"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "bindThis": { - "key": "bindThis", - "prefix": "bnd", - "body": ["this.${1:first} = this.${1:first}.bind(this)"], - "description": "Binds this to a method", - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "commentBigBlock": { - "key": "commentBigBlock", - "prefix": "cmmb", - "body": ["/**", " * ${1:first}", " */"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "hocComponentWithRedux": { - "key": "hocComponentWithRedux", - "prefix": "hocredux", - "body": [ - "import React from 'react'", - "import { connect } from 'react-redux'", - "import PropTypes from 'prop-types'", - "", - "export const mapStateToProps = state => ({})", - "", - "export const mapDispatchToProps = {}", - "", - "export const ${1:first} = (WrappedComponent) => {", - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {}", - "", - " return hocComponent", - "}", - "", - "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent))", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "hocComponent": { - "key": "hocComponent", - "prefix": "hoc", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default (WrappedComponent) => {", - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {}", - "", - " return hocComponent", - "}", - "" - ], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - }, - "typeofSnippet": { - "key": "typeofSnippet", - "prefix": "tpf", - "body": ["typeof ${1:first}"], - "scope": "typescript,typescriptreact,javascript,javascriptreact" - } -} +{} From 56b432560a79d526715a1b039b4d834dda3c4ffc Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Wed, 9 Feb 2022 23:12:29 +0100 Subject: [PATCH 105/110] feat: add console.table --- package.json | 2 +- src/sourceSnippets/console.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 676c144..537543c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.3.1", + "version": "4.3.2", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", diff --git a/src/sourceSnippets/console.ts b/src/sourceSnippets/console.ts index 30fc540..dec49de 100644 --- a/src/sourceSnippets/console.ts +++ b/src/sourceSnippets/console.ts @@ -16,6 +16,7 @@ type ConsoleMapping = { consoleTimeEnd: 'cte'; consoleWarn: 'cwa'; consoleInfo: 'cin'; + consoleTable: 'ctl'; }; export type ConsoleSnippet = SnippetMapping; @@ -134,6 +135,13 @@ const consoleInfo: ConsoleSnippet = { 'Displays a message in the console but also displays a blue information icon along with the logged message', }; +const consoleTable: ConsoleSnippet = { + key: 'consoleTable', + prefix: 'ctl', + body: [`console.table([${Placeholders.FirstTab}])`], + description: 'Logs table to console', +}; + export default [ consoleAssert, consoleClear, @@ -150,4 +158,5 @@ export default [ consoleTimeEnd, consoleWarn, consoleInfo, + consoleTable, ]; From e6e5d3929a612b70928428eb6f3b29b2f07a16e5 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 17 Feb 2022 16:52:42 +0100 Subject: [PATCH 106/110] chore: start extension on load --- CHANGELOG.md | 4 ++++ package.json | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e616aa..fd31ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All info about changes # Released +[4.4.0] - 2020-12-18 + +- Enable extension after startup finish to respect and parse snippets on settings change + [4.3.0] - 2020-12-18 - BREAKING CHANGES: diff --git a/package.json b/package.json index 537543c..2974a51 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "onLanguage:typescriptReact", "onLanguage:javascript", "onLanguage:javascriptReact", - "onCommand:reactSnippets.search" + "onCommand:reactSnippets.search", + "onStartupFinished" ], "contributes": { "commands": [ From a1df591fecaa7a19a2eff16002124fcc6df41e06 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Thu, 17 Feb 2022 16:53:39 +0100 Subject: [PATCH 107/110] 4.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2974a51..c274be8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.3.2", + "version": "4.4.0", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", From 67d4fae2b6041f0c2e2035c123ce91f4a86f67a3 Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 18 Feb 2022 14:09:12 +0100 Subject: [PATCH 108/110] chore: load extension on start --- package.json | 2 +- src/snippets/generated.json | 1908 ++++++++++++++++++++++++++++++++++- 2 files changed, 1908 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c274be8..2e6362f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.4.0", + "version": "4.4.2", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", diff --git a/src/snippets/generated.json b/src/snippets/generated.json index 0967ef4..d73bea5 100644 --- a/src/snippets/generated.json +++ b/src/snippets/generated.json @@ -1 +1,1907 @@ -{} +{ + "exportType": { + "body": ["export type ${1:first} = {${2:second}}"], + "key": "exportType", + "prefix": "exptp", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportInterface": { + "key": "exportInterface", + "prefix": "expint", + "body": ["export interface ${1:first} {${2:second}}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponent": { + "key": "typescriptReactClassComponent", + "prefix": "tsrcc", + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "body": [ + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportComponent": { + "key": "typescriptReactClassExportComponent", + "prefix": "tsrce", + "body": [ + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalExportComponent": { + "key": "typescriptReactFunctionalExportComponent", + "prefix": "tsrfce", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactFunctionalComponent": { + "key": "typescriptReactFunctionalComponent", + "prefix": "tsrfc", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", + " return (", + "
${1:first}
", + " )", + "}" + ], + "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionExportComponent": { + "key": "typescriptReactArrowFunctionExportComponent", + "prefix": "tsrafce", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactArrowFunctionComponent": { + "key": "typescriptReactArrowFunctionComponent", + "prefix": "tsrafc", + "body": [ + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + "
${1:first}
", + " )", + "}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassPureComponent": { + "key": "typescriptReactClassPureComponent", + "prefix": "tsrpc", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "type Props = {}", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassExportPureComponent": { + "key": "typescriptReactClassExportPureComponent", + "prefix": "tsrpce", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "type Props = {}", + "", + "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React pure component class with ES7 module system and TypeScript interface", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactClassComponentRedux": { + "key": "typescriptReactClassComponentRedux", + "prefix": "tsrcredux", + "body": [ + "import { connect } from 'react-redux'", + "import React, { Component } from 'react'", + "", + "type Props = {}", + "", + "type State = {}", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " state = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponent": { + "key": "typescriptReactNativeArrowFunctionComponent", + "prefix": "tsrnf", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system in TypeScript", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typescriptReactNativeArrowFunctionComponentWithStyles": { + "key": "typescriptReactNativeArrowFunctionComponentWithStyles", + "prefix": "tsrnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "type Props = {}", + "", + "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})" + ], + "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionComponent": { + "key": "reactArrowFunctionComponent", + "prefix": "rafc", + "body": [ + "import React from 'react'", + "", + "export const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + "
${1:first}
", + " )", + "}", + "" + ], + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionComponentWithPropTypes": { + "key": "reactArrowFunctionComponentWithPropTypes", + "prefix": "rafcp", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "const ${1:${TM_FILENAME_BASE}} = props => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactArrowFunctionExportComponent": { + "key": "reactArrowFunctionExportComponent", + "prefix": "rafce", + "body": [ + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Arrow Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponent": { + "key": "reactClassComponent", + "prefix": "rcc", + "body": [ + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentPropTypes": { + "key": "reactClassComponentPropTypes", + "prefix": "rccp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {${2:second}: ${3:third}}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with PropTypes and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentRedux": { + "key": "reactClassComponentRedux", + "prefix": "rcredux", + "body": [ + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassComponentReduxPropTypes": { + "key": "reactClassComponentReduxPropTypes", + "prefix": "rcreduxp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "import { connect } from 'react-redux'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {", + " ${2:second}: ${3:third}", + " }", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportComponent": { + "key": "reactClassExportComponent", + "prefix": "rce", + "body": [ + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportComponentWithPropTypes": { + "key": "reactClassExportComponentWithPropTypes", + "prefix": "rcep", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " static propTypes = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassExportPureComponent": { + "key": "reactClassExportPureComponent", + "prefix": "rpce", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React pure component class with ES7 module system export", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassPureComponent": { + "key": "reactClassPureComponent", + "prefix": "rpc", + "body": [ + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React pure component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactClassPureComponentWithPropTypes": { + "key": "reactClassPureComponentWithPropTypes", + "prefix": "rpcp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " static propTypes = {}", + "", + " render() {", + " return (", + "
${1:first}
", + " )", + " }", + "}", + "" + ], + "description": "Creates a React component class with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionMemoComponent": { + "key": "reactFunctionMemoComponent", + "prefix": "rmc", + "body": [ + "import React, { memo } from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = memo(() => {", + " return (", + "
${1:first}
", + " )", + "})", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Memo Function Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionMemoComponentWithPropTypes": { + "key": "reactFunctionMemoComponentWithPropTypes", + "prefix": "rmcp", + "body": [ + "import PropTypes from 'prop-types'", + "import React, { memo } from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = memo((props) => {", + " return (", + "
${1:first}
", + " )", + "})", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponent": { + "key": "reactFunctionalComponent", + "prefix": "rfc", + "body": [ + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + "
${1:first}
", + " )", + "}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentRedux": { + "key": "reactFunctionalComponentRedux", + "prefix": "rfcredux", + "body": [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "Creates a React functional component with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentReduxPropTypes": { + "key": "reactFunctionalComponentReduxPropTypes", + "prefix": "rfcreduxp", + "body": [ + "import PropTypes from 'prop-types'", + "import React from 'react'", + "import { connect } from 'react-redux'", + "", + "export const ${1:${TM_FILENAME_BASE}} = (props) => {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {", + " ${2:second}: PropTypes.${3:third}", + "}", + "", + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}", + "", + "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" + ], + "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalComponentWithPropTypes": { + "key": "reactFunctionalComponentWithPropTypes", + "prefix": "rfcp", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "function ${1:${TM_FILENAME_BASE}}(props) {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "${1:${TM_FILENAME_BASE}}.propTypes = {}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ], + "description": "Creates a React Functional Component with ES7 module system with PropTypes", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactFunctionalExportComponent": { + "key": "reactFunctionalExportComponent", + "prefix": "rfce", + "body": [ + "import React from 'react'", + "", + "function ${1:${TM_FILENAME_BASE}}() {", + " return (", + "
${1:first}
", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "description": "Creates a React Functional Component with ES7 module system", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleAssert": { + "key": "consoleAssert", + "prefix": "cas", + "body": ["console.assert(${1:first}, ${2:second})"], + "description": "If the specified expression is false, the message is written to the console along with a stack trace", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleClear": { + "key": "consoleClear", + "prefix": "ccl", + "body": ["console.clear()"], + "description": "Clears the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleCount": { + "key": "consoleCount", + "prefix": "cco", + "body": ["console.count(${1:first})"], + "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleDir": { + "key": "consoleDir", + "prefix": "cdi", + "body": ["console.dir(${1:first})"], + "description": "Prints a JavaScript representation of the specified object", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleError": { + "key": "consoleError", + "prefix": "cer", + "body": ["console.error(${1:first})"], + "description": "Displays a message in the console and also includes a stack trace from where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleGroup": { + "key": "consoleGroup", + "prefix": "cgr", + "body": ["console.group('${1:first}')"], + "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleGroupEnd": { + "key": "consoleGroupEnd", + "prefix": "cge", + "body": ["console.groupEnd()"], + "description": "Closes out the corresponding console.group().", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLog": { + "key": "consoleLog", + "prefix": "clg", + "body": ["console.log(${1:first})"], + "description": "Displays a message in the console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTrace": { + "key": "consoleTrace", + "prefix": "ctr", + "body": ["console.trace(${1:first})"], + "description": "Prints a stack trace from the point where the method was called", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLogObject": { + "key": "consoleLogObject", + "prefix": "clo", + "body": ["console.log('${1:first}', ${1:first})"], + "description": "Logs property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleLogJson": { + "key": "consoleLogJson", + "prefix": "clj", + "body": ["console.log('${1:first}', JSON.stringify(${1:first}, null, 2))"], + "description": "Logs stringified JSON property with name.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTime": { + "key": "consoleTime", + "prefix": "ctm", + "body": ["console.time('${1:first}')"], + "description": "Console time wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTimeEnd": { + "key": "consoleTimeEnd", + "prefix": "cte", + "body": ["console.timeEnd('${1:first}')"], + "description": "Console time end wrapper", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleWarn": { + "key": "consoleWarn", + "prefix": "cwa", + "body": ["console.warn(${1:first})"], + "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleInfo": { + "key": "consoleInfo", + "prefix": "cin", + "body": ["console.info(${1:first})"], + "description": "Displays a message in the console but also displays a blue information icon along with the logged message", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "consoleTable": { + "key": "consoleTable", + "prefix": "ctl", + "body": ["console.table([${1:first}])"], + "description": "Logs table to console", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useCallback": { + "key": "useCallback", + "prefix": "useCallbackSnippet", + "body": [ + "useCallback(", + " () => {", + " ${1:first}", + " },", + " [${2:second}],", + ")", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useContext": { + "key": "useContext", + "prefix": "useContextSnippet", + "body": ["const ${1:first} = useContext(${2:second})"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useEffect": { + "key": "useEffect", + "prefix": "useEffectSnippet", + "body": [ + "useEffect(() => {", + " ${1:first}", + "", + " return () => {", + " ${2:second}", + " }", + "}, [${3:third}])", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useImperativeHandle": { + "key": "useImperativeHandle", + "prefix": "useImperativeHandleSnippet", + "body": [ + "useImperativeHandle(", + " ${1:first},", + " () => {", + " ${2:second}", + " },", + " [${3:third}],", + ")" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useLayoutEffect": { + "key": "useLayoutEffect", + "prefix": "useLayoutEffectSnippet", + "body": [ + "useLayoutEffect(() => {", + " ${1:first}", + "", + " return () => {", + " ${2:second}", + " };", + "}, [${3:third}])" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useMemo": { + "key": "useMemo", + "prefix": "useMemoSnippet", + "body": ["useMemo(() => ${1:first}, [${2:second}])"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useReducer": { + "key": "useReducer", + "prefix": "useReducerSnippet", + "body": [ + "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useRef": { + "key": "useRef", + "prefix": "useRefSnippet", + "body": ["const ${1:first} = useRef(${2:second})"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "useState": { + "key": "useState", + "prefix": "useStateSnippet", + "body": [ + "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importAs": { + "key": "importAs", + "prefix": "ima", + "body": ["import { ${2:second} as ${3:third} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importBrowserRouter": { + "key": "importBrowserRouter", + "prefix": "imbr", + "body": ["import { BrowserRouter as Router } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importBrowserRouterWithRouteAndNavLink": { + "key": "importBrowserRouterWithRouteAndNavLink", + "prefix": "imrr", + "body": [ + "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importDestructing": { + "key": "importDestructing", + "prefix": "imd", + "body": ["import { ${2:second} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importEverything": { + "key": "importEverything", + "prefix": "ime", + "body": ["import * as ${2:second} from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importNoModuleName": { + "key": "importNoModuleName", + "prefix": "imn", + "body": ["import '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importPropTypes": { + "key": "importPropTypes", + "prefix": "impt", + "body": ["import PropTypes from 'prop-types'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReact": { + "key": "importReact", + "prefix": "imr", + "body": ["import React from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactDom": { + "key": "importReactDom", + "prefix": "imrd", + "body": ["import ReactDOM from 'react-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithComponent": { + "key": "importReactWithComponent", + "prefix": "imrc", + "body": ["import React, { Component } from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithComponentAndPropTypes": { + "key": "importReactWithComponentAndPropTypes", + "prefix": "imrcp", + "body": [ + "import React, { Component } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithMemo": { + "key": "importReactWithMemo", + "prefix": "imrm", + "body": ["import React, { memo } from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithMemoAndPropTypes": { + "key": "importReactWithMemoAndPropTypes", + "prefix": "imrmp", + "body": [ + "import React, { memo } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithPureComponent": { + "key": "importReactWithPureComponent", + "prefix": "imrpc", + "body": ["import React, { PureComponent } from 'react'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReactWithPureComponentAndPropTypes": { + "key": "importReactWithPureComponentAndPropTypes", + "prefix": "imrpcp", + "body": [ + "import React, { PureComponent } from 'react'", + "import PropTypes from 'prop-types'", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterLink": { + "key": "importRouterLink", + "prefix": "imbrl", + "body": ["import { Link } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterNavLink": { + "key": "importRouterNavLink", + "prefix": "imbrnl", + "body": ["import { NavLink } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterSetup": { + "key": "importRouterSetup", + "prefix": "imbrc", + "body": ["import { Route, Switch, NavLink, Link } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importRouterSwitch": { + "key": "importRouterSwitch", + "prefix": "imbrs", + "body": ["import { Switch } from 'react-router-dom'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "import": { + "key": "import", + "prefix": "imp", + "body": ["import ${2:second} from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArray": { + "key": "propTypeArray", + "prefix": "pta", + "body": ["PropTypes.array"], + "description": "Array prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayRequired": { + "key": "propTypeArrayRequired", + "prefix": "ptar", + "body": ["PropTypes.array.isRequired"], + "description": "Array prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeBool": { + "key": "propTypeBool", + "prefix": "ptb", + "body": ["PropTypes.bool"], + "description": "Bool prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeBoolRequired": { + "key": "propTypeBoolRequired", + "prefix": "ptbr", + "body": ["PropTypes.bool.isRequired"], + "description": "Bool prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeFunc": { + "key": "propTypeFunc", + "prefix": "ptf", + "body": ["PropTypes.func"], + "description": "Func prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeFuncRequired": { + "key": "propTypeFuncRequired", + "prefix": "ptfr", + "body": ["PropTypes.func.isRequired"], + "description": "Func prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNumber": { + "key": "propTypeNumber", + "prefix": "ptn", + "body": ["PropTypes.number"], + "description": "Number prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNumberRequired": { + "key": "propTypeNumberRequired", + "prefix": "ptnr", + "body": ["PropTypes.number.isRequired"], + "description": "Number prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObject": { + "key": "propTypeObject", + "prefix": "pto", + "body": ["PropTypes.object"], + "description": "Object prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectRequired": { + "key": "propTypeObjectRequired", + "prefix": "ptor", + "body": ["PropTypes.object.isRequired"], + "description": "Object prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeString": { + "key": "propTypeString", + "prefix": "pts", + "body": ["PropTypes.string"], + "description": "String prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeStringRequired": { + "key": "propTypeStringRequired", + "prefix": "ptsr", + "body": ["PropTypes.string.isRequired"], + "description": "String prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNode": { + "key": "propTypeNode", + "prefix": "ptnd", + "body": ["PropTypes.node"], + "description": "Anything that can be rendered: numbers, strings, elements or an array", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeNodeRequired": { + "key": "propTypeNodeRequired", + "prefix": "ptndr", + "body": ["PropTypes.node.isRequired"], + "description": "Anything that can be rendered: numbers, strings, elements or an array required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeElement": { + "key": "propTypeElement", + "prefix": "ptel", + "body": ["PropTypes.element"], + "description": "React element prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeElementRequired": { + "key": "propTypeElementRequired", + "prefix": "ptelr", + "body": ["PropTypes.element.isRequired"], + "description": "React element prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeInstanceOf": { + "key": "propTypeInstanceOf", + "prefix": "pti", + "body": ["PropTypes.instanceOf($0)"], + "description": "Is an instance of a class prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeInstanceOfRequired": { + "key": "propTypeInstanceOfRequired", + "prefix": "ptir", + "body": ["PropTypes.instanceOf($0).isRequired"], + "description": "Is an instance of a class prop type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeEnum": { + "key": "propTypeEnum", + "prefix": "pte", + "body": ["PropTypes.oneOf(['$0'])"], + "description": "Prop type limited to specific values by treating it as an enum", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeEnumRequired": { + "key": "propTypeEnumRequired", + "prefix": "pter", + "body": ["PropTypes.oneOf(['$0']).isRequired"], + "description": "Prop type limited to specific values by treating it as an enum required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeOneOfType": { + "key": "propTypeOneOfType", + "prefix": "ptet", + "body": ["PropTypes.oneOfType([", " $0", "])"], + "description": "An object that could be one of many types", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeOneOfTypeRequired": { + "key": "propTypeOneOfTypeRequired", + "prefix": "ptetr", + "body": ["PropTypes.oneOfType([", " $0", "]).isRequired"], + "description": "An object that could be one of many types required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayOf": { + "key": "propTypeArrayOf", + "prefix": "ptao", + "body": ["PropTypes.arrayOf($0)"], + "description": "An array of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeArrayOfRequired": { + "key": "propTypeArrayOfRequired", + "prefix": "ptaor", + "body": ["PropTypes.arrayOf($0).isRequired"], + "description": "An array of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectOf": { + "key": "propTypeObjectOf", + "prefix": "ptoo", + "body": ["PropTypes.objectOf($0)"], + "description": "An object with property values of a certain type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeObjectOfRequired": { + "key": "propTypeObjectOfRequired", + "prefix": "ptoor", + "body": ["PropTypes.objectOf($0).isRequired"], + "description": "An object with property values of a certain type required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeShape": { + "key": "propTypeShape", + "prefix": "ptsh", + "body": ["PropTypes.shape({", " $0", "})"], + "description": "An object taking on a particular shape", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeShapeRequired": { + "key": "propTypeShapeRequired", + "prefix": "ptshr", + "body": ["PropTypes.shape({", " $0", "}).isRequired"], + "description": "An object taking on a particular shape required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeExact": { + "key": "propTypeExact", + "prefix": "ptex", + "body": ["PropTypes.exact({", " $0", "})"], + "description": "An object with warnings on extra properties", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeExactRequired": { + "key": "propTypeExactRequired", + "prefix": "ptexr", + "body": ["PropTypes.exact({", " $0", "}).isRequired"], + "description": "An object with warnings on extra properties required", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propTypeAny": { + "key": "propTypeAny", + "prefix": "ptany", + "body": ["PropTypes.any"], + "description": "Any prop type", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponent": { + "key": "reactNativeComponent", + "prefix": "rnc", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponentExport": { + "key": "reactNativeComponentExport", + "prefix": "rnce", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeComponentWithStyles": { + "key": "reactNativeComponentWithStyles", + "prefix": "rncs", + "body": [ + "import { Text, StyleSheet, View } from 'react-native'", + "import React, { Component } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends Component {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalComponent": { + "key": "reactNativeFunctionalComponent", + "prefix": "rnf", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalComponentWithStyles": { + "key": "reactNativeFunctionalComponentWithStyles", + "prefix": "rnfs", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "export default function ${1:${TM_FILENAME_BASE}}() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalExportComponent": { + "key": "reactNativeFunctionalExportComponent", + "prefix": "rnfe", + "body": [ + "import { View, Text } from 'react-native'", + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeFunctionalExportComponentWithStyles": { + "key": "reactNativeFunctionalExportComponentWithStyles", + "prefix": "rnfes", + "body": [ + "import { StyleSheet, Text, View } from 'react-native'", + "import React from 'react'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + " return (", + " ", + " ${1:first}", + " ", + " )", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "", + "const styles = StyleSheet.create({})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeImport": { + "key": "reactNativeImport", + "prefix": "imrn", + "body": ["import { ${1:first} } from 'react-native'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativePureComponent": { + "key": "reactNativePureComponent", + "prefix": "rnpc", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { PureComponent } from 'react'", + "", + "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativePureComponentExport": { + "key": "reactNativePureComponentExport", + "prefix": "rnpce", + "body": [ + "import { Text, View } from 'react-native'", + "import React, { PureComponent } from 'react'", + "", + "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", + " render() {", + " return (", + " ", + " ${1:first}", + " ", + " )", + " }", + "}", + "", + "export default ${1:${TM_FILENAME_BASE}}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reactNativeStyles": { + "key": "reactNativeStyles", + "prefix": "rnstyle", + "body": ["const styles = StyleSheet.create({${1:first}})"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "importReduxConnect": { + "key": "importReduxConnect", + "prefix": "redux", + "body": ["import { connect } from 'react-redux'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxAction": { + "key": "reduxAction", + "prefix": "rxaction", + "body": [ + "export const ${1:first} = (payload) => ({", + " type: ${2:second},", + " payload", + "})", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxConst": { + "key": "reduxConst", + "prefix": "rxconst", + "body": ["export const ${1:first} = '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxReducer": { + "key": "reduxReducer", + "prefix": "rxreducer", + "body": [ + "const initialState = {}", + "", + "export default (state = initialState, { type, payload }) => {", + " switch (type) {", + "", + " case ${1:first}:", + " return { ...state, ...payload }", + "", + " default:", + " return state", + " }", + "}", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxSelector": { + "key": "reduxSelector", + "prefix": "rxselect", + "body": [ + "import { createSelector } from 'reselect'", + "", + "export const ${1:first} = state => state.${2:second}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "reduxSlice": { + "key": "reduxSlice", + "prefix": "rxslice", + "body": [ + "import { createSlice } from '@reduxjs/toolkit'", + "", + "const initialState = {", + "", + "}", + "", + "const ${1:${TM_FILENAME_BASE}} = createSlice({", + " name: ${2:second},", + " initialState,", + " reducers: {}", + "});", + "", + "export const {} = ${1:${TM_FILENAME_BASE}}.actions", + "", + "export default ${1:${TM_FILENAME_BASE}}.reducer" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "mappingToProps": { + "key": "mappingToProps", + "prefix": "reduxmap", + "body": [ + "const mapStateToProps = (state) => ({})", + "", + "const mapDispatchToProps = {}" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "describeBlock": { + "key": "describeBlock", + "prefix": "desc", + "body": ["describe('${1:first}', () => { ${2:second} })"], + "description": "Testing `describe` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "itAsyncBlock": { + "key": "itAsyncBlock", + "prefix": "tita", + "body": ["it('should ${1:first}', async () => { ${2:second} })"], + "description": "Testing asynchronous `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "itBlock": { + "key": "itBlock", + "prefix": "tit", + "body": ["it('should ${1:first}', () => { ${2:second} })"], + "description": "Testing `it` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactComponentTestWithRedux": { + "key": "setupReactComponentTestWithRedux", + "prefix": "srtest", + "body": [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "description": "Create test component", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactNativeTest": { + "key": "setupReactNativeTest", + "prefix": "sntest", + "body": [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactNativeTestWithRedux": { + "key": "setupReactNativeTestWithRedux", + "prefix": "snrtest", + "body": [ + "import 'react-native'", + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "import { Provider } from 'react-redux'", + "", + "import store from '~/store'", + "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(", + " ", + " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", + " ,", + " )", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setupReactTest": { + "key": "setupReactTest", + "prefix": "stest", + "body": [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + "", + "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", + "", + "describe('<${1:${TM_FILENAME_BASE}} />', () => {", + " const defaultProps = {}", + " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", + "", + " test('render', () => {", + " expect(wrapper).toMatchSnapshot()", + " })", + "})" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "testAsyncBlock": { + "key": "testAsyncBlock", + "prefix": "testa", + "body": ["test('should ${1:first}', async () => { ${2:second} })"], + "description": "Testing `asynchronous test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "testBlock": { + "key": "testBlock", + "prefix": "test", + "body": ["test('should ${1:first}', () => { ${2:second} })"], + "description": "Testing `test` block", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefault": { + "key": "exportDefault", + "prefix": "exp", + "body": ["export default ${1:first}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDestructing": { + "key": "exportDestructing", + "prefix": "exd", + "body": ["export { ${2:second} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportAs": { + "key": "exportAs", + "prefix": "exa", + "body": ["export { ${2:second} as ${3:third} } from '${1:first}'"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportNamedFunction": { + "key": "exportNamedFunction", + "prefix": "enf", + "body": ["export const ${1:first} = (${2:second}) => {${3:third}}"], + "description": "Export named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultFunction": { + "key": "exportDefaultFunction", + "prefix": "edf", + "body": ["export default (${1:first}) => {${2:second}}"], + "description": "Export default function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "exportDefaultNamedFunction": { + "key": "exportDefaultNamedFunction", + "prefix": "ednf", + "body": ["export default function ${1:first}(${2:second}) {${3:third}}"], + "description": "Export default named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "method": { + "key": "method", + "prefix": "met", + "body": ["${1:first} = (${2:second}) => {${3:third}}"], + "description": "Creates a method inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertyGet": { + "key": "propertyGet", + "prefix": "pge", + "body": ["get ${1:first}() {", " return this.${2:second}", "}"], + "description": "Creates a getter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "propertySet": { + "key": "propertySet", + "prefix": "pse", + "body": ["set ${1:first}(${2:second}) {${3:third}}"], + "description": "Creates a setter property inside a class", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forEach": { + "key": "forEach", + "prefix": "fre", + "body": ["${1:first}.forEach(${2:second} => {${3:third}})"], + "description": "Creates a forEach statement", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forOf": { + "key": "forOf", + "prefix": "fof", + "body": ["for(let ${1:first} of ${2:second}) {${3:third}}"], + "description": "Iterating over property names of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "forIn": { + "key": "forIn", + "prefix": "fin", + "body": ["for(let ${1:first} in ${2:second}) {${3:third}}"], + "description": "Iterating over property values of iterable objects", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "anonymousFunction": { + "key": "anonymousFunction", + "prefix": "anfn", + "body": ["(${1:first}) => { ${2:second} }"], + "description": "Creates an anonymous function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "namedFunction": { + "key": "namedFunction", + "prefix": "nfn", + "body": ["const ${1:first} = (${2:second}) => { ${3:third} }"], + "description": "Creates a named function", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingObject": { + "key": "destructingObject", + "prefix": "dob", + "body": ["const {${2:second}} = ${1:first}"], + "description": "Creates and assigns a local variable using object destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructingArray": { + "key": "destructingArray", + "prefix": "dar", + "body": ["const [${2:second}] = ${1:first}"], + "description": "Creates and assigns a local variable using array destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setInterval": { + "key": "setInterval", + "prefix": "sti", + "body": ["setInterval(() => { ${1:first} }, ${2:second})"], + "description": "Executes the given function at specified intervals", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "setTimeOut": { + "key": "setTimeOut", + "prefix": "sto", + "body": ["setTimeout(() => { ${1:first} }, ${2:second})"], + "description": "Executes the given function after the specified delay", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "promise": { + "key": "promise", + "prefix": "prom", + "body": ["return new Promise((resolve, reject) => { ${1:first} })"], + "description": "Creates and returns a new Promise in the standard ES7 syntax", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructProps": { + "key": "destructProps", + "prefix": "cp", + "body": ["const { ${1:first} } = this.props"], + "description": "Creates and assigns a local variable using props destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "destructState": { + "key": "destructState", + "prefix": "cs", + "body": ["const { ${1:first} } = this.state"], + "description": "Creates and assigns a local variable using state destructing", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "classConstructor": { + "key": "classConstructor", + "prefix": "rconst", + "body": [ + "constructor(props) {", + " super(props)", + "", + " this.state = {", + " ${1:first}", + " }", + "}" + ], + "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "emptyState": { + "key": "emptyState", + "prefix": "est", + "body": ["state = { ${1:first} }"], + "description": "Creates empty state object. To be used in a constructor.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidMount": { + "key": "componentDidMount", + "prefix": "cdm", + "body": ["componentDidMount() { ${1:first} }"], + "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "shouldComponentUpdate": { + "key": "shouldComponentUpdate", + "prefix": "scu", + "body": ["shouldComponentUpdate(nextProps, nextState) { ${1:first} }"], + "description": "Invoked before rendering when new props or state are being received. ", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentDidUpdate": { + "key": "componentDidUpdate", + "prefix": "cdup", + "body": ["componentDidUpdate(prevProps, prevState) { ${1:first}} "], + "description": "Invoked immediately after the component's updates are flushed to the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentWillUnmount": { + "key": "componentWillUnmount", + "prefix": "cwun", + "body": ["componentWillUnmount() {${1:first} }"], + "description": "Invoked immediately before a component is unmounted from the DOM.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getDerivedStateFromProps": { + "key": "getDerivedStateFromProps", + "prefix": "gdsfp", + "body": ["static getDerivedStateFromProps(props, state) {${1:first}}"], + "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "getSnapshotBeforeUpdate": { + "key": "getSnapshotBeforeUpdate", + "prefix": "gsbu", + "body": [ + "getSnapshotBeforeUpdate = (prevProps, prevState) => {${1:first}}" + ], + "description": "Called right before mutations are made (e.g. before the DOM is updated)", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createContext": { + "key": "createContext", + "prefix": "rcontext", + "body": ["const ${1:first} = React.createContext()"], + "description": "Create React context", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "createRef": { + "key": "createRef", + "prefix": "cref", + "body": ["this.${1:first}Ref = React.createRef()"], + "description": "Create ref statement used inside constructor", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateObject": { + "key": "componentSetStateObject", + "prefix": "sst", + "body": ["this.setState({${1:first}})"], + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentSetStateFunc": { + "key": "componentSetStateFunc", + "prefix": "ssf", + "body": ["this.setState((state, props) => { return { ${1:first} }})"], + "description": "Performs a shallow merge of nextState into current state", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentProps": { + "key": "componentProps", + "prefix": "props", + "body": ["this.props.${1:first}"], + "description": "Access component's props", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "componentState": { + "key": "componentState", + "prefix": "state", + "body": ["this.state.${1:first}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "bindThis": { + "key": "bindThis", + "prefix": "bnd", + "body": ["this.${1:first} = this.${1:first}.bind(this)"], + "description": "Binds this to a method", + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "commentBigBlock": { + "key": "commentBigBlock", + "prefix": "cmmb", + "body": ["/**", " * ${1:first}", " */"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponentWithRedux": { + "key": "hocComponentWithRedux", + "prefix": "hocredux", + "body": [ + "import React from 'react'", + "import { connect } from 'react-redux'", + "import PropTypes from 'prop-types'", + "", + "export const mapStateToProps = state => ({})", + "", + "export const mapDispatchToProps = {}", + "", + "export const ${1:first} = (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "", + "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent))", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "hocComponent": { + "key": "hocComponent", + "prefix": "hoc", + "body": [ + "import React from 'react'", + "import PropTypes from 'prop-types'", + "", + "export default (WrappedComponent) => {", + " const hocComponent = ({ ...props }) => ", + "", + " hocComponent.propTypes = {}", + "", + " return hocComponent", + "}", + "" + ], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + }, + "typeofSnippet": { + "key": "typeofSnippet", + "prefix": "tpf", + "body": ["typeof ${1:first}"], + "scope": "typescript,typescriptreact,javascript,javascriptreact" + } +} From 5c68701f8dbe0f788971911bc1fc20b617be769b Mon Sep 17 00:00:00 2001 From: Damian Sznajder Date: Fri, 18 Feb 2022 14:12:39 +0100 Subject: [PATCH 109/110] 4.4.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e6362f..12df135 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "es7-react-js-snippets", "displayName": "ES7+ React/Redux/React-Native snippets", "description": "Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax. Customizable. Built-in integration with prettier.", - "version": "4.4.2", + "version": "4.4.3", "publisher": "dsznajder", "icon": "images/logo.png", "browser": "./lib/index.js", From 185bb91a0b692c54136663464e8225872c434637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Apr 2022 07:23:52 +0000 Subject: [PATCH 110/110] chore(deps): bump minimist from 1.2.5 to 1.2.6 Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] --- README.md | 7 ------- yarn.lock | 6 +++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b00b32a..38808d5 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,6 @@ Manage pull requests and conduct code reviews in your IDE with full source-tree
- - -

Easy pair programming with any IDE. Duckly enables you to talk, share your code inreal-time, server and terminal with people using different IDEs Try it out for free -

- -
- ### Conquer of Completion It is possible to use this package in your vim/neovim text editor, to make this possible, make sure you have the `coc.nvim` previously configured, then add this command to your `init.vim` diff --git a/yarn.lock b/yarn.lock index 598ecad..3956e33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1321,9 +1321,9 @@ minimatch@^3.0.4: brace-expansion "^1.1.7" minimist@^1.2.0: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== ms@2.0.0: version "2.0.0"