Skip to content

Commit

Permalink
(refactor): get tsdx lint working with standard style
Browse files Browse the repository at this point in the history
- replace standard with eslint and all eslint-config-standard etc
- hopefully tsdx lint should be more compatible with editors, tools,
  TS, etc than standard, because it gave lots of issues
  - lots of things, esp. integrations, are pretty unmaintained in
    standard's ecosystem :(
  - add react-app and prettier from tsdx lint --write-file so editors
    etc will be able to have the same config as TSDX internally
  - have to turn off prettier as double quotes and semicolons conflict
    with standard

- fix lint errors in the example code

(deps): add eslint-config-standard and all its peerDeps
(deps): add eslint-plugin-react as tsdx lint will error without it
  • Loading branch information
agilgur5 committed Apr 20, 2022
1 parent 47215e3 commit 12aa4a5
Show file tree
Hide file tree
Showing 4 changed files with 457 additions and 352 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
ignorePatterns: ['dist/'],
extends: [
'react-app',
'standard'
],
rules: {
'prettier/prettier': 'off' // override tsdx lint
}
}
7 changes: 4 additions & 3 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class App extends Component {
}

trim = () => {
this.setState({ trimmedDataURL: this.sigPad.getTrimmedCanvas()
.toDataURL('image/png') })
this.setState({
trimmedDataURL: this.sigPad.getTrimmedCanvas().toDataURL('image/png')
})
}

render () {
Expand All @@ -35,7 +36,7 @@ class App extends Component {
</button>
</div>
{trimmedDataURL
? <img className={styles.sigImage}
? <img className={styles.sigImage} alt='signature'
src={trimmedDataURL} />
: null}
</div>
Expand Down
Loading

0 comments on commit 12aa4a5

Please sign in to comment.