diff --git a/.lintstagedrc.yml b/.lintstagedrc.yml index 6ea342c..9fecc96 100644 --- a/.lintstagedrc.yml +++ b/.lintstagedrc.yml @@ -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 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..c830fc1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +# autogenerated +CHANGELOG.md diff --git a/package-lock.json b/package-lock.json index 071cf97..b980855 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,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", @@ -7517,6 +7518,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-format": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", diff --git a/package.json b/package.json index b386500..d666226 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/readme.md b/readme.md index 8a67ff3..c529b3c 100644 --- a/readme.md +++ b/readme.md @@ -19,21 +19,21 @@ npm install form-payload
``` @@ -73,12 +73,11 @@ mailingFormNode.addEventListener('change', (evt) => { console.log(getControlValue(evt.target)); // 'example@mail.com' }); - ``` ## 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