-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add formatting and linting checks (#12)
- Loading branch information
1 parent
a7c598a
commit c82aec1
Showing
46 changed files
with
1,254 additions
and
875 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import {WidgetType} from './components/Widget'; | ||
import {FieldType, FormViewProps} from '../exports'; | ||
import {WidgetType} from "./components/Widget"; | ||
import {FieldType, FormViewProps} from "../exports"; | ||
|
||
declare module '../exports' { | ||
declare module "../exports" { | ||
interface FieldType { | ||
widget: WidgetType; | ||
} | ||
} | ||
|
||
export * from '../exports'; | ||
export * from "../exports"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import React from 'react'; | ||
import React from "react"; | ||
|
||
interface Props { | ||
thing: string; | ||
} | ||
|
||
export default (props: Props) => <div> | ||
I am {props.thing} | ||
</div>; | ||
export default (props: Props) => <div>I am {props.thing}</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
import React from 'react'; | ||
import React from "react"; | ||
|
||
import {Layout} from '../components/Layout'; | ||
import {Form} from '../components/Form'; | ||
import {FormViewProps} from '../models'; | ||
import {WidgetType as Foo} from '../components/Widget'; | ||
import {Layout} from "../components/Layout"; | ||
import {Form} from "../components/Form"; | ||
import {FormViewProps} from "../models"; | ||
import {WidgetType as Foo} from "../components/Widget"; | ||
|
||
interface Widget { | ||
name: string; | ||
url: string; | ||
} | ||
|
||
|
||
interface Props extends FormViewProps { | ||
// form: FormType; | ||
// widget_list: Widget[]; | ||
csrf_token: string; | ||
} | ||
|
||
export default (props: Props) => <Layout> | ||
<ul> | ||
{props.widget_list.map(widget => | ||
<li key={widget.name}>{widget.name}</li> | ||
)} | ||
</ul> | ||
<Form csrf_token={props.csrf_token} form={props.form} /> | ||
</Layout>; | ||
export default (props: Props) => ( | ||
<Layout> | ||
<ul> | ||
{props.widget_list.map(widget => ( | ||
<li key={widget.name}>{widget.name}</li> | ||
))} | ||
</ul> | ||
<Form csrf_token={props.csrf_token} form={props.form} /> | ||
</Layout> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import React from 'react'; | ||
import React from "react"; | ||
|
||
import {Layout} from '../components/Layout'; | ||
import {TrinketDetailProps as Props} from '../models'; | ||
import {Layout} from "../components/Layout"; | ||
import {TrinketDetailProps as Props} from "../models"; | ||
|
||
|
||
export default (props: Props) => <Layout> | ||
<h1>{props.trinket.name}</h1> | ||
<a href={props.back_url}>Back to list</a> | ||
</Layout>; | ||
export default (props: Props) => ( | ||
<Layout> | ||
<h1>{props.trinket.name}</h1> | ||
<a href={props.back_url}>Back to list</a> | ||
</Layout> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import React from 'react'; | ||
import React from "react"; | ||
|
||
import {Layout} from '../components/Layout'; | ||
import {TrinketListProps as Props} from '../models'; | ||
import {Layout} from "../components/Layout"; | ||
import {TrinketListProps as Props} from "../models"; | ||
|
||
|
||
export default (props: Props) => <Layout> | ||
<ul> | ||
{props.trinket_list.map(widget => | ||
<li key={widget.name}><a href={widget.url}>{widget.name}</a></li> | ||
)} | ||
</ul> | ||
</Layout>; | ||
export default (props: Props) => ( | ||
<Layout> | ||
<ul> | ||
{props.trinket_list.map(widget => ( | ||
<li key={widget.name}> | ||
<a href={widget.url}>{widget.name}</a> | ||
</li> | ||
))} | ||
</ul> | ||
</Layout> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"devDependencies": { | ||
"prettier": "^1.18.2", | ||
"tslint": "^5.20.0", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.6.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
import React from 'react'; | ||
import {hydrate} from 'react-dom'; | ||
import React from "react"; | ||
import {hydrate} from "react-dom"; | ||
import {setStylesTarget} from "typestyle"; | ||
|
||
const props = (window as any).__PRELOADED_STATE__; | ||
|
||
if ((module as any).hot) { | ||
(module as any).hot.accept() | ||
(module as any).hot.accept(); | ||
} | ||
|
||
const Template = require('client/templates/' + props.template_name + '.tsx').default; | ||
// tslint:disable-next-line | ||
const Template = require("client/templates/" + props.template_name + ".tsx").default; | ||
|
||
export const bootstrap = () => { | ||
hydrate(<Template {...props} />, document.getElementById('root')); | ||
hydrate(<Template {...props} />, document.getElementById("root")); | ||
|
||
setStylesTarget(document.getElementById('styles-target')!); | ||
} | ||
setStylesTarget(document.getElementById("styles-target")!); | ||
}; |
Oops, something went wrong.