mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-07-06 07:09:51 +02:00
added vscode settings and snippets
This commit is contained in:
10
scm-ui/.vscode/settings.json
vendored
Normal file
10
scm-ui/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"javascript.validate.enable": false,
|
||||
// Set the default
|
||||
"editor.formatOnSave": false,
|
||||
// Enable per-language
|
||||
"[javascript]": {
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"flow.pathToFlow": "${workspaceRoot}/node_modules/.bin/flow"
|
||||
}
|
||||
97
scm-ui/.vscode/snippets/javascript.json
vendored
Normal file
97
scm-ui/.vscode/snippets/javascript.json
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"React default component": {
|
||||
"prefix": "rdc",
|
||||
"body": [
|
||||
"//@flow",
|
||||
"import React from \"react\";",
|
||||
"",
|
||||
"type Props = {};",
|
||||
"",
|
||||
"class $1 extends React.Component<Props> {",
|
||||
" render() {",
|
||||
" return <div />;",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"export default $1;"
|
||||
],
|
||||
"description": "React default component with props"
|
||||
},
|
||||
|
||||
"React styled component": {
|
||||
"prefix": "rsc",
|
||||
"body": [
|
||||
"//@flow",
|
||||
"import React from \"react\";",
|
||||
"import injectSheet from \"react-jss\";",
|
||||
"",
|
||||
"const styles = {};",
|
||||
"",
|
||||
"type Props = {",
|
||||
" classes: any",
|
||||
"};",
|
||||
"",
|
||||
"class $1 extends React.Component<Props> {",
|
||||
" render() {",
|
||||
" const { classes } = this.props;",
|
||||
" return <div />;",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"export default injectSheet(styles)($1);"
|
||||
],
|
||||
"description": "React default component with props"
|
||||
},
|
||||
|
||||
"React container component": {
|
||||
"prefix": "rcc",
|
||||
"body": [
|
||||
"//@flow",
|
||||
"import React from \"react\";",
|
||||
"import { connect } from \"react-redux\";",
|
||||
"",
|
||||
"type Props = {};",
|
||||
"",
|
||||
"class $1 extends React.Component<Props> {",
|
||||
" render() {",
|
||||
" return <div />;",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"const mapStateToProps = state => {",
|
||||
" return {};",
|
||||
"};",
|
||||
"",
|
||||
"const mapDispatchToProps = (dispatch) => {",
|
||||
" return {};",
|
||||
"};",
|
||||
"",
|
||||
"export default connect(",
|
||||
" mapStateToProps,",
|
||||
" mapDispatchToProps",
|
||||
")($1);"
|
||||
],
|
||||
"description": "React component which is connected to the store"
|
||||
},
|
||||
|
||||
"React component test": {
|
||||
"prefix": "rct",
|
||||
"body": [
|
||||
"//@flow",
|
||||
"import React from \"react\";",
|
||||
"import { configure, shallow } from \"enzyme\";",
|
||||
"import Adapter from \"enzyme-adapter-react-16\";",
|
||||
"",
|
||||
"import \"raf/polyfill\";",
|
||||
"",
|
||||
"configure({ adapter: new Adapter() });",
|
||||
"",
|
||||
"it(\"should render the component\", () => {",
|
||||
" $0",
|
||||
" //const label = shallow(<Label value=\"awesome\" />);",
|
||||
" //expect(label.text()).toBe(\"awesome\");",
|
||||
"});"
|
||||
],
|
||||
"description": "React component test with enzyme and jest"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { Component } from "react";
|
||||
import type { ThunkDispatch } from "redux-thunk";
|
||||
import Main from "./Main";
|
||||
import Login from "./Login";
|
||||
import { connect } from "react-redux";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import { ThunkDispatch } from "redux-thunk";
|
||||
import { fetchMe } from "../modules/me";
|
||||
|
||||
import "./App.css";
|
||||
|
||||
Reference in New Issue
Block a user