diff --git a/.licenseignore b/.licenseignore index cea0a0e..5f8d927 100644 --- a/.licenseignore +++ b/.licenseignore @@ -9,8 +9,10 @@ **/*.pug package.json -package-lock.json +yarn.lock \.editorconfig \.gitignore \.licenseignore +\.prettierignore +\.prettierrc.yaml Dockerfile \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..60ae4e0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +.git +node_modules +LICENSE +LICENSE.HEADER \ No newline at end of file diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..6b9c164 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: 'es5' +tabWidth: 2 +semi: false +singleQuote: true diff --git a/package.json b/package.json index ea63c06..9434290 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "bent": "^7.3.12", "browserify": "^17.0.0", "merge-options": "^3.0.3", + "prettier": "^2.1.2", "valid-url": "^1.0.9" }, "devDependencies": { @@ -20,6 +21,8 @@ "scripts": { "release:bundle": "./node_modules/browserify/bin/cmd.js ./src/index.js --standalone doip -o ./dist/doip.js", "release:minify": "./node_modules/minify/bin/minify.js ./dist/doip.js > ./dist/doip.min.js", + "prettier:check": "./node_modules/prettier/bin-prettier.js --check .", + "prettier:write": "./node_modules/prettier/bin-prettier.js --write .", "license:check": "./node_modules/license-check-and-add/dist/src/cli.js check", "license:add": "./node_modules/license-check-and-add/dist/src/cli.js add", "license:remove": "./node_modules/license-check-and-add/dist/src/cli.js remove", diff --git a/yarn.lock b/yarn.lock index 5cce8ac..bd8b9b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1621,6 +1621,11 @@ picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +prettier@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" + integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"