Update Prettier to v3

See: https://github.com/kytta/shareon/pull/65
pull/66/head
Nikita Karamov 2023-07-14 22:30:19 +02:00 committed by GitHub
commit db2d9f1b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 17 deletions

View File

@ -11,11 +11,9 @@ repos:
- id: check-toml
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.9-for-vscode"
rev: "v3.0.0"
hooks:
- id: prettier
additional_dependencies:
- prettier@2
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v8.43.0"
hooks:

View File

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@ -62,10 +62,13 @@
"postcss-calc": "^8.2.4",
"postcss-css-variables": "^0.18.0",
"postcss-csso": "^6.0.1",
"prettier": "^2.8.5",
"prettier": "^3.0.0",
"size-limit": "^8.2.4",
"vite": "^4.2.1"
},
"prettier": {
"embeddedLanguageFormatting": "off"
},
"eslintConfig": {
"env": {
"browser": true

View File

@ -1,5 +1,9 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
devDependencies:
'@size-limit/preset-small-lib':
specifier: ^8.2.4
@ -32,8 +36,8 @@ devDependencies:
specifier: ^6.0.1
version: 6.0.1(postcss@8.4.21)
prettier:
specifier: ^2.8.5
version: 2.8.5
specifier: ^3.0.0
version: 3.0.0
size-limit:
specifier: ^8.2.4
version: 8.2.4
@ -436,6 +440,7 @@ packages:
/autoprefixer@10.4.14(postcss@8.4.21):
resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
engines: {node: ^10 || ^12 || >=14}
hasBin: true
peerDependencies:
postcss: ^8.1.0
dependencies:
@ -694,6 +699,7 @@ packages:
/eslint-config-prettier@8.8.0(eslint@8.36.0):
resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
dependencies:
@ -1386,9 +1392,10 @@ packages:
engines: {node: '>= 0.8.0'}
dev: true
/prettier@2.8.5:
resolution: {integrity: sha512-3gzuxrHbKUePRBB4ZeU08VNkUcqEHaUaouNt0m7LGP4Hti/NuB07C7PPTM/LkWqXoJYJn2McEo5+kxPNrtQkLQ==}
engines: {node: '>=10.13.0'}
/prettier@3.0.0:
resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==}
engines: {node: '>=14'}
hasBin: true
dev: true
/punycode@2.3.0:
@ -1619,6 +1626,7 @@ packages:
/update-browserslist-db@1.0.10(browserslist@4.21.5):
resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
dependencies:
@ -1647,6 +1655,7 @@ packages:
/vite@4.2.1:
resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
peerDependencies:
'@types/node': '>= 14'
less: '*'

View File

@ -71,25 +71,27 @@ const init = () => {
url: encodeURIComponent(
child.dataset.url ||
container.dataset.url ||
window.location.href
window.location.href,
),
title: encodeURIComponent(
child.dataset.title || container.dataset.title || document.title
child.dataset.title ||
container.dataset.title ||
document.title,
),
media: encodeURIComponent(
child.dataset.media || container.dataset.media || ""
child.dataset.media || container.dataset.media || "",
),
text: encodeURIComponent(
child.dataset.text || container.dataset.text || ""
child.dataset.text || container.dataset.text || "",
),
via: encodeURIComponent(
child.dataset.via || container.dataset.via || ""
child.dataset.via || container.dataset.via || "",
),
hashtags: encodeURIComponent(
child.dataset.hashtags || container.dataset.hashtags || ""
child.dataset.hashtags || container.dataset.hashtags || "",
),
fbAppId: encodeURIComponent(
child.dataset.fbAppId || container.dataset.fbAppId || ""
child.dataset.fbAppId || container.dataset.fbAppId || "",
),
};
const url = urlBuilderMap[cls](preset);