Skip to content

Commit

Permalink
ESLint and TS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliamKopecky committed Nov 19, 2021
1 parent 932194e commit 99b2753
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 38 deletions.
14 changes: 11 additions & 3 deletions src/api/templates/availableTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
export default [
const availableTemplates = [
{ name: 'email.invitation.html', render: require('./email.invitation.html.leaf.tsx').default },
{ name: 'email.invitation.plain', render: require('./email.invitation.plain.leaf.tsx').default },
{ name: 'web.invitation', render: require('./web.invitation.leaf.tsx').default },

{ name: 'email.password-recovery.html', render: require('./email.password-recovery.html.leaf.tsx').default },
{ name: 'email.password-recovery.plain', render: require('./email.password-recovery.plain.leaf.tsx').default },
{
name: 'email.password-recovery.html',
render: require('./email.password-recovery.html.leaf.tsx').default,
},
{
name: 'email.password-recovery.plain',
render: require('./email.password-recovery.plain.leaf.tsx').default,
},
{ name: 'web.password-recovery', render: require('./web.password-recovery.leaf.tsx').default },

{ name: 'web.info-message', render: require('./web.info-message.leaf.tsx').default },
]

export default availableTemplates
2 changes: 1 addition & 1 deletion src/api/templates/parts/htmlEmailButton.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function(blocks: { label: string; href: string; center?: boolean }, params: any) {
export default function htmlEmailButton(blocks: { label: string; href: string; center?: boolean }, params: any) {
const { label, href } = blocks
const center = blocks.center
const styles = {
Expand Down
2 changes: 1 addition & 1 deletion src/api/templates/parts/htmlEmailLayout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function(blocks: any, params: any) {
export default function htmlEmailLayout(blocks: any, params: any) {
const { footer, content } = blocks
const center = blocks.center || false
const styles = {
Expand Down
14 changes: 6 additions & 8 deletions src/components/TagSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import AsyncSelect from 'react-select/lib/Async'
import AsyncSelect from 'react-select/async'
import { SearchSuggestionType, SearchSuggestion } from '../connector/Model/SearchSuggestion'
import { App } from '../connector/Model/App'
import { AppTag } from '../connector/Model/AppTag'
Expand Down Expand Up @@ -88,12 +88,6 @@ export default class WithCallbacks extends React.Component<Props, State> {
return inputValue
}

handleChange = (val: any[]) => {
if (this.props.onChange) {
this.props.onChange(val.map((item) => item.value))
}
}

componentDidMount() {
window.Einstore.commonTags(this.props.teamId || undefined).then((commonTags: any) => {
this.setState({
Expand All @@ -114,7 +108,11 @@ export default class WithCallbacks extends React.Component<Props, State> {
onInputChange={this.handleInputChange}
isMulti
placeholder="Search…"
onChange={this.handleChange}
onChange={(val) => {
if (this.props.onChange) {
this.props.onChange(val.map((item) => item?.value ?? null))
}
}}
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/parts/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class Account extends Component {
}

render() {
const { old, form } = this.state
const { old } = this.state

return (
<div className="sheet">
Expand Down
55 changes: 31 additions & 24 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "src",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["es2015", "es2017", "dom"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"resolveJsonModule": true,
"skipLibCheck": false,
"strict": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5"
},
"include": ["src"]
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "src",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react-jsx",
"lib": [
"es2015",
"es2017",
"dom"
],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"resolveJsonModule": true,
"skipLibCheck": false,
"strict": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5",
"noFallthroughCasesInSwitch": true
},
"include": [
"src"
]
}

0 comments on commit 99b2753

Please sign in to comment.