Skip to content

Commit

Permalink
(lint): add standard-with-typescript, fix formatting
Browse files Browse the repository at this point in the history
- for this commit, just focus on configuration and formatting errors,
  stricter typings will be in next commits

- add tsconfig.eslint.json so that test/ files are linted too
  • Loading branch information
agilgur5 committed Apr 20, 2022
1 parent 7367366 commit a20d7ad
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ module.exports = {
ignorePatterns: ['dist/'],
extends: [
'react-app',
'standard'
'standard', // for any JS
'standard-with-typescript' // for all TS
],
parserOptions: {
// same as ./tsconfig.json, but adds test dir to be linted
project: './tsconfig.eslint.json',
},
rules: {
'prettier/prettier': 'off' // override tsdx lint
}
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
],
"scripts": {
"start": "parcel example/public/index.html",
"lint": "tsdx lint '**/*.js'",
"lint:fix": "tsdx lint '**/*.js' --fix",
"lint": "tsdx lint '**/*.js' '**/*.ts' '**/*.tsx'",
"lint:fix": "npm run lint -- --fix",
"build": "tsdx build",
"test": "tsdx test",
"test:pub": "npm run build && npm pack",
Expand Down Expand Up @@ -72,6 +72,7 @@
"enzyme": "^3.10.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-config-standard-with-typescript": "^12.0.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SignaturePad from 'signature_pad'
import trimCanvas from 'trim-canvas'

export interface SignatureCanvasProps extends SignaturePad.SignaturePadOptions {
canvasProps?: React.CanvasHTMLAttributes<HTMLCanvasElement>,
canvasProps?: React.CanvasHTMLAttributes<HTMLCanvasElement>
clearOnResize?: boolean
}

Expand Down
5 changes: 5 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "./tsconfig.json",
// adds test dir to be linted
"include": ["src", "typings", "test"]
}

0 comments on commit a20d7ad

Please sign in to comment.