Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add prettier lint fp-45 #46

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
'*': npm run lint:fs && npm run lint:editorconfig
'*.{json,md,yml,js,ts,d.ts}': prettier --write,
'*.ts': npm run lint:ts
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# autogenerated
CHANGELOG.md
16 changes: 16 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: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
"node": ">=10"
},
"scripts": {
"format": "prettier --write \"**/*.{json,md,yml,js,ts,d.ts}\"",
"lint:fs": "ls-lint",
"lint:editorconfig": "editorconfig-checker",
"lint:format": "prettier --check \"**/*.{json,md,yml,js,ts,d.ts}\"",
"lint:ts": "eslint --ext .ts src",
"lint": "npm run lint:fs && npm run lint:editorconfig && npm run lint:ts",
"lint": "npm run lint:fs && npm run lint:editorconfig && npm run lint:format && npm run lint:ts",
"test": "jest",
"test:watch": "jest --watch",
"build:ts": "tsc && tscpaths -p tsconfig.json -s ./src -o ./build",
Expand All @@ -46,6 +48,7 @@
"eslint-plugin-jest-dom": "3.6.5",
"jest": "26.6.3",
"lint-staged": "10.5.4",
"prettier": "3.1.0",
"simple-git-hooks": "2.0.3",
"ts-jest": "26.5.4",
"ts-node": "9.1.1",
Expand Down
13 changes: 6 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ npm install form-payload
<form name="general">
<label>
Name
<input type="text" name="name" value="Jon">
<input type="text" name="name" value="Jon" />
</label>
<label>
Birthday
<input type="date" name="birthday" value="2021-03-27">
<input type="date" name="birthday" value="2021-03-27" />
</label>
<label>
Friends Count
<input type="number" name="friendsCount" value="1">
<input type="number" name="friendsCount" value="1" />
</label>
<fieldset name="friend">
<legend>Friend</legend>
<label>
Friend Name
<input type="test" name="friendName" value="Kate">
<input type="test" name="friendName" value="Kate" />
</label>
</fieldset>
<button type="submit">Submit</button>
Expand All @@ -44,7 +44,7 @@ npm install form-payload
<form name="mailing">
<label>
Mailing
<input type="email" name="mail" name="[email protected]">
<input type="email" name="mail" name="[email protected]" />
</label>
</form>
```
Expand Down Expand Up @@ -73,12 +73,11 @@ mailingFormNode.addEventListener('change', (evt) => {
console.log(getControlValue(evt.target));
// '[email protected]'
});

```

## With Frameworks

*It doesn't matter which framework you use, you just need to pass the valid [HTMLFormElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement).*
_It doesn't matter which framework you use, you just need to pass the valid [HTMLFormElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement)._

### React

Expand Down
Loading