diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..10b3143 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,282 @@ +const path = require('path'); + +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + + parserOptions: { + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + + extends: ['eslint-config-prettier'], + + plugins: [ + 'babel', + 'eslint-comments', + 'import', + 'prettier', + 'simple-import-sort', + ], + + rules: { + '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'], + + 'import/no-unresolved': [ + 'error', + { 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: { + jasmine: true, + }, +}; diff --git a/.github/workflows/typescript_and_lint.yml b/.github/workflows/typescript_and_lint.yml new file mode 100644 index 0000000..83ee80e --- /dev/null +++ b/.github/workflows/typescript_and_lint.yml @@ -0,0 +1,30 @@ +name: Typescript & lint + +on: + push: + branches: + - "*" + +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/.gitignore b/.gitignore new file mode 100644 index 0000000..42ffe71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +out +node_modules +.vscode-test/ +*.vsix +*.log +.DS_Store +lib/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..7731ae6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["ms-vscode.vscode-typescript-tslint-plugin"] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 5901239..9647865 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,13 +1,26 @@ -// A launch configuration that launches the extension inside a new window { - "version": "0.1.0", - "configurations": [ - { - "name": "Launch Extension", - "type": "extensionHost", - "request": "launch", - "runtimeExecutable": "${execPath}", - "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Run Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceFolder}"], + "outFiles": ["${workspaceFolder}/out/**/*.js"], + "preLaunchTask": "npm: watch" + }, + { + "name": "Extension Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/out/test" + ], + "outFiles": ["${workspaceFolder}/out/test/**/*.js"], + "preLaunchTask": "npm: watch" + } + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4ba2e2c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "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 + }, +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..34edf97 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,18 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "watch", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "presentation": { + "reveal": "never" + }, + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..2caa1cb --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,7 @@ +**/tsconfig.json +*.ts +.github/** +.gitignore +.vscode/** +docs/** +src/** diff --git a/CHANGELOG.md b/CHANGELOG.md index 9857d03..fd31ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,101 +4,228 @@ 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: + - 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 + +[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 + +[2.7.0] - 2020-03-11 + +- Add few snippets for react-router + +[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`. + +[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. + +[2.2.2] - 2019-05-03 + +- Set "extensionKind": "ui" to support remote development + +[2.2.0] - 2019-04-06 + +- Add `rnf` for React-Native functional component, use TS for extension + +[2.1.0] - 2019-03-08 + +- Added hooks snippets + +[2.0.0] - 2019-01-31 + +- Add search engine for snippets with `ES7 snippet search` command. + +[1.9.4] - 2018-12-21 + +- Remove unnecessary bracket. + +[1.9.3] - 2018-12-18 + +- Add `clo`, `ctm` and `cte` for easier debugging. + +[1.9.0] - 2018-11-03 + +- Add `rpce`, remove unnecessary setups for tests + +[1.8.7] - 2018-10-16 + +- Add option for functional and anonymous functional components. + +[1.8.6] - 2018-08-26 + +- Fix `rfcp`, remove duplication on `rfep`, rename `rncstyle` to `rncs`. + +[1.8.4] - 2018-07-20 + +- Add `imrd`. + +[1.8.3] - 2018-06-16 + +- Use properly snippet variables, add `scrtest`. + +[1.8.2] - 2018-06-12 + +- Fix typo in `rcredux`. + +[1.8.1] - 2018-06-11 + +- Restore Filename selection on components. + +[1.8.0] - 2018-06-11 + +- Use Filename when creating component. + +[1.7.1] - 2018-06-08 + +- Add `impt` for PropTypes. + +[1.7.0] - 2018-06-01 + +- Add `cp`, `cs` destruct and react component test `sctest`. + +[1.6.0] - 2018-05-05 + +- Add support for `ts` and `tsx` extensions. + +[1.5.2] - 2018-04-30 + +- Add `bnd`. + +[1.5.1] - 2018-04-20 + +- Add `gdsfp`, `gsbu`, `rcontext`, `cref`, `fref` from React 16.3, deprecations for `cwup` `cwm` `cwr`. + +[1.4.0] - 2018-04-12 + +- Add `ptany`, add PureComponent and Styles for React-Native. + +[1.3.3] - 2018-02-01 + +- Create `snrtest`, fix `sntest`, little change for `ptypes`. + [1.3.2] - 2018-01-20 -* Add 'ptypes' for static propTypes snippet. +- Add 'ptypes' for static propTypes snippet. [1.3.1] - 2018-01-15 -* Add 'rncredux' for ReactNative component with Redux. +- Add 'rncredux' for ReactNative component with Redux. [1.3.0] - 2017-12-13 -* GraphQL snippets for React Apollo. +- GraphQL snippets for React Apollo. [1.2.0] - 2017-11-04 -* Add some export snippets. +- Add some export snippets. [1.1.3] - 2017-10-07 -* Add `sntest` for ReactNative components test. +- Add `sntest` for ReactNative components test. [1.1.2] - 2017-09-28 -* Fix rfc/rfcp with export default. +- Fix rfc/rfcp with export default. [1.1.1] - 2017-09-27 -* Refactor to const arrow functions stateless components. +- Refactor to const arrow functions stateless components. [1.1.0] - 2017-08-28 -* Add stateless components & comment block. +- Add stateless components & comment block. [1.0.0] - 2017-08-23 -* Refactor snippets, add hoc components. +- Refactor snippets, add hoc components. [0.5.5] - 2017-08-21 -* Add redux selector. +- Add redux selector. [0.5.4] - 2017-08-20 -* Improve README readability. +- Improve README readability. [0.5.3] - 2017-08-15 -* Add basic spec setup with global setup pattern. +- Add basic spec setup with global setup pattern. [0.5.2] - 2017-07-17 -* Add redux action, constant, reducer. +- Add redux action, constant, reducer. [0.5.0] - 2017-07-10 -* Add components for React Native. +- Add components for React Native. [0.4.2] - 2017-06-30 -* Add specific imports for React and redux. +- Add specific imports for React and redux. [0.4.1] - 2017-06-23 -* Add additional React Components with export propTypes and React PureComponents. +- Add additional React Components with export propTypes and React PureComponents. [0.4.0] - 2017-06-20 -* Add additional React Component with export at the end. Change `tdesc` into `desc`. +- Add additional React Component with export at the end. Change `tdesc` into `desc`. [0.3.3] - 2017-06-15 -* Add visual vesion, installs and rating. +- Add visual vesion, installs and rating. [0.3.2] - 2017-06-13 -* Update README, add proper keywords. +- Update README, add proper keywords. [0.3.0] - 2017-06-12 -* Add logo. +- Add logo. [0.2.2] - 2017-06-12 -* Add test snippets, update description. +- Add test snippets, update description. [0.1.3] - 2017-06-10 -* Specify React Components snippets, improve mapping componentNames and add static prop. +- Specify React Components snippets, improve mapping componentNames and add static prop. [0.1.2] - 2017-06-08 -* Update Readme with basic knowledge of snippets. +- Update Readme with basic knowledge of snippets. [0.1.0] - 2017-06-07 -* Console snippets -* React components snippets -* Import and functions snippets -* PropTypes snippets +- Console snippets +- React components snippets +- Import and functions snippets +- PropTypes snippets diff --git a/LICENCE b/LICENSE similarity index 96% rename from LICENCE rename to LICENSE index d476690..35f3a73 100644 --- a/LICENCE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 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/README.md b/README.md index 48f1919..38808d5 100644 --- a/README.md +++ b/README.md @@ -1,522 +1,80 @@ -# 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 provide you Javascript and React/Redux snippets in ES7 with babel plugins features for [Vs Code](https://code.visualstudio.com/) - -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) -* JavaScript React (.jsx) - -## Snippets info - -Every space inside `{ }` and `( )` means that this is pushed into next line :) -`$` represent each step after `tab`. - -## 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) => { }` | -| `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` | - -## React - -| Prefix | Method | -| --------: | ----------------------------------------------------------------------------------- | -| `imr→` | `import React from 'react'` | -| `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'` | -| `redux→` | `import { connect } from 'react-redux'` | -| `rconst→` | `constructor(props) with this.state` | -| `rconc→` | `constructor(props, context) with this.state` | -| `est→` | `this.state = { }` | -| `cwm→` | `componentWillMount = () => { }` | -| `cdm→` | `componentDidMount = () => { }` | -| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` | -| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | -| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` | -| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` | -| `cwun→` | `componentWillUnmount = () => { }` | -| `ren→` | `render() { return( ) }` | -| `sst→` | `this.setState({ })` | -| `ssf→` | `this.setState((state, props) => return { })` | -| `props→` | `this.props.propName` | -| `state→` | `this.state.stateName` | - -## React Native - -| Prefix | Method | -| ------: | ----------------------------------- | -| `imrn→` | `import { $1 } from 'react-native'` | - -## Redux - -| Prefix | Method | -| -----------: | ------------------------- | -| `rxaction→` | `redux action template` | -| `rxconst→` | `export const $1 = '$1'` | -| `rxreducer→` | `redux reducer template` | -| `rxselect→` | `redux selector 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` | -| `ptypes→` | `static propTypes = {}` | - -## GraphQL +# VS Code ES7+ React/Redux/React-Native/JS snippets -|`graphql→`|`import { compose, graphql } from 'react-apollo'`| +JavaScript and React/Redux snippets in ES7+ with Babel plugin features for [VS Code](https://code.visualstudio.com/) -### `expgql` +## Installation -```js -export default compose(graphql($1, { name: $2 }))($3) -``` - -## Console - -| Prefix | Method | -| -----: | ----------------------------------- | -| `clg→` | `console.log(object)` | -| `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` | +### Visual Studio Marketplace -## React Components +Launch _Quick Open_: -### `rcc` +- [_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` -```javascript -import React, { Component } from 'react' +Paste the following command and press `Enter`: -export default class $1 extends Component { - render() { - return
$2
- } -} +```shell +ext install dsznajder.es7-react-js-snippets ``` -### `rce` - -```javascript -import React, { Component } from 'react' - -export class $1 extends Component { - render() { - return
$2
- } -} - -export default $1 -``` +## Options -### `rcep` +From version 4 extension provides options to customize the behavior of the snippets: -```javascript -import React, { Component } from 'react' -import PropTypes from 'prop-types' +| 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 | -export class $1 extends Component { - static propTypes = {} +# Sponsors - render() { - return
$2
- } -} +


+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

-export default $1 -``` +
-### `rpc` +### Conquer of Completion -```javascript -import React, { PureComponent } from 'react' +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` -export default class $1 extends PureComponent { - render() { - return
$2
- } -} +```shell +Plug 'dsznajder/vscode-es7-javascript-react-snippets', { 'do': 'yarn install --frozen-lockfile && yarn compile' } ``` -### `rpcp` +Update your vim / neovim settings with `:source %` and then install the new package with `:PlugInstall` -```javascript -import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' +Note: This example uses `vim-plug` as a package manager, feel free to use some other -export default class $1 extends PureComponent { - static propTypes = {} +
- render() { - return
$2
- } -} -``` +### Packer -### `rccp` +For use with packer the syntax is a little different. Just add in your `init.vim` or `init.lua`: -```javascript -import React, { Component } from 'react' -import PropTypes from 'prop-types' - -export default class $1 extends Component { - static propTypes = { - $2: $3, - } - - render() { - return
$4
- } +```shell +use {'dsznajder/vscode-es7-javascript-react-snippets', +run = 'yarn install --frozen-lockfile && yarn compile' } ``` -### `rfe` +When saving the file, the update will be done ( `:w` ) -```javascript -import React from 'react' +
-const $1 = props => { - return
$0
-} +## Search command -export default $1 -``` +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. -### `rfep` - -```javascript -import React from 'react' -import PropTypes from 'prop-types' - -const $1 = props => { - return
$0
-} - -$1.propTypes = {} - -export default $1 -``` - -### `rfc` - -```javascript -import React from 'react' - -export default () => { - return
$0
-} -``` - -### `rfcp` - -```javascript -import React from 'react' -import PropTypes from 'prop-types' - -export default () => { - return
$0
-} - -$1.propTypes = {} -``` - -### `rcredux` - -```javascript -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import { connect } from 'react-redux' - -export class $1 extends Component { - static propTypes = { - $2: $3, - } - - render() { - return
$4
- } -} - -const mapStateToProps = state => ({}) - -const mapDispatchToProps = {} - -export default connect(mapStateToProps, mapDispatchToProps)($1) -``` - -### `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 $1 extends Component { - render() { - return ( - - $2 - - ) - } -} -``` - -### `rnce` - -```javascript -import React, { Component } from 'react' -import { Text, View } from 'react-native' - -export class $1 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' - -export class $1 extends Component { - static propTypes = { - $2: $3, - } - - render() { - return ( - - $2 - - ) - } -} - -const mapStateToProps = state => ({}) - -const mapDispatchToProps = {} - -export default connect(mapStateToProps, mapDispatchToProps)($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 { ${1:ComponentName }, mapStateToProps, mapDispatchToProps } from '${2:path}/${1:ComponentName}' - -describe('<${1:ComponentName} />', () => { - const defaultProps = { - - } - - const setup = buildSetup(${1:ComponentName }, defaultProps) - - test('render', () => { - expect(setup().wrapper).toMatchSnapshot() - }) -}) -``` - -### `sjtest` - -```javascript -import toJson from 'enzyme-to-json' -import { ${1:ComponentName} }, mapStateToProps, mapDispatchToProps } from '${2:path}/${1:ComponentName}' - -describe('<${1:ComponentName} />', () => { - const defaultProps = { - - } - - const setup = buildSetup(${1:ComponentName }, defaultProps) - - test('render', () => { - expect(toJson(setup().wrapper)).toMatchSnapshot() - }) -}) -``` - -### `sntest` - -```javascript -import 'react-native' -import React from 'react' -import renderer from 'react-test-renderer' - -import ${1:ComponentName} from '../${1:ComponentName}' - -describe('<${1:ComponentName} />', () => { - const defaultProps = { - - } - - const wrapper = renderer.create(<${1:ComponentName} {...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:hocComponentName} = (WrappedComponent) => { - const hocComponent = ({ ...props }) => - - hocComponent.propTypes = { - } - - return hocComponent -} - -export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent)) -``` - -### `hoc` - -```javascript -import React from 'react' -import PropTypes from 'prop-types' - -export default WrappedComponent => { - const hocComponent = ({ ...props }) => +Here is direct link to marketplace [ES7 React/Redux/React-Native/JS Snippets](https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets) - hocComponent.propTypes = {} +
- return hocComponent -} -``` +## [Snippets](./docs/Snippets.md) diff --git a/docs/Snippets.md b/docs/Snippets.md new file mode 100644 index 0000000..135e201 --- /dev/null +++ b/docs/Snippets.md @@ -0,0 +1,734 @@ +# 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'` | +| `est→` | `this.state = { }` | +| `cdm→` | `componentDidMount = () => { }` | +| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` | +| `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 5e995ea..12df135 100644 --- a/package.json +++ b/package.json @@ -1,39 +1,162 @@ { - "name": "es7-react-js-snippets", - "displayName": "ES7 React/Redux/GraphQL/React-Native snippets", - "description": "Simple extensions for React, Redux and Graphql in JS with ES7 syntax", - "version": "1.3.2", - "publisher": "dsznajder", - "icon": "images/logo.png", - "keywords": [ - "snippets", - "react", - "redux", - "react-native", - "graphql", - "javascript" + "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.3", + "publisher": "dsznajder", + "icon": "images/logo.png", + "browser": "./lib/index.js", + "main": "./lib/index.js", + "keywords": [ + "snippets", + "react", + "redux", + "react-native", + "customizable", + "javascript", + "typescript", + "prettier" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/dsznajder/vscode-es7-javascript-react-snippets" + }, + "engines": { + "vscode": "^1.60.0" + }, + "categories": [ + "Snippets" + ], + "extensionKind": [ + "ui", + "workspace" + ], + "capabilities": { + "virtualWorkspaces": true, + "untrustedWorkspaces": { + "supported": true + } + }, + "activationEvents": [ + "onLanguage:typescript", + "onLanguage:typescriptReact", + "onLanguage:javascript", + "onLanguage:javascriptReact", + "onCommand:reactSnippets.search", + "onStartupFinished" + ], + "contributes": { + "commands": [ + { + "command": "reactSnippets.search", + "title": "Snippet search" + } ], - "engines": { - "vscode": "^1.13.0" - }, - "license": "SEE LICENSE", - "repository": { - "type": "git", - "url": "https://github.com/dsznajder/vscode-es7-javascript-react-snippets" - }, - "categories": [ - "Snippets" + "keybindings": [ + { + "command": "reactSnippets.search", + "key": "ctrl+alt+r", + "mac": "shift+cmd+r", + "when": "editorTextFocus" + } ], - "contributes": { - "snippets": [ - { - "language": "javascript", - "path": "./snippets/snippets.json" - }, - { - "language": "javascriptreact", - "path": "./snippets/snippets.json" - } - ] - } -} \ No newline at end of file + "configuration": { + "title": "ES React/React-Native/Redux snippets", + "properties": { + "reactSnippets.settings.prettierEnabled": { + "type": "boolean", + "markdownDescription": "[EXPERIMENTAL: MIGHT NOT WORK]: Integrate prettier settings with code generated from snippets.", + "default": false + }, + "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 + }, + "reactSnippets.settings.typescript": { + "type": "boolean", + "markdownDescription": "Controls if React components have typescript Props typing.", + "default": true + }, + "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.typescriptPropsStatePrefix": { + "type": "string", + "markdownDescription": "Controls which prefix for typescript snippets should use for props/state.", + "default": "type", + "enum": [ + "type", + "interface" + ] + } + } + }, + "snippets": [ + { + "language": "javascript", + "path": "./lib/snippets/generated.json" + }, + { + "language": "javascriptreact", + "path": "./lib/snippets/generated.json" + }, + { + "language": "typescript", + "path": "./lib/snippets/generated.json" + }, + { + "language": "typescriptreact", + "path": "./lib/snippets/generated.json" + } + ] + }, + "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" + }, + "dependencies": { + "prettier": "2.5.1" + }, + "peerDependencies": { + "prettier": "^2" + }, + "devDependencies": { + "@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.60.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.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.5" + }, + "prettier": { + "bracketSameLine": false, + "bracketSpacing": true, + "printWidth": 80, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": false, + "endOfLine": "auto" + } +} diff --git a/snippets/snippets.json b/snippets/snippets.json deleted file mode 100644 index ddfafc8..0000000 --- a/snippets/snippets.json +++ /dev/null @@ -1,959 +0,0 @@ -{ - // ========================================================================================================================== - // BASIC ES7 JS - "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}) => {", " $0", "}", ""], - "description": "Export named function in ES7 syntax" - }, - "exportDefaultFunction": { - "prefix": "edf", - "body": ["export default (${1:params}) => {", " $0", "}", ""], - "description": "Export default function in ES7 syntax" - }, - "method": { - "prefix": "met", - "body": ["${1:methodName} = (${2:params}) => {", " ${0}", "}", ""], - "description": "Creates a method inside a class in ES7 syntax" - }, - "propertyGet": { - "prefix": "pge", - "body": ["get ${1:propertyName} = () => {", " return this.${0}", "}", ""], - "description": "Creates a getter property inside a class in ES7 syntax" - }, - "propertyset": { - "prefix": "pse", - "body": ["set ${1:propertyName} = (${2:value}) => {", " ${0}", "}", ""], - "description": "Creates a setter property inside a class in ES7 syntax" - }, - "forEach": { - "prefix": "fre", - "body": ["${1:array}.forEach(${2:currentItem} => {", " ${0}", "})", ""], - "description": "Creates a forEach statement in ES7 syntax" - }, - "forOf": { - "prefix": "fof", - "body": ["for(let ${1:item} of ${2:object}) {", " ${0}", "}", ""], - "description": "Iterating over property names of iterable objects" - }, - "forIn": { - "prefix": "fin", - "body": ["for(let ${1:item} in ${2:object}) {", " ${0}", "}", ""], - "description": "Iterating over property values of iterable objects" - }, - "anonymousFunction": { - "prefix": "anfn", - "body": ["(${1:params}) => {", " ${2}", "}", ""], - "description": "Creates an anonymous function in ES7 syntax" - }, - "namedFunction": { - "prefix": "nfn", - "body": ["const ${1:name} = (${2:params}) => {", " ${3}", "}", ""], - "description": "Creates a named function in ES7 syntax" - }, - "destructingObject": { - "prefix": "dob", - "body": "const {${1:propertyName}} = ${2:objectToDestruct}", - "description": "Creates and assigns a local variable using object destructing" - }, - "destructingArray": { - "prefix": "dar", - "body": "const [${1:propertyName}] = ${2:arrayToDestruct}", - "description": "Creates and assigns a local variable using array destructing" - }, - "setInterval": { - "prefix": "sti", - "body": ["setInterval(() => {", " ${2}", "}, ${0:intervalInms})", ""], - "description": "Executes the given function at specified intervals in ES7 syntax" - }, - "setTimeOut": { - "prefix": "sto", - "body": ["setTimeout(() => {", " ${2}", "}, ${1:delayInms})", ""], - "description": "Executes the given function after the specified delay in ES7 syntax" - }, - "promise": { - "prefix": "prom", - "body": ["return new Promise((resolve, reject) => {", " ${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" - }, - "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" - }, - // ========================================================================================================================== - // React - "import React": { - "prefix": "imr", - "body": ["import React from 'react'", ""] - }, - "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 redux statement": { - "prefix": "redux", - "body": ["import { connect } from 'react-redux'", ""] - }, - "reactClassCompoment": { - "prefix": "rcc", - "body": [ - "import React, { Component } from 'react'", - "", - "export default class ${1:componentName} extends Component {", - " render() {", - " return (", - "
", - " $0", - "
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactClassExportComponent": { - "prefix": "rce", - "body": [ - "import React, { Component } from 'react'", - "", - "export class ${1:componentName} extends Component {", - " render() {", - " return (", - "
", - " $0", - "
", - " )", - " }", - "}", - "", - "export default ${1:componentName}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactFunctionalExportComponent": { - "prefix": "rfe", - "body": [ - "import React from 'react'", - "", - "const ${1:componentName} = () => {", - " return (", - "
", - " $0", - "
", - " )", - "}", - "", - "export default ${1:componentName}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system" - }, - "reactFunctionalExportComponentWithPropTypes": { - "prefix": "rfep", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "const ${1:componentName} = () => {", - " return (", - "
", - " $0", - "
", - " )", - "}", - "", - "${1:componentName}.propTypes = {", - "", - "}", - "", - "export default ${1:componentName}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system with PropTypes" - }, - "reactFunctionalComponent": { - "prefix": "rfc", - "body": [ - "import React from 'react'", - "", - "export default () => {", - " return (", - "
", - " $0", - "
", - " )", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system" - }, - "reactFunctionalComponentWithPropTypes": { - "prefix": "rfcp", - "body": [ - "import React from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default () => {", - " return (", - "
", - " $0", - "
", - " )", - "}", - "", - "${1:componentName}.propTypes = {", - "", - "}", - "" - ], - "description": "Creates a React Functional Component with ES7 module system with PropTypes" - }, - "reactClassExportComponentWithPropTypes": { - "prefix": "rcep", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "", - "export class ${1:componentName} extends Component {", - " static propTypes = {", - "", - " }", - "", - " render() {", - " return (", - "
", - " $0", - "
", - " )", - " }", - "}", - "", - "export default ${1:componentName}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactClassPureComponent": { - "prefix": "rpc", - "body": [ - "import React, { PureComponent } from 'react'", - "", - "export default class ${1:componentName} extends PureComponent {", - " render() {", - " return (", - "
", - " $0", - "
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactClassPureComponentWithPropTypes": { - "prefix": "rpcp", - "body": [ - "import React, { PureComponent } from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default class ${1:componentName} extends PureComponent {", - " static propTypes = {", - "", - " }", - "", - " render() {", - " return (", - "
", - " $0", - "
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with ES7 module system" - }, - "reactClassCompomentPropTypes": { - "prefix": "rccp", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "", - "export default class ${1:componentName} extends Component {", - " static propTypes = {", - " ${2:prop}: ${3:PropTypes}", - " }", - "", - " render() {", - " return (", - "
", - " $0", - "
", - " )", - " }", - "}", - "" - ], - "description": "Creates a React component class with PropTypes and ES7 module system" - }, - "reactClassCompomentRedux": { - "prefix": "rcredux", - "body": [ - "import React, { Component } from 'react'", - "import PropTypes from 'prop-types'", - "import { connect } from 'react-redux'", - "", - "export class ${1:componentName} extends Component {", - " static propTypes = {", - " ${2:prop}: ${3:PropTypes}", - " }", - "", - " render() {", - " return (", - "
", - " $0", - "
", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({", - " ", - "})", - "", - "const mapDispatchToProps = {", - " ", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:componentName})", - "" - ], - "description": - "Creates a React component class with PropTypes with connected redux and ES7 module system" - }, - "mappingToProps": { - "prefix": "reduxmap", - "body": [ - "const mapStateToProps = (state) => ({", - " ${1}", - "})", - "", - "const mapDispatchToProps = {", - " ", - "}", - "" - ] - }, - "classConstructor": { - "prefix": "rconst", - "body": [ - "constructor(props) {", - " super(props)", - "", - " this.state = {", - " $0", - " }", - "}", - "" - ], - "description": - "Adds a default constructor for it('', () => {})the class that contains props as arguments" - }, - "emptyState": { - "prefix": "est", - "body": ["this.state = {", " $1", "}", ""], - "description": "Creates empty state object. To be used in a constructor." - }, - "componentWillMount": { - "prefix": "cwm", - "body": ["componentWillMount = () => {", " $0", "}", ""], - "description": - "Invoked once, both on the client and server, immediately before the initial rendering occurs" - }, - "componentDidMount": { - "prefix": "cdm", - "body": ["componentDidMount = () => {", " $0", "}", ""], - "description": - "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs." - }, - "componentWillReceiveProps": { - "prefix": "cwr", - "body": ["componentWillReceiveProps = (nextProps) => {", " $0", "}", ""], - "description": - "Invoked when a component is receiving new props. This method is not called for the initial render." - }, - "shouldComponentUpdate": { - "prefix": "scu", - "body": ["shouldComponentUpdate = (nextProps, nextState) => {", " $0", "}", ""], - "description": "Invoked before rendering when new props or state are being received. " - }, - "componentWillUpdate": { - "prefix": "cwup", - "body": ["componentWillUpdate = (nextProps, nextState) => {", " $0", "}", ""], - "description": - "Invoked immediately before rendering when new props or state are being received." - }, - "componentDidUpdate": { - "prefix": "cdup", - "body": ["componentDidUpdate = (prevProps, prevState) => {", " $0", "}", ""], - "description": "Invoked immediately after the component's updates are flushed to the DOM." - }, - "componentWillUnmount": { - "prefix": "cwun", - "body": ["componentWillUnmount = () => {", " $0", "}", ""], - "description": "Invoked immediately before a component is unmounted from the DOM." - }, - "componentRender": { - "prefix": "ren", - "body": ["render() {", " return (", "
", " $0", "
", " )", "}"], - "description": "Basic render." - }, - "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" - }, - // ========================================================================================================================== - // Redux - "reduxAction": { - "prefix": "rxaction", - "body": [ - "export const ${1:actionName} = (${2:param}) => ({", - " type: ${3:type},", - " payload: ${4:payload}", - "})", - "" - ] - }, - "reduxConst": { - "prefix": "rxconst", - "body": "export const ${1:constantName} = '${1:constantName}'" - }, - "reduxReducer": { - "prefix": "rxreducer", - "body": [ - "const initialState = {", - "", - "}", - "", - "export default (state = initialState, action) => {", - " switch (action.type) {", - "", - " case ${1:typeName}:", - " return { ...state }", - "", - " default:", - " return state", - " }", - "}", - "" - ] - }, - "reduxSelector": { - "prefix": "rxselect", - "body": [ - "import { createSelector } from 'reselect'", - "", - "export const ${1:selectorName} = state => state.${2:selector}", - "" - ] - }, - // ========================================================================================================================== - // React Native - "reactNativeComponent": { - "prefix": "rnc", - "body": [ - "import React, { Component } from 'react'", - "import { Text, View } from 'react-native'", - "", - "export default class ${1:componentName} extends Component {", - " render() {", - " return (", - " ", - " ${2:textInComponent} ", - " ", - " )", - " }", - "}" - ] - }, - "reactNativeComponentExport": { - "prefix": "rnce", - "body": [ - "import React, { Component } from 'react'", - "import { Text, View } from 'react-native'", - "", - "export class ${1:componentName} extends Component {", - " render() {", - " return (", - " ", - " ${2:textInComponent} ", - " ", - " )", - " }", - "}", - "", - "export default ${1:componentName}" - ] - }, - "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:componentName} extends Component {", - " static propTypes = {", - " ${2:prop}: ${3:PropTypes}", - " }", - "", - " render() {", - " return (", - " ", - " ${2:textInComponent} ", - " ", - " )", - " }", - "}", - "", - "const mapStateToProps = (state) => ({", - " ", - "})", - "", - "const mapDispatchToProps = {", - " ", - "}", - "", - "export default connect(mapStateToProps, mapDispatchToProps)(${1:componentName})", - "" - ], - "description": - "Creates a React Native component class with PropTypes with connected redux and ES7 module system" - }, - "reactNativeImport": { - "prefix": "imrn", - "body": "import { ${1:moduleName} } from 'react-native'" - }, - // ========================================================================================================================== - // PropTypes - "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([", " $0", "]),"], - "description": "An object that could be one of many types" - }, - "propTypeOneOfTypeRequired": { - "prefix": "ptetr", - "body": ["PropTypes.oneOfType([", " $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": "AcomponentNamen 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({", " $0", "}),"], - "description": "An object taking on a particular shape" - }, - "propTypeShapeRequired": { - "prefix": "ptshr", - "body": ["PropTypes.shape({", " $0", "}).isRequired,"], - "description": "An object taking on a particular shape required" - }, - "staticPropTpyes": { - "prefix": "ptypes", - "body": ["static propTypes = {", "", "}", ""] - }, - // ========================================================================================================================== - // Comments - "Comment Big Block": { - "prefix": "cmmb", - "body": [ - "/**", - "|--------------------------------------------------", - "| $1", - "|--------------------------------------------------", - "*/" - ] - }, - // ========================================================================================================================== - // Testing - "describeBlock": { - "prefix": "desc", - "body": ["describe('$1', () => {", " $0", "})", ""], - "description": "Testing `describe` block" - }, - "testBlock": { - "prefix": "test", - "body": ["test('should $1', () => {", " $0", "})", ""], - "description": "Testing `test` block" - }, - "itBlock": { - "prefix": "tit", - "body": ["it('should $1', () => {", " $0", "})", ""], - "description": "Testing `it` block" - }, - "setupTest": { - "prefix": "stest", - "body": [ - "import { ${1:ComponentName}, mapStateToProps, mapDispatchToProps } from '../${1:ComponentName}'", - "", - "describe('<${1:ComponentName} />', () => {", - " const defaultProps = {", - "", - " }", - "", - " const setup = buildSetup(${1:ComponentName}, defaultProps)", - "", - " test('render', () => {", - " expect(setup().wrapper).toMatchSnapshot()", - " })", - "})", - "" - ] - }, - "setupTestWithEnzymeToJson": { - "prefix": "sjtest", - "body": [ - "import toJson from 'enzyme-to-json'", - "import { ${1:ComponentName}, mapStateToProps, mapDispatchToProps } from '../${1:ComponentName}'", - "", - "describe('<${1:ComponentName} />', () => {", - " const defaultProps = {", - "", - " }", - "", - " const setup = buildSetup(${1:ComponentName}, defaultProps)", - "", - " test('render', () => {", - " expect(toJson(setup().wrapper)).toMatchSnapshot()", - " })", - "})", - "" - ] - }, - "setupReactNativeTest": { - "prefix": "sntest", - "body": [ - "import 'react-native'", - "import React from 'react'", - "import renderer from 'react-test-renderer'", - "", - "import ${1:ComponentName} from '../${1:ComponentName}'", - "", - "describe('<${1:ComponentName} />', () => {", - " const defaultProps = {", - "", - " }", - "", - " const wrapper = renderer.create(<${1:ComponentName} {...defaultProps />)", - "", - " test('render', () => {", - " expect(wrapper).toMatchSnapshot()", - " })", - "})", - "" - ] - }, - // ========================================================================================================================== - // GraphQL - "graphQLForComponent": { - "prefix": "graphql", - "body": ["import { compose, graphql } from 'react-apollo'", ""] - }, - "exportGraphQL": { - "prefix": "expgql", - "body": [ - "export default compose(", - " graphql(${1:queryOrMutation}, { name: ${2:name} }),", - ")(${3:ComponentName})" - ] - }, - // ========================================================================================================================== - // Other - "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) => {", - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {", - " }", - "", - " return 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) => {", - " const hocComponent = ({ ...props }) => ", - "", - " hocComponent.propTypes = {", - " }", - "", - " return hocComponent", - "}", - "" - ] - } -} diff --git a/src/helpers/extensionConfig.ts b/src/helpers/extensionConfig.ts new file mode 100644 index 0000000..5301a46 --- /dev/null +++ b/src/helpers/extensionConfig.ts @@ -0,0 +1,16 @@ +import { workspace } from 'vscode'; + +export type ExtensionSettings = { + languageScopes: string; + prettierEnabled: boolean; + importReactOnTop: boolean; + typescript: boolean; + 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/helpers/generateSnippets.ts b/src/helpers/generateSnippets.ts new file mode 100644 index 0000000..579dbde --- /dev/null +++ b/src/helpers/generateSnippets.ts @@ -0,0 +1,94 @@ +import { writeFile } from 'fs'; + +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'; +import propTypesSnippets, { + PropTypesSnippet, +} 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'; + +import extensionConfig from './extensionConfig'; +import parseSnippetToBody from './parseSnippetToBody'; +import { replaceSnippetPlaceholders } from './snippetPlaceholders'; + +export type SnippetKeys = + | OthersSnippet['key'] + | HooksSnippet['key'] + | ImportsSnippet['key'] + | ReactNativeSnippet['key'] + | TypescriptSnippet['key'] + | ReduxSnippet['key'] + | ComponentsSnippet['key'] + | ConsoleSnippet['key'] + | PropTypesSnippet['key'] + | TestsSnippet['key']; + +export type Snippet = + | OthersSnippet + | HooksSnippet + | ImportsSnippet + | ReactNativeSnippet + | TypescriptSnippet + | ReduxSnippet + | ComponentsSnippet + | ConsoleSnippet + | PropTypesSnippet + | TestsSnippet; + +export type Snippets = { + [key in SnippetKeys]: Snippet; +}; + +const getSnippets = () => { + const { typescript, languageScopes } = extensionConfig(); + + const snippets = [ + ...(typescript ? typescriptSnippets : []), + ...componentsSnippets, + ...consoleSnippets, + ...hooksSnippets, + ...importsSnippets, + ...propTypesSnippets, + ...reactNativeSnippets, + ...reduxSnippets, + ...testsSnippets, + ...othersSnippets, + ].reduce((acc, snippet) => { + acc[snippet.key] = Object.assign(snippet, { + body: parseSnippetToBody(snippet), + scope: languageScopes, + }); + return acc; + }, {} as Snippets); + + return replaceSnippetPlaceholders(JSON.stringify(snippets, null, 2)); +}; + +const generateSnippets = () => + new Promise((resolve) => { + const jsonSnippets = getSnippets(); + 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..30fc1bd --- /dev/null +++ b/src/helpers/getPrettierConfig.ts @@ -0,0 +1,19 @@ +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 { prettierEnabled } = extensionConfig(); + + return { + parser: 'typescript', + ...(prettierEnabled && prettierConfig), + }; +}; + +export default getPrettierConfig; diff --git a/src/helpers/parseSnippetToBody.ts b/src/helpers/parseSnippetToBody.ts new file mode 100644 index 0000000..b8a7e7e --- /dev/null +++ b/src/helpers/parseSnippetToBody.ts @@ -0,0 +1,23 @@ +import extensionConfig from './extensionConfig'; +import { formatSnippet } from './formatters'; +import { Snippet } from './generateSnippets'; +import replaceOrRemoveReactImport from './replaceOrRemoveReactImport'; + +const parseSnippetToBody = (snippet: Snippet) => { + const { importReactOnTop } = extensionConfig(); + const body = + typeof snippet.body === 'string' ? snippet.body : snippet.body.join('\n'); + + const snippetBody = importReactOnTop + ? body + : replaceOrRemoveReactImport({ + prefix: snippet.prefix, + body: snippet.body, + }); + + const formattedSnippet = formatSnippet(snippetBody).split('\n'); + + return formattedSnippet; +}; + +export default parseSnippetToBody; diff --git a/src/helpers/replaceOrRemoveReactImport.ts b/src/helpers/replaceOrRemoveReactImport.ts new file mode 100644 index 0000000..74d4e51 --- /dev/null +++ b/src/helpers/replaceOrRemoveReactImport.ts @@ -0,0 +1,64 @@ +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 = 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 bodyCopy.join('\n'); +}; + +export default replaceOrRemoveReactImport; diff --git a/src/helpers/snippetPlaceholders.ts b/src/helpers/snippetPlaceholders.ts new file mode 100644 index 0000000..5896a82 --- /dev/null +++ b/src/helpers/snippetPlaceholders.ts @@ -0,0 +1,43 @@ +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.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(/\${1\/(.*)\/${1:\/capitalize}\/}/, 'g'), + Placeholders.Capitalize, + ); +}; +export default revertSnippetPlaceholders; diff --git a/src/helpers/snippetSearch.ts b/src/helpers/snippetSearch.ts new file mode 100644 index 0000000..bb2855a --- /dev/null +++ b/src/helpers/snippetSearch.ts @@ -0,0 +1,41 @@ +import { readFileSync } from 'fs'; +import { SnippetString, window } from 'vscode'; + +import { parseSnippet } from './formatters'; +import { Snippet } from './generateSnippets'; + +const snippetSearch = async () => { + const { showQuickPick, activeTextEditor } = window; + + 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 }]) => ({ + body, + description: description || shortDescription, + label, + }), + ); + + const rawSnippet = await showQuickPick(items, { + matchOnDescription: true, + matchOnDetail: true, + placeHolder: 'Search snippet by prefix or description', + }); + + const body = rawSnippet ? parseSnippet(rawSnippet.body) : ''; + + if (activeTextEditor) { + activeTextEditor.insertSnippet(new SnippetString(body)); + } +}; + +export default snippetSearch; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..a111de3 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,47 @@ +import { + commands, + ConfigurationChangeEvent, + ExtensionContext, + window, + workspace, +} from 'vscode'; + +import generateSnippets from './helpers/generateSnippets'; +import snippetSearch from './helpers/snippetSearch'; +import generatedSnippets from './snippets/generated.json'; + +const showRestartMessage = async ({ + affectsConfiguration, +}: ConfigurationChangeEvent) => { + if (affectsConfiguration('reactSnippets')) { + await generateSnippets(); + 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); + } +}; + +export async function activate(context: ExtensionContext) { + workspace.onDidChangeConfiguration(showRestartMessage); + if (JSON.stringify(generatedSnippets).length < 10) { + await generateSnippets(); + } + const snippetSearchCommand = commands.registerCommand( + 'reactSnippets.search', + snippetSearch, + ); + + context.subscriptions.push(snippetSearchCommand); +} + +export function deactivate() {} diff --git a/src/snippets/generated.json b/src/snippets/generated.json new file mode 100644 index 0000000..d73bea5 --- /dev/null +++ b/src/snippets/generated.json @@ -0,0 +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" + } +} diff --git a/src/sourceSnippets/components.ts b/src/sourceSnippets/components.ts new file mode 100644 index 0000000..09ef578 --- /dev/null +++ b/src/sourceSnippets/components.ts @@ -0,0 +1,365 @@ +import { Placeholders, SnippetMapping } from '../types'; + +import { + exportDefault, + innerComponent, + innerComponentReturn, + react, + reactComponent, + reactComponentWithReduxConnect, + reactPropTypes, + reactPureComponent, + reactWithMemo, + reactWithReduxConnect, + reduxComponentExport, +} 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'; +}; + +export type ComponentsSnippet = SnippetMapping; + +const reactClassComponent: ComponentsSnippet = { + key: 'reactClassComponent', + prefix: 'rcc', + body: [ + ...reactComponent, + '', + `export default class ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.FileName}() {`, + ...innerComponent, + '}', + '', + ], + description: 'Creates a React Functional Component with ES7 module system', +}; + +const reactFunctionalComponentWithPropTypes: ComponentsSnippet = { + key: 'reactFunctionalComponentWithPropTypes', + prefix: 'rfcp', + body: [ + ...reactPropTypes, + '', + `function ${Placeholders.FileName}(props) {`, + ...innerComponent, + '}', + '', + `${Placeholders.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 ${Placeholders.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 ${Placeholders.FileName} = () => {`, + ...innerComponent, + '}', + '', + ], + description: + 'Creates a React Arrow Function Component with ES7 module system', +}; + +const reactArrowFunctionComponentWithPropTypes: ComponentsSnippet = { + key: 'reactArrowFunctionComponentWithPropTypes', + prefix: 'rafcp', + body: [ + ...reactPropTypes, + '', + `const ${Placeholders.FileName} = props => {`, + ...innerComponent, + '}', + '', + `${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.FileName} extends PureComponent {`, + ' static propTypes = {}', + '', + ...innerComponentReturn, + '}', + '', + ], + description: 'Creates a React component class with ES7 module system', +}; + +const reactFunctionMemoComponent: ComponentsSnippet = { + key: 'reactFunctionMemoComponent', + prefix: 'rmc', + body: [ + ...reactWithMemo, + '', + `const ${Placeholders.FileName} = memo(() => {`, + ...innerComponent, + '})', + ...exportDefault, + ], + 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 ${Placeholders.FileName} = memo((props) => {`, + ...innerComponent, + '})', + '', + `${Placeholders.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 ${Placeholders.FileName} extends Component {`, + ` static propTypes = {${Placeholders.SecondTab}: ${Placeholders.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 ${Placeholders.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 ${Placeholders.FileName} extends Component {`, + ' static propTypes = {', + ` ${Placeholders.SecondTab}: ${Placeholders.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 ${Placeholders.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 ${Placeholders.FileName} = (props) => {`, + ...innerComponent, + '}', + '', + `${Placeholders.FileName}.propTypes = {`, + ` ${Placeholders.SecondTab}: PropTypes.${Placeholders.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..dec49de --- /dev/null +++ b/src/sourceSnippets/console.ts @@ -0,0 +1,162 @@ +import { Placeholders, 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'; + consoleTable: 'ctl'; +}; + +export type ConsoleSnippet = SnippetMapping; + +const consoleAssert: ConsoleSnippet = { + key: 'consoleAssert', + prefix: 'cas', + 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', +}; + +const consoleClear: ConsoleSnippet = { + key: 'consoleClear', + prefix: 'ccl', + body: ['console.clear()'], + description: 'Clears the console', +}; + +const consoleCount: ConsoleSnippet = { + key: 'consoleCount', + prefix: 'cco', + 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', +}; + +const consoleDir: ConsoleSnippet = { + key: 'consoleDir', + prefix: 'cdi', + body: [`console.dir(${Placeholders.FirstTab})`], + description: 'Prints a JavaScript representation of the specified object', +}; + +const consoleError: ConsoleSnippet = { + key: 'consoleError', + prefix: 'cer', + body: [`console.error(${Placeholders.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('${Placeholders.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(${Placeholders.FirstTab})`], + description: 'Displays a message in the console', +}; + +const consoleTrace: ConsoleSnippet = { + key: 'consoleTrace', + prefix: 'ctr', + body: [`console.trace(${Placeholders.FirstTab})`], + description: + 'Prints a stack trace from the point where the method was called', +}; + +const consoleLogObject: ConsoleSnippet = { + key: 'consoleLogObject', + prefix: 'clo', + body: [`console.log('${Placeholders.FirstTab}', ${Placeholders.FirstTab})`], + description: 'Logs property with name.', +}; + +const consoleLogJson: ConsoleSnippet = { + key: 'consoleLogJson', + prefix: 'clj', + body: [ + `console.log('${Placeholders.FirstTab}', JSON.stringify(${Placeholders.FirstTab}, null, 2))`, + ], + description: 'Logs stringified JSON property with name.', +}; + +const consoleTime: ConsoleSnippet = { + key: 'consoleTime', + prefix: 'ctm', + body: [`console.time('${Placeholders.FirstTab}')`], + description: 'Console time wrapper', +}; + +const consoleTimeEnd: ConsoleSnippet = { + key: 'consoleTimeEnd', + prefix: 'cte', + body: [`console.timeEnd('${Placeholders.FirstTab}')`], + description: 'Console time end wrapper', +}; + +const consoleWarn: ConsoleSnippet = { + key: 'consoleWarn', + prefix: 'cwa', + body: [`console.warn(${Placeholders.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(${Placeholders.FirstTab})`], + description: + '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, + consoleCount, + consoleDir, + consoleError, + consoleGroup, + consoleGroupEnd, + consoleLog, + consoleTrace, + consoleLogObject, + consoleLogJson, + consoleTime, + consoleTimeEnd, + consoleWarn, + consoleInfo, + consoleTable, +]; diff --git a/src/sourceSnippets/hooks.ts b/src/sourceSnippets/hooks.ts new file mode 100644 index 0000000..d8a0377 --- /dev/null +++ b/src/sourceSnippets/hooks.ts @@ -0,0 +1,122 @@ +import { Placeholders, SnippetMapping } from '../types'; + +type HookMappings = { + useState: 'useStateSnippet'; + useCallback: 'useCallbackSnippet'; + useContext: 'useContextSnippet'; + useEffect: 'useEffectSnippet'; + useImperativeHandle: 'useImperativeHandleSnippet'; + useLayoutEffect: 'useLayoutEffectSnippet'; + useMemo: 'useMemoSnippet'; + useReducer: 'useReducerSnippet'; + useRef: 'useRefSnippet'; +}; + +export type HooksSnippet = SnippetMapping; + +const useEffect: HooksSnippet = { + key: 'useEffect', + prefix: 'useEffectSnippet', + body: [ + 'useEffect(() => {', + ` ${Placeholders.FirstTab}`, + '', + ' return () => {', + ` ${Placeholders.SecondTab}`, + ' }', + `}, [${Placeholders.ThirdTab}])`, + '', + ], +}; + +const useContext: HooksSnippet = { + key: 'useContext', + prefix: 'useContextSnippet', + body: [ + `const ${Placeholders.FirstTab} = useContext(${Placeholders.SecondTab})`, + ], +}; + +const useState: HooksSnippet = { + key: 'useState', + prefix: 'useStateSnippet', + body: [ + `const [${Placeholders.FirstTab}, set${Placeholders.Capitalize}] = useState(${Placeholders.SecondTab})`, + ], +}; + +const useReducer: HooksSnippet = { + key: 'useReducer', + prefix: 'useReducerSnippet', + body: [ + `const [state, dispatch] = useReducer(${Placeholders.FirstTab}, ${Placeholders.SecondTab}, ${Placeholders.ThirdTab})`, + ], +}; + +const useCallback: HooksSnippet = { + key: 'useCallback', + prefix: 'useCallbackSnippet', + body: [ + 'useCallback(', + ' () => {', + ` ${Placeholders.FirstTab}`, + ' },', + ` [${Placeholders.SecondTab}],`, + ')', + '', + ], +}; + +const useMemo: HooksSnippet = { + key: 'useMemo', + prefix: 'useMemoSnippet', + body: [ + `useMemo(() => ${Placeholders.FirstTab}, [${Placeholders.SecondTab}])`, + ], +}; + +const useRef: HooksSnippet = { + key: 'useRef', + prefix: 'useRefSnippet', + body: [`const ${Placeholders.FirstTab} = useRef(${Placeholders.SecondTab})`], +}; + +const useImperativeHandle: HooksSnippet = { + key: 'useImperativeHandle', + prefix: 'useImperativeHandleSnippet', + body: [ + 'useImperativeHandle(', + ` ${Placeholders.FirstTab},`, + ' () => {', + ` ${Placeholders.SecondTab}`, + ' },', + ` [${Placeholders.ThirdTab}],`, + ')', + ], +}; + +const useLayoutEffect: HooksSnippet = { + key: 'useLayoutEffect', + prefix: 'useLayoutEffectSnippet', + body: [ + 'useLayoutEffect(() => {', + ` ${Placeholders.FirstTab}`, + '', + ' return () => {', + ` ${Placeholders.SecondTab}`, + ' };', + `}, [${Placeholders.ThirdTab}])`, + ], +}; + +export default [ + useCallback, + useContext, + useEffect, + useImperativeHandle, + useLayoutEffect, + useMemo, + useReducer, + useRef, + useState, +]; diff --git a/src/sourceSnippets/imports.ts b/src/sourceSnippets/imports.ts new file mode 100644 index 0000000..f28281b --- /dev/null +++ b/src/sourceSnippets/imports.ts @@ -0,0 +1,200 @@ +import { Placeholders, SnippetMapping } from '../types'; + +import { reactWithMemo } from './sharedSnippets'; + +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: reactWithMemo, +}; + +const importReactWithMemoAndPropTypes: ImportsSnippet = { + key: 'importReactWithMemoAndPropTypes', + prefix: 'imrmp', + body: [...reactWithMemo, "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 ${Placeholders.SecondTab} from '${Placeholders.FirstTab}'`], +}; + +const importNoModuleName: ImportsSnippet = { + key: 'importNoModuleName', + prefix: 'imn', + body: [`import '${Placeholders.FirstTab}'`], +}; + +const importDestructing: ImportsSnippet = { + key: 'importDestructing', + prefix: 'imd', + body: [ + `import { ${Placeholders.SecondTab} } from '${Placeholders.FirstTab}'`, + ], +}; + +const importEverything: ImportsSnippet = { + key: 'importEverything', + prefix: 'ime', + body: [ + `import * as ${Placeholders.SecondTab} from '${Placeholders.FirstTab}'`, + ], +}; + +const importAs: ImportsSnippet = { + key: 'importAs', + prefix: 'ima', + body: [ + `import { ${Placeholders.SecondTab} as ${Placeholders.ThirdTab} } from '${Placeholders.FirstTab}'`, + ], +}; + +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..76bf1db --- /dev/null +++ b/src/sourceSnippets/others.ts @@ -0,0 +1,451 @@ +import { Placeholders, 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 ${Placeholders.FirstTab}`], +}; + +const exportDestructing: OthersSnippet = { + key: 'exportDestructing', + prefix: 'exd', + body: [ + `export { ${Placeholders.SecondTab} } from '${Placeholders.FirstTab}'`, + ], +}; + +const exportAs: OthersSnippet = { + key: 'exportAs', + prefix: 'exa', + body: [ + `export { ${Placeholders.SecondTab} as ${Placeholders.ThirdTab} } from '${Placeholders.FirstTab}'`, + ], +}; + +const exportNamedFunction: OthersSnippet = { + key: 'exportNamedFunction', + prefix: 'enf', + body: [ + `export const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.ThirdTab}}`, + ], + description: 'Export named function', +}; + +const exportDefaultFunction: OthersSnippet = { + key: 'exportDefaultFunction', + prefix: 'edf', + body: [ + `export default (${Placeholders.FirstTab}) => {${Placeholders.SecondTab}}`, + ], + description: 'Export default function', +}; + +const exportDefaultNamedFunction: OthersSnippet = { + key: 'exportDefaultNamedFunction', + prefix: 'ednf', + body: [ + `export default function ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, + ], + description: 'Export default named function', +}; + +const method: OthersSnippet = { + key: 'method', + prefix: 'met', + body: [ + `${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => {${Placeholders.ThirdTab}}`, + ], + description: 'Creates a method inside a class', +}; + +const propertyGet: OthersSnippet = { + key: 'propertyGet', + prefix: 'pge', + body: [ + `get ${Placeholders.FirstTab}() {`, + ` return this.${Placeholders.SecondTab}`, + '}', + ], + description: 'Creates a getter property inside a class', +}; + +const propertySet: OthersSnippet = { + key: 'propertySet', + prefix: 'pse', + body: [ + `set ${Placeholders.FirstTab}(${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, + ], + description: 'Creates a setter property inside a class', +}; + +const forEach: OthersSnippet = { + key: 'forEach', + prefix: 'fre', + body: [ + `${Placeholders.FirstTab}.forEach(${Placeholders.SecondTab} => {${Placeholders.ThirdTab}})`, + ], + description: 'Creates a forEach statement', +}; + +const forOf: OthersSnippet = { + key: 'forOf', + prefix: 'fof', + body: [ + `for(let ${Placeholders.FirstTab} of ${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, + ], + description: 'Iterating over property names of iterable objects', +}; + +const forIn: OthersSnippet = { + key: 'forIn', + prefix: 'fin', + body: [ + `for(let ${Placeholders.FirstTab} in ${Placeholders.SecondTab}) {${Placeholders.ThirdTab}}`, + ], + description: 'Iterating over property values of iterable objects', +}; + +const anonymousFunction: OthersSnippet = { + key: 'anonymousFunction', + prefix: 'anfn', + body: [`(${Placeholders.FirstTab}) => { ${Placeholders.SecondTab} }`], + description: 'Creates an anonymous function', +}; + +const namedFunction: OthersSnippet = { + key: 'namedFunction', + prefix: 'nfn', + body: [ + `const ${Placeholders.FirstTab} = (${Placeholders.SecondTab}) => { ${Placeholders.ThirdTab} }`, + ], + description: 'Creates a named function', +}; + +const destructingObject: OthersSnippet = { + key: 'destructingObject', + prefix: 'dob', + 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}`], + description: 'Creates and assigns a local variable using array destructing', +}; + +const setInterval: OthersSnippet = { + key: 'setInterval', + prefix: 'sti', + body: [ + `setInterval(() => { ${Placeholders.FirstTab} }, ${Placeholders.SecondTab})`, + ], + description: 'Executes the given function at specified intervals', +}; + +const setTimeOut: OthersSnippet = { + key: 'setTimeOut', + prefix: 'sto', + body: [ + `setTimeout(() => { ${Placeholders.FirstTab} }, ${Placeholders.SecondTab})`, + ], + description: 'Executes the given function after the specified delay', +}; + +const promise: OthersSnippet = { + key: 'promise', + prefix: 'prom', + body: [ + `return new Promise((resolve, reject) => { ${Placeholders.FirstTab} })`, + ], + description: 'Creates and returns a new Promise in the standard ES7 syntax', +}; + +const destructProps: OthersSnippet = { + key: 'destructProps', + prefix: 'cp', + 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.FirstTab} } = 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 = {', + ` ${Placeholders.FirstTab}`, + ' }', + '}', + ], + description: + "Adds a default constructor for it('', () => {})the class that contains props as arguments", +}; + +const emptyState: OthersSnippet = { + key: 'emptyState', + prefix: 'est', + 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} }`], + 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) { ${Placeholders.FirstTab} }`, + ], + description: + 'Invoked before rendering when new props or state are being received. ', +}; + +const componentDidUpdate: OthersSnippet = { + key: 'componentDidUpdate', + prefix: 'cdup', + body: [ + `componentDidUpdate(prevProps, prevState) { ${Placeholders.FirstTab}} `, + ], + description: + "Invoked immediately after the component's updates are flushed to the DOM.", +}; + +const componentWillUnmount: OthersSnippet = { + key: 'componentWillUnmount', + prefix: 'cwun', + body: [`componentWillUnmount() {${Placeholders.FirstTab} }`], + description: + 'Invoked immediately before a component is unmounted from the DOM.', +}; + +const getDerivedStateFromProps: OthersSnippet = { + key: 'getDerivedStateFromProps', + prefix: 'gdsfp', + body: [ + `static getDerivedStateFromProps(props, state) {${Placeholders.FirstTab}}`, + ], + 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) => {${Placeholders.FirstTab}}`, + ], + description: + 'Called right before mutations are made (e.g. before the DOM is updated)', +}; + +const createContext: OthersSnippet = { + key: 'createContext', + prefix: 'rcontext', + body: [`const ${Placeholders.FirstTab} = React.createContext()`], + description: 'Create React context', +}; + +const createRef: OthersSnippet = { + key: 'createRef', + prefix: 'cref', + 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.FirstTab}})`], + description: 'Performs a shallow merge of nextState into current state', +}; + +const componentSetStateFunc: OthersSnippet = { + key: 'componentSetStateFunc', + prefix: 'ssf', + body: [ + `this.setState((state, props) => { return { ${Placeholders.FirstTab} }})`, + ], + description: 'Performs a shallow merge of nextState into current state', +}; + +const componentProps: OthersSnippet = { + key: 'componentProps', + prefix: 'props', + body: [`this.props.${Placeholders.FirstTab}`], + description: "Access component's props", +}; + +const componentState: OthersSnippet = { + key: 'componentState', + prefix: 'state', + body: [`this.state.${Placeholders.FirstTab}`], +}; + +const bindThis: OthersSnippet = { + key: 'bindThis', + prefix: 'bnd', + body: [ + `this.${Placeholders.FirstTab} = this.${Placeholders.FirstTab}.bind(this)`, + ], + description: 'Binds this to a method', +}; + +const commentBigBlock: OthersSnippet = { + key: 'commentBigBlock', + prefix: 'cmmb', + body: ['/**', ` * ${Placeholders.FirstTab}`, ' */'], +}; + +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 ${Placeholders.FirstTab} = (WrappedComponent) => {`, + ' const hocComponent = ({ ...props }) => ', + '', + ' hocComponent.propTypes = {}', + '', + ' return hocComponent', + '}', + '', + `export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${Placeholders.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 ${Placeholders.FirstTab}`], +}; + +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..3fd13cc --- /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..0a06d6c --- /dev/null +++ b/src/sourceSnippets/reactNative.ts @@ -0,0 +1,196 @@ +import { Placeholders, SnippetMapping } from '../types'; + +import { + exportDefault, + 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'; +}; + +export type ReactNativeSnippet = SnippetMapping; + +const reactNativeStylesSnippet = ['const styles = StyleSheet.create({})']; +const reactNativeComponentReturn = [ + ' render() {', + ' return (', + ' ', + ` ${Placeholders.FirstTab}`, + ' ', + ' )', + ' }', +]; + +const reactNativeReturn = [ + ' return (', + ' ', + ` ${Placeholders.FirstTab}`, + ' ', + ' )', +]; + +const reactNativeImport: ReactNativeSnippet = { + key: 'reactNativeImport', + prefix: 'imrn', + body: [`import { ${Placeholders.FirstTab} } from 'react-native'`], +}; + +const reactNativeStyles: ReactNativeSnippet = { + key: 'reactNativeStyles', + prefix: 'rnstyle', + body: [`const styles = StyleSheet.create({${Placeholders.FirstTab}})`], +}; + +const reactNativeComponent: ReactNativeSnippet = { + key: 'reactNativeComponent', + prefix: 'rnc', + body: [ + "import { Text, View } from 'react-native'", + ...reactComponent, + '', + `export default class ${Placeholders.FileName} extends Component {`, + ...reactNativeComponentReturn, + '}', + ], +}; + +const reactNativeComponentWithStyles: ReactNativeSnippet = { + key: 'reactNativeComponentWithStyles', + prefix: 'rncs', + body: [ + "import { Text, StyleSheet, View } from 'react-native'", + ...reactComponent, + '', + `export default class ${Placeholders.FileName} extends Component {`, + ...reactNativeComponentReturn, + '}', + '', + ...reactNativeStylesSnippet, + ], +}; + +const reactNativeComponentExport: ReactNativeSnippet = { + key: 'reactNativeComponentExport', + prefix: 'rnce', + body: [ + "import { Text, View } from 'react-native'", + ...reactComponent, + '', + `export class ${Placeholders.FileName} extends Component {`, + ...reactNativeComponentReturn, + '}', + ...exportDefault, + ], +}; + +const reactNativePureComponent: ReactNativeSnippet = { + key: 'reactNativePureComponent', + prefix: 'rnpc', + body: [ + "import { Text, View } from 'react-native'", + ...reactPureComponent, + '', + `export default class ${Placeholders.FileName} extends PureComponent {`, + ...reactNativeComponentReturn, + '}', + ], +}; + +const reactNativePureComponentExport: ReactNativeSnippet = { + key: 'reactNativePureComponentExport', + prefix: 'rnpce', + body: [ + "import { Text, View } from 'react-native'", + ...reactPureComponent, + '', + `export class ${Placeholders.FileName} extends PureComponent {`, + ...reactNativeComponentReturn, + '}', + ...exportDefault, + ], +}; + +const reactNativeFunctionalExportComponent: ReactNativeSnippet = { + key: 'reactNativeFunctionalExportComponent', + prefix: 'rnfe', + body: [ + "import { View, Text } from 'react-native'", + ...react, + '', + `const ${Placeholders.FileName} = () => {`, + ...reactNativeReturn, + '}', + ...exportDefault, + ], +}; + +const reactNativeFunctionalExportComponentWithStyles: ReactNativeSnippet = { + key: 'reactNativeFunctionalExportComponentWithStyles', + prefix: 'rnfes', + body: [ + "import { StyleSheet, Text, View } from 'react-native'", + ...react, + '', + `const ${Placeholders.FileName} = () => {`, + ...reactNativeReturn, + '}', + ...exportDefault, + '', + ...reactNativeStylesSnippet, + ], +}; + +const reactNativeFunctionalComponent: ReactNativeSnippet = { + key: 'reactNativeFunctionalComponent', + prefix: 'rnf', + body: [ + "import { View, Text } from 'react-native'", + ...react, + '', + `export default function ${Placeholders.FileName}() {`, + ...reactNativeReturn, + '}', + ], +}; + +const reactNativeFunctionalComponentWithStyles: ReactNativeSnippet = { + key: 'reactNativeFunctionalComponentWithStyles', + prefix: 'rnfs', + body: [ + "import { StyleSheet, Text, View } from 'react-native'", + ...react, + '', + `export default function ${Placeholders.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..0315fc9 --- /dev/null +++ b/src/sourceSnippets/redux.ts @@ -0,0 +1,109 @@ +import { Placeholders, SnippetMapping } from '../types'; + +type ReduxMapping = { + 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 ${Placeholders.FirstTab} = (payload) => ({`, + ` type: ${Placeholders.SecondTab},`, + ' payload', + '})', + '', + ], +}; + +const reduxConst: ReduxSnippet = { + key: 'reduxConst', + prefix: 'rxconst', + body: [`export const ${Placeholders.FirstTab} = '${Placeholders.FirstTab}'`], +}; + +const reduxReducer: ReduxSnippet = { + key: 'reduxReducer', + prefix: 'rxreducer', + body: [ + 'const initialState = {}', + '', + 'export default (state = initialState, { type, payload }) => {', + ' switch (type) {', + '', + ` case ${Placeholders.FirstTab}:`, + ' return { ...state, ...payload }', + '', + ' default:', + ' return state', + ' }', + '}', + '', + ], +}; + +const reduxSelector: ReduxSnippet = { + key: 'reduxSelector', + prefix: 'rxselect', + body: [ + "import { createSelector } from 'reselect'", + '', + `export const ${Placeholders.FirstTab} = state => state.${Placeholders.SecondTab}`, + ], +}; + +const reduxSlice: ReduxSnippet = { + key: 'reduxSlice', + prefix: 'rxslice', + body: [ + "import { createSlice } from '@reduxjs/toolkit'", + '', + 'const initialState = {', + '', + '}', + '', + `const ${Placeholders.FileName} = createSlice({`, + ` name: ${Placeholders.SecondTab},`, + ' initialState,', + ' reducers: {}', + '});', + '', + `export const {} = ${Placeholders.FileName}.actions`, + '', + `export default ${Placeholders.FileName}.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..6a199ac --- /dev/null +++ b/src/sourceSnippets/sharedSnippets.ts @@ -0,0 +1,55 @@ +import { Placeholders } 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)(${Placeholders.FileName})`, +]; + +export const innerComponent = [ + ' return (', + `
${Placeholders.FirstTab}
`, + ' )', +]; + +export const innerComponentReturn = [ + ' render() {', + ' return (', + `
${Placeholders.FirstTab}
`, + ' )', + ' }', +]; + +export const exportDefault = ['', `export default ${Placeholders.FileName}`]; + +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 new file mode 100644 index 0000000..73ebadb --- /dev/null +++ b/src/sourceSnippets/tests.ts @@ -0,0 +1,159 @@ +import { Placeholders, SnippetMapping } 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('${Placeholders.FirstTab}', () => { ${Placeholders.SecondTab} })`, + ], + description: 'Testing `describe` block', +}; +const testBlock: TestsSnippet = { + key: 'testBlock', + prefix: 'test', + body: [ + `test('should ${Placeholders.FirstTab}', () => { ${Placeholders.SecondTab} })`, + ], + description: 'Testing `test` block', +}; +const testAsyncBlock: TestsSnippet = { + key: 'testAsyncBlock', + prefix: 'testa', + body: [ + `test('should ${Placeholders.FirstTab}', async () => { ${Placeholders.SecondTab} })`, + ], + description: 'Testing `asynchronous test` block', +}; +const itBlock: TestsSnippet = { + key: 'itBlock', + prefix: 'tit', + body: [ + `it('should ${Placeholders.FirstTab}', () => { ${Placeholders.SecondTab} })`, + ], + description: 'Testing `it` block', +}; +const itAsyncBlock: TestsSnippet = { + key: 'itAsyncBlock', + prefix: 'tita', + body: [ + `it('should ${Placeholders.FirstTab}', async () => { ${Placeholders.SecondTab} })`, + ], + description: 'Testing asynchronous `it` block', +}; +const setupReactTest: TestsSnippet = { + key: 'setupReactTest', + prefix: 'stest', + body: [ + "import React from 'react'", + "import renderer from 'react-test-renderer'", + '', + `import { ${Placeholders.FileName} } from '../${Placeholders.FileName}'`, + '', + `describe('<${Placeholders.FileName} />', () => {`, + ' const defaultProps = {}', + ` const wrapper = renderer.create(<${Placeholders.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 ${Placeholders.FileName} from '../${Placeholders.FileName}'`, + '', + `describe('<${Placeholders.FileName} />', () => {`, + ' const defaultProps = {}', + ` const wrapper = renderer.create(<${Placeholders.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 { ${Placeholders.FileName} } from '../${Placeholders.FileName}'`, + '', + `describe('<${Placeholders.FileName} />', () => {`, + ' const defaultProps = {}', + ' const wrapper = renderer.create(', + ' ', + ` <${Placeholders.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 ${Placeholders.FileName} from '../${Placeholders.FileName}'`, + '', + `describe('<${Placeholders.FileName} />', () => {`, + ' const defaultProps = {}', + ' const wrapper = renderer.create(', + ' ', + ` <${Placeholders.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 new file mode 100644 index 0000000..d024a0c --- /dev/null +++ b/src/sourceSnippets/typescript.ts @@ -0,0 +1,253 @@ +import { Placeholders, SnippetMapping } from '../types'; + +import { + exportDefault, + innerComponent, + innerComponentReturn, + propsStateInterface, + propsTypeInterface, + react, + reactComponent, + reactPureComponent, + reduxComponentExport, +} from './sharedSnippets'; + +type TypescriptMappings = { + exportInterface: 'expint'; + exportType: 'exptp'; + typescriptReactArrowFunctionComponent: 'tsrafc'; + typescriptReactArrowFunctionExportComponent: 'tsrafce'; + typescriptReactClassComponent: 'tsrcc'; + typescriptReactClassComponentRedux: 'tsrcredux'; + typescriptReactClassExportComponent: 'tsrce'; + typescriptReactClassExportPureComponent: 'tsrpce'; + typescriptReactClassPureComponent: 'tsrpc'; + typescriptReactFunctionalComponent: 'tsrfc'; + typescriptReactFunctionalExportComponent: 'tsrfce'; + typescriptReactNativeArrowFunctionComponent: 'tsrnf'; + typescriptReactNativeArrowFunctionComponentWithStyles: 'tsrnfs'; +}; + +export type TypescriptSnippet = SnippetMapping; + +const exportType: TypescriptSnippet = { + body: [`export type ${Placeholders.FirstTab} = {${Placeholders.SecondTab}}`], + key: 'exportType', + prefix: 'exptp', +}; + +const exportInterface: TypescriptSnippet = { + key: 'exportInterface', + prefix: 'expint', + body: [ + `export interface ${Placeholders.FirstTab} {${Placeholders.SecondTab}}`, + ], +}; + +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 ${Placeholders.FileName} extends Component {`, + ' state = {}', + '', + ...innerComponentReturn, + '}', + ], +}; + +const typescriptReactClassExportComponent: TypescriptSnippet = { + key: 'typescriptReactClassExportComponent', + prefix: 'tsrce', + body: [ + ...reactComponent, + '', + ...propsStateInterface, + `class ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.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 ${Placeholders.FileName} = (props: Props) => {`, + ' return (', + ' ', + ` ${Placeholders.FirstTab}`, + ' ', + ' )', + '}', + ...exportDefault, + ], + description: + 'Creates a React Native Arrow Function Component with ES7 module system in TypeScript', +}; + +const typescriptReactNativeArrowFunctionComponentWithStyles: TypescriptSnippet = + { + key: 'typescriptReactNativeArrowFunctionComponentWithStyles', + prefix: 'tsrnfs', + body: [ + "import { StyleSheet, Text, View } from 'react-native'", + ...react, + '', + ...propsTypeInterface, + `const ${Placeholders.FileName} = (props: Props) => {`, + ' return (', + ' ', + ` ${Placeholders.FirstTab}`, + ' ', + ' )', + '}', + ...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, + typescriptReactNativeArrowFunctionComponentWithStyles, +]; diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..19fa619 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,28 @@ +export type SnippetMapping = { + key: keyof T; + prefix: T[keyof T]; + body: string[]; + description?: string; +}; + +export const Placeholders = { + FileName: 'file', + FirstTab: 'first', + SecondTab: 'second', + ThirdTab: 'third', + Capitalize: 'capitalize', + TypeProps: 'typeProps', + TypeState: 'typeState', +} as const; + +export const Mappings = { + FileName: '${1:${TM_FILENAME_BASE}}', + FirstTab: '${1:first}', + SecondTab: '${2:second}', + ThirdTab: '${3:third}', + Capitalize: '${1/(.*)/${1:/capitalize}/}', + TypeProps: 'type Props = {}', + TypeState: 'type State = {}', + InterfaceProps: 'interface Props {}', + InterfaceState: 'interface State {}', +} as const; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c1aa99d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "module": "amd", + "moduleResolution": "Node", + "noEmit": true, + "noImplicitAny": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "skipDefaultLibCheck": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "strictNullChecks": true, + "target": "ESNext" + }, + "exclude": ["node_modules", "jest", "**/__tests__/*"], + "compileOnSave": false +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..3956e33 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1747 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@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" + 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.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.7" + +"@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.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.17.0" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@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.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.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.16.7" + to-fast-properties "^2.0.0" + +"@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.3.2" + espree "^9.2.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +"@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.1" + debug "^4.1.1" + minimatch "^3.0.4" + +"@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" + 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" + +"@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.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.60.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" + regexpp "^3.2.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@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: + "@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/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/types" "5.11.0" + "@typescript-eslint/visitor-keys" "5.11.0" + +"@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/utils" "5.11.0" + debug "^4.3.2" + tsutils "^3.21.0" + +"@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.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.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/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: + "@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: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +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== + +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" + 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-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.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" + +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: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +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.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" + 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" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.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== + dependencies: + fill-range "^7.0.1" + +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== + +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: + 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" + +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" + 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" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + 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" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +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.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== + dependencies: + safe-buffer "~5.1.1" + +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== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +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.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" + 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" + +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" + +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" + +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.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.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" + +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.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.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.12.0" + +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/utils" "^5.10.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" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.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@^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.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== + +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" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.0" + eslint-utils "^3.0.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" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^6.0.1" + globals "^13.6.0" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^4.1.0" + 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" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +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 "^8.6.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" + 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" + 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.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== + +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== + +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= + +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" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + 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" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + 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" + 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= + +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== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +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.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== + 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.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" + +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" + +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" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +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, 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== + +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" + +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" + +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" + 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" + 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" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +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.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@^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@^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 "^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-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-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" + +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" + +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== + +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" + +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.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: + 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@^1.2.0: + 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" + 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== + +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= + +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-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" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +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-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" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + 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" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +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== + +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== + +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== + +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" + integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== + +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== + +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: + picomatch "^2.2.1" + +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== + +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@^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" + 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.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== + +semver@^5.6.0: + 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.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" + +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== + +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@^0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +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" + 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-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.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" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +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" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.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== + 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.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" + 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" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + 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== + +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" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +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" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==