Skip to content

Commit 4a123c1

Browse files
committed
(refactor): get tsdx lint working with standard style
- 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
1 parent 18113bd commit 4a123c1

File tree

4 files changed

+457
-352
lines changed

4 files changed

+457
-352
lines changed

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
ignorePatterns: ['dist/'],
3+
extends: [
4+
'react-app',
5+
'standard'
6+
],
7+
rules: {
8+
'prettier/prettier': 'off' // override tsdx lint
9+
}
10+
}

example/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ class App extends Component {
1515
}
1616

1717
trim = () => {
18-
this.setState({ trimmedDataURL: this.sigPad.getTrimmedCanvas()
19-
.toDataURL('image/png') })
18+
this.setState({
19+
trimmedDataURL: this.sigPad.getTrimmedCanvas().toDataURL('image/png')
20+
})
2021
}
2122

2223
render () {
@@ -35,7 +36,7 @@ class App extends Component {
3536
</button>
3637
</div>
3738
{trimmedDataURL
38-
? <img className={styles.sigImage}
39+
? <img className={styles.sigImage} alt='signature'
3940
src={trimmedDataURL} />
4041
: null}
4142
</div>

0 commit comments

Comments
 (0)