Prettier not working on saving file after vscode update - json

I have pasted my JSON setting, which may help you to get a deeper knowledge of my problem
when I try to save my file this red box shows and no indentation happens
{
"code-runner.runInTerminal": true,
"code-runner.saveAllFilesBeforeRun": true,
"code-runner.saveFileBeforeRun": true,
"workbench.iconTheme": "vscode-icons",
"C_Cpp.errorSquiggles": "Enabled",
"editor.minimap.enabled": false,
"explorer.confirmDelete": false,
"workbench.startupEditor": "none",
"editor.formatOnSave": true,
"editor.fontSize": 20,
"editor.linkedEditing": true,
"editor.wordWrap": "on",
"explorer.confirmDragAndDrop": false,
"liveServer.settings.donotShowInfoMsg": true,
"editor.formatOnPaste": true,
"highlight-matching-tag.styles": {
"opening": {
"left": {
"underline": "yellow"
},
"right": {
"surround": "#155FFA"
},
"name": {
"highlight": "rgba(180, 20, 80, 0.3)"
}
},
"closing": {
"full": {
"custom": {
"dark": {
"borderWidth": "0 0 3px 0",
"borderColor": "yellow",
"borderStyle": "solid",
"borderRadius": "4px",
"right": "10px"
},
"light": {
"borderWidth": "0 0 3px 0",
"borderColor": "yellow",
"borderStyle": "solid",
"borderRadius": "5px",
"right": "10px"
}
}
}
}
},
"prettier.jsxSingleQuote": true,
"prettier.semi": true,
"prettier.singleQuote": true,
"files.autoSave": "afterDelay",
"liveServer.settings.donotVerifyTags": true,
"workbench.colorTheme": "GitHub Dark",
"window.zoomLevel": 1,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
jglglaoyiughlva oaoiuoya aoiutooya gouyoauoyuaoo jglglaoyiughlva oaoiuoya aoiutooya gouyoauoyuaoojglglaoyiughlva oaoiuoya aoiutooya gouyoauoyuaoojglglaoyiughlva oaoiuoya aoiutooya gouyoauoyuaoojglglaoyiughlva oaoiuoya aoiutooya gouyoauoyuaoojglglaoyiughlva oaoiuoya aoiutooya gouyoauoyuaoo

I came up with the solution to my problem by myself, all I had to do was paste the following code in the JSON setting of vs-code for prettier work on HTML and JSON files.
I hope it works for you. cheers
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
}

Related

I bought the fluxstore program, connects via API to the WordPress site. The program works, but on the emulator it gives such an error

// ignore_for_file: prefer_single_quotes, lines_longer_than_80_chars final
Map<String, dynamic> environment = {
"appConfig": "lib/config/config_en.json",
"serverConfig": {
"url": "https://beno.az",
"type": "dokan",
"consumerKey": "ck_2d0aa8da524a99fee44e48e93b6c27cd278edd0f",
"consumerSecret": "cs_c284c006e0617ddf3b9e9dbabf630a5f1bd0715a"
},
"defaultDarkTheme": false,
"enableRemoteConfigFirebase": false,
"enableFirebaseAnalytics": false,
"loginSMSConstants": {
"nameDefault": "Azərbaycan",
"countryCodeDefault": "AZ",
"dialCodeDefault": "+994"
},
"phoneNumberConfig": {
"useInternationalFormat": true,
"customCountryList": [],
"dialCodeDefault": "+1",
"showCountryFlag": true,
"selectorFlagAsPrefixIcon": true,
"selectorType": "BOTTOM_SHEET",
"countryCodeDefault": "US",
"enablePhoneNumberValidation": false
},
"storeIdentifier": {
"ios": "1469772800",
"disable": true,
"android": "com.inspireui.fluxstore"
},
"advanceConfig": {
"DefaultLanguage": "az",
"DetailedBlogLayout": "halfSizeImageType",
"EnablePointReward": false,
"hideOutOfStock": false,
"HideEmptyTags": true,
"HideEmptyCategories": false,
"EnableRating": true,
"hideEmptyProductListRating": true,
"EnableCart": true,
"ShowBottomCornerCart": true,
"EnableSkuSearch": true,
"showStockStatus": true,
"GridCount": 3,
"isCaching": true,
"kIsResizeImage": true,
"httpCache": true,
"Currencies": [
{
"decimalDigits": 0,
"currency": "AZN",
"currencyCode": "AZN",
"symbolBeforeTheNumber": true,
"symbol": " ₼",
"smallestUnitRate": 1
}
],
"DefaultStoreViewCode": "",
"EnableAttributesConfigurableProduct": ["color", "size"],
"EnableAttributesLabelConfigurableProduct": ["color", "size"],
"isMultiLanguages": true,
"EnableApprovedReview": false,
"EnableSyncCartFromWebsite": false,
"EnableSyncCartToWebsite": false,
"EnableFirebase": false,
"RatioProductImage": 1.2,
"EnableCouponCode": true,
"ShowCouponList": true,
"ShowAllCoupons": true,
"ShowExpiredCoupons": true,
"AlwaysShowTabBar": false,
"PrivacyPoliciesPageId": null,
"PrivacyPoliciesPageUrl": "https://policies.google.com/",
"SupportPageUrl": "https://support.inspireui.com/",
"DownloadPageUrl": "https://mstore.io/#download",
"SocialConnectUrl": [
{
"name": "Facebook",
"url": "https://www.facebook.com/inspireui",
"icon": "assets/icons/logins/facebook.png"
},
{
"url": "https://www.instagram.com/inspireui9/",
"name": "Instagram",
"icon": "assets/icons/logins/instagram.png"
}
],
"AutoDetectLanguage": false,
"QueryRadiusDistance": 10,
"MinQueryRadiusDistance": 1,
"MaxQueryRadiusDistance": 10,
"EnableMembershipUltimate": false,
"EnablePaidMembershipPro": false,
"EnableDeliveryDateOnCheckout": false,
"EnableNewSMSLogin": true,
"EnableBottomAddToCart": false,
"inAppWebView": false,
"EnableWOOCSCurrencySwitcher": false,
"enableProductBackdrop": false,
"categoryImageMenu": true,
"EnableDigitsMobileLogin": false,
"OnBoardOnlyShowFirstTime": true,
"WebViewScript": "",
"EnableVersionCheck": false,
"AjaxSearchURL": "",
"AlwaysClearWebViewCache": false,
"AlwaysRefreshBlog": false,
"OrderNotesWithPrivateNote": true,
"OrderNotesLinkSupport": false,
"inAppUpdateForAndroid": {"typeUpdate": "flexible", "enable": false},
"categoryConfig": {"enableLargeCategories": false, "deepLevel": 3},
"pinnedProductTags": [],
"gdpr": {
"showPrivacyPolicyFirstTime": false,
"showDeleteAccount": true,
"confirmCaptcha": "PERMANENTLY DELETE"
},
"smsLoginAsDefault": false,
"DefaultCurrency": {
"symbolBeforeTheNumber": true,
"currencyCode": "AZN",
"smallestUnitRate": 1,
"decimalDigits": 0,
"symbol": " ₼",
"currency": "AZN"
},
"showRequestNotification": true
},
"defaultDrawer": {
"items": [
{"type": "home", "show": true},
{"show": true, "type": "blog"},
{"show": true, "type": "categories"},
{"type": "cart", "show": true},
{"type": "profile", "show": true},
{"show": true, "type": "login"},
{"show": true, "type": "category"}
],
"logo": "assets/images/logo.png"
},
"defaultSettings": [
"products",
"chat",
"wishlist",
"notifications",
"language",
"currencies",
"darkTheme",
"order",
"point",
"rating",
"privacy",
"about"
],
"loginSetting": {
"showGoogleLogin": true,
"facebookLoginProtocolScheme": "fb430258564493822",
"facebookAppId": "430258564493822",
"smsLoginAsDefault": false,
"showFacebook": false,
"requirePhoneNumberWhenRegister": true,
"showAppleLogin": false,
"showSMSLogin": true,
"facebookClientToken": "",
"isResetPasswordSupported": true,
"showPhoneNumberWhenRegister": true,
"IsRequiredLogin": true
},
"oneSignalKey": {
"appID": "8b45b6db-7421-45e1-85aa-75e597f62714",
"enable": false
},
"onBoardingData": [
{
"image": "https://i.imgur.com/0W12Sg5.png",
"desc": "Allış veriş artıq daha rahat oldu.",
"title": "BEN’O mobil tətbiqinə xoş gəlmisiniz"
},
{
"title": "Çatdırılma",
"image": "https://i.imgur.com/MfOH6LF.png",
"desc": "Siz əziyyət çəkməyin biz çatdırarıq"
},
{
"title": "Yeni dostlar edinin !",
"desc":
"Burada edindiyiniz dostlarınıza sevdiyi hər şeyi rahatlıqla əldə edə bilərsiniz.",
"image": "https://i.imgur.com/xdzO89M.png"
}
],
"vendorOnBoardingData": [
{
"title": "Welcome aboard",
"image": "assets/images/searching.png",
"desc": "Just a few more steps to become our vendor"
},
{
"title": "Let's Get Started",
"image": "assets/images/manage.png",
"desc": "Good Luck for great beginnings."
}
],
"adConfig": {
"ads": [],
"facebookTestingId": "",
"enable": false,
"googleTestingId": [],
"adMobAppIdIos": "ca-app-pub-7432665165146018~2664444130",
"adMobAppIdAndroid": "ca-app-pub-7432665165146018~2664444130"
},
"firebaseDynamicLinkConfig": {
"link": "https://mstore.io/",
"androidPackageName": "com.inspireui.fluxstore",
"uriPrefix": "https://fluxstoreinspireui.page.link",
"iOSAppStoreId": "1469772800",
"androidAppMinimumVersion": 1,
"isEnabled": true,
"iOSBundleId": "com.inspireui.mstore.flutter",
"iOSAppMinimumVersion": "1.0.1",
"shortDynamicLinkEnable": true
},
"languagesInfo": [
{
"icon": "assets/images/country/az.jpg",
"text": "Azərbaycan dili",
"code": "az",
"name": "Azerbaijani",
"storeViewCode": ""
},
{
"text": "English",
"icon": "assets/images/country/gb.png",
"name": "English",
"code": "en",
"storeViewCode": ""
},
{
"storeViewCode": "ru",
"text": "Русский",
"name": "Russian",
"icon": "assets/images/country/ru.png",
"code": "ru"
},
{
"name": "Turkish",
"storeViewCode": "tr",
"text": "Türkçe",
"icon": "assets/images/country/tr.png",
"code": "tr"
}
],
"paymentConfig": {
"excludedPaymentIds": [],
"EnableReview": true,
"EnableAlphanumericZipCode": false,
"EnableOnePageCheckout": true,
"CheckoutPageSlug": {"en": "checkout"},
"EnableRefundCancel": true,
"EnableCustomerNote": true,
"EnableCreditCard": false,
"GuestCheckout": true,
"EnableAddress": true,
"NativeOnePageCheckout": false,
"EnableShipping": true,
"allowSearchingAddress": true,
"SmartCOD": {"amountStop": 200, "enabled": false, "extraFee": 10},
"DefaultStateISOCode": "LA",
"RefundPeriod": 7,
"EnableAddressLocationNote": false,
"ShowOrderNotes": true,
"DefaultCountryISOCode": "AZ",
"UpdateOrderStatus": false
},
"payments": {
"paypal": "assets/icons/payment/paypal.svg",
"stripe_v2_google_pay": "https://i.imgur.com/XAGc92A.jpeg",
"stripe_v2_apple_pay": "https://i.imgur.com/dFQ8FKi.png",
"tap": "assets/icons/payment/tap.png",
"stripe": "assets/icons/payment/stripe.svg",
"razorpay": "assets/icons/payment/razorpay.svg"
},
"stripeConfig": {
"enabled": false,
"paymentMethodIds": ["stripe", "stripe"],
"enableApplePay": true,
"merchantCountryCode": "US",
"paymentMethodId": "stripe",
"serverEndpoint": "https://stripe-server-node.vercel.app",
"merchantDisplayName": "FluxStore",
"merchantIdentifier": "merchant.com.inspireui.mstore.flutter",
"publishableKey":
"pk_test_51HNabPCinksNdU0OwGkZ6uMdZOrLT42NGJkBxmVJwx3oM5mafpJaQRfDHifJMg2iREDZxbPkR1TvDtmBeTyjmgv200mCojR2dG",
"useV1": false,
"enableGooglePay": true,
"returnUrl": "fluxstore://inspireui.com",
"enableManualCapture": false
},
"paypalConfig": {
"secret":
"ECbFREri7NFj64FI_9WzS6A0Az2DqNLrVokBo0ZBu4enHZKMKOvX45v9Y1NBPKFr6QJv2KaSp5vk5A1G",
"nativeMode": false,
"paymentMethodId": "paypal",
"production": false,
"enabled": true,
"clientId":
"ASlpjFreiGp3gggRKo6YzXMyGM6-NwndBAQ707k6z3-WkSSMTPDfEFmNmky6dBX00lik8wKdToWiJj5w"
},
"razorpayConfig": {
"keyId": "rzp_test_SDo2WKBNQXDk5Y",
"enabled": true,
"keySecret": "RrgfT3oxbJdaeHSzvuzaJRZf",
"paymentMethodId": "razorpay"
},
"tapConfig": {
"paymentMethodId": "tap",
"SecretKey": "sk_test_XKokBfNWv6FIYuTMg5sLPjhJ",
"enabled": false
},
"mercadoPagoConfig": {
"production": false,
"enabled": true,
"paymentMethodId": "woo-mercado-pago-basic",
"accessToken":
"TEST-5726912977510261-102413-65873095dc5b0a877969b7f6ffcceee4-613803978"
},
"payTmConfig": {
"production": false,
"enabled": true,
"paymentMethodId": "paytm",
"merchantId": "your-merchant-id"
},
"payStackConfig": {
"enabled": true,
"production": false,
"paymentMethodId": "paystack",
"supportedCurrencies": ["ZAR"],
"publicKey": "pk_test_a1a37615c9ca90dead5dd84dedbb5e476b640a6f"
},
"flutterwaveConfig": {
"publicKey": "FLWPUBK_TEST-72b90e0734da8c9e43916adf63cd711e-X",
"production": false,
"enabled": true,
"paymentMethodId": "rave"
},
"myFatoorahConfig": {
"enabled": false,
"apiToken":
"rLtt6JWvbUHDDhsZnfpAhpYk4dxYDQkbcPTyGaKp2TYqQgG7FGZ5Th_WD53Oq8Ebz6A53njUoo1w3pjU1D4vs_ZMqFiz_j0urb_BH9Oq9VZoKFoJEDAbRZepGcQanImyYrry7Kt6MnMdgfG5jn4HngWoRdKduNNyP4kzcp3mRv7x00ahkm9LAK7ZRieg7k1PDAnBIOG3EyVSJ5kK4WLMvYr7sCwHbHcu4A5WwelxYK0GMJy37bNAarSJDFQsJ2ZvJjvMDmfWwDVFEVe_5tOomfVNt6bOg9mexbGjMrnHBnKnZR1vQbBtQieDlQepzTZMuQrSuKn-t5XZM7V6fCW7oP-uXGX-sMOajeX65JOf6XVpk29DP6ro8WTAflCDANC193yof8-f5_EYY-3hXhJj7RBXmizDpneEQDSaSz5sFk0sV5qPcARJ9zGG73vuGFyenjPPmtDtXtpx35A-BVcOSBYVIWe9kndG3nclfefjKEuZ3m4jL9Gg1h2JBvmXSMYiZtp9MR5I6pvbvylU_PP5xJFSjVTIz7IQSjcVGO41npnwIxRXNRxFOdIUHn0tjQ-7LwvEcTXyPsHXcMD8WtgBh-wxR8aKX7WPSsT1O8d8reb2aR7K3rkV3K82K_0OgawImEpwSvp9MNKynEAJQS6ZHe_J_l77652xwPNxMRTMASk1ZsJL",
"paymentMethodId": "myfatoorah_v2",
"accountCountry": "KW",
"production": false
},
"inAppPurchaseConfig": {
"subscriptionProductIDs": ["com.inspireui.fluxstore.subscription.test"],
"enabled": true,
"consumableProductIDs": ["com.inspireui.fluxstore.test"],
"nonConsumableProductIDs": []
},
"defaultCountryShipping": [],
"afterShip": {
"api": "e2e9bae8-ee39-46a9-a084-781d0139274f",
"tracking_url": "https://fluxstore.aftership.com"
},
"googleApiKey": {
"web": "AIzaSyDSNYVC-8DU9BTcyqkeN9c5pgVhwOBAvGg",
"android": "AIzaSyDSNYVC-8DU9BTcyqkeN9c5pgVhwOBAvGg",
"ios": "AIzaSyDSNYVC-8DU9BTcyqkeN9c5pgVhwOBAvGg"
},
"productDetail": {
"SliderShowGoBackButton": true,
"ForceWhiteBackground": false,
"showQuantityInList": false,
"showProductCategories": true,
"showVideo": true,
"AutoSelectFirstAttribute": true,
"showStockQuantity": true,
"hideInvalidAttributes": false,
"productImageLayout": "page",
"showSku": true,
"SliderIndicatorType": "number",
"autoPlayGallery": false,
"limitDayBooking": 14,
"attributeImagesSize": 50,
"showAddToCartInSearchResult": true,
"productListItemHeight": 125,
"height": 0.6,
"borderRadius": 3,
"showRelatedProduct": true,
"showRelatedProductFromSameStore": true,
"enableReview": true,
"showThumbnailAtLeast": 1,
"marginTop": 0,
"ShowSelectedImageVariant": true,
"ShowImageGallery": true,
"safeArea": false,
"showProductTags": true,
"layout": "simpleType"
},
"blogDetail": {
"showSharing": true,
"showHeart": true,
"enableAudioSupport": false,
"showTextAdjustment": true,
"showComment": true
},
"productVariantLayout": {
"size": "box",
"height": "option",
"color": "color",
"color-image": "image"
},
"productAddons": {
"allowVideoType": true,
"allowCustomType": true,
"fileUploadSizeLimit": 5,
"allowMultiple": false,
"allowImageType": true,
"allowedCustomType": ["png", "pdf", "docx"]
},
"cartDetail": {"minAllowTotalCartValue": 0, "maxAllowQuantity": 20},
"productVariantLanguage": {
"ar": {
"size": "بحجم",
"color-image": "اللون",
"height": "ارتفاع",
"color": "اللون"
},
"vi": {
"color": "Màu",
"height": "Chiều Cao",
"color-image": "Màu",
"size": "Kích thước"
},
"en": {
"height": "Height",
"color-image": "Color",
"size": "Size",
"color": "Color"
}
},
"excludedCategory": 311,
"saleOffProduct": {
"ShowCountDown": true,
"HideEmptySaleOffLayout": false,
"Color": "#C7222B"
},
"notStrictVisibleVariant": true,
"configChat": {
"UseRealtimeChat": false,
"version": "2",
"EnableSmartChat": true,
"showOnScreens": ["profile"],
"hideOnScreens": []
},
"smartChat": [
{
"iconData": "whatsapp",
"imageData": "https://i.imgur.com/tBE2iAn.png",
"app": "https://wa.me/+994506884408",
"description": "WhatsApp"
},
{
"iconData": "phone",
"app": "tel:+994506884408",
"description": "Zəng etmək"
}
],
"adminEmail": "admininspireui#gmail.com",
"adminName": "InspireUI",
"vendorConfig": {
"EnableAutoApplicationApproval": false,
"dokan": "my-account?vendor_admin=true",
"DisableDeliveryManagement": true,
"DisableVendorShipping": false,
"ExpandStoreLocationByDefault": true,
"DefaultStoreImage": "assets/images/default-store-banner.png",
"ShowAllVendorMarkers": true,
"wcfm": "store-manager?vendor_admin=true",
"DisableMultiVendorCheckout": false,
"DisableNativeStoreManagement": true,
"DisablePendingProduct": false,
"BannerFit": "cover",
"NewProductStatus": "draft",
"VendorRegister": true
},
"deliveryConfig": {
"enableSystemNotes": false,
"dashboardName1": "FluxStore",
"dashboardName2": "Delivery",
"appLogo": "assets/images/app_icon_transparent.png",
"appName": "FluxStore Delivery"
},
"managerConfig": {
"enableDeliveryFeature": false,
"appLogo": "assets/images/app_icon_transparent.png",
"appName": "FluxStore Admin"
},
"loadingIcon": {"type": "doubleBounce", "layout": "spinkit"},
"splashScreen": {
"type": "flare",
"paddingBottom": 0,
"animationName": "BEN\"O",
"backgroundColor": "#ffffff",
"duration": 2000,
"paddingTop": 0,
"paddingLeft": 0,
"boxFit": "contain",
"paddingRight": 0,
"enable": true,
"image":
"https://trello.com/1/cards/63d02a96e1774f2f698a187a/attachments/63d038558a12f82d3a6b12d2/download/logo.png"
},
"darkConfig": {
"primaryColorLight": "ff232323",
"MainColor": "ffffffff",
"backgroundColor": "ff232323",
"logo": "https://i.imgur.com/VuUCQJ2.png",
"textColor": "ffffffff"
},
"lightConfig": {
"logo": "https://i.imgur.com/QESdwM5.png",
"MainColor": "ff3fc1be"
},
"enableOnBoarding": true,
"addressFields": [
{
"position": 1,
"required": true,
"editable": true,
"type": "firstName",
"defaultValue": "",
"visible": true
},
{
"visible": true,
"defaultValue": "",
"editable": true,
"type": "lastName",
"position": 2,
"required": true
},
{
"visible": true,
"defaultValue": "",
"position": 3,
"required": true,
"editable": true,
"type": "phoneNumber"
},
{
"position": 4,
"editable": true,
"defaultValue": "",
"type": "email",
"required": true,
"visible": true
},
{"visible": true, "position": 5, "type": "searchAddress"},
{"type": "selectAddress", "visible": true, "position": 6},
{"type": "country", "visible": true, "position": 7},
{"visible": true, "position": 8, "type": "state"},
{
"editable": true,
"visible": true,
"position": 9,
"defaultValue": "",
"required": true,
"type": "city"
},
{
"visible": true,
"type": "apartment",
"editable": true,
"defaultValue": "",
"required": false,
"position": 10
},
{
"defaultValue": "",
"required": false,
"editable": true,
"position": 11,
"visible": true,
"type": "block"
},
{
"type": "street",
"editable": true,
"visible": true,
"position": 12,
"defaultValue": "",
"required": true
},
{
"editable": true,
"position": 13,
"visible": true,
"required": true,
"defaultValue": "",
"type": "zipCode"
}
],
"productCard": {
"showCartButtonWithQuantity": false,
"enableRating": true,
"showCartButton": false,
"hideStore": true,
"hideTitle": false,
"showCartIconColor": false,
"hidePrice": false,
"borderRadius": 3,
"showCartIcon": true,
"boxFit": "cover"
}
};
I bought the fluxstore program, connects via API to the WordPress site. The program works, but on the emulator it gives such an error.
FormatException (FormatException: Unexpected character (at character 1) ‰PNG ^ )
I deleted the entire image on the site but it didn't help. Deleted the Flutter project and reopened it. There are many solutions on the Internet, but I could not change my code in any way, I'm afraid to break the whole application. The program works on the web, but when I open it on the emulator, it gives the above error.

End of file expected.json line 21 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
Can someone correct my JSON code and tell me what I did wrong? When I try to use it, I get an error on line 21, and I don't know what to do.
This is my code:
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"code-runner.runInTerminal": true,
"explorer.confirmDelete": false,
"editor.linkedEditing": true,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"files.autoSaveDelay": 1,
"files.autoSave": "afterDelay",
"liveServer.settings.CustomBrowser": "firefox",
"tabnine.experimentalAutoImports": true,
"workbench.iconTheme": "easy-icons",
"workbench.colorTheme": "Field Lights",
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
}
}
{
"actionButtons": {
"defaultColor": "white",
"reloadButton": "Reload",
"commands": [
{
"name" : "Build",
"color": "white",
"command": "idf.py build"
},
{
"name" : "Run",
"color": "white",
"command": "idf.py flash -p COM1 -b 921600 monitor"
}
]
},
}
Thank you in advance!
You have a comma at the second last bracket.
It seems like you have 2 JSON objects as parents in the same file. I'm pretty sure that a JSON file only can have one parent/root that is either an object or an array.
This means that you will need to have two files instead of one.
One containing the first JSON object:
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"code-runner.runInTerminal": true,
"explorer.confirmDelete": false,
"editor.linkedEditing": true,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"files.autoSaveDelay": 1,
"files.autoSave": "afterDelay",
"liveServer.settings.CustomBrowser": "firefox",
"tabnine.experimentalAutoImports": true,
"workbench.iconTheme": "easy-icons",
"workbench.colorTheme": "Field Lights",
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
}
}
And another containing the second JSON object:
{
"actionButtons": {
"defaultColor": "white",
"reloadButton": "Reload",
"commands": [
{
"name" : "Build",
"color": "white",
"command": "idf.py build"
},
{
"name" : "Run",
"color": "white",
"command": "idf.py flash -p COM1 -b 921600 monitor"
}
]
}
}
You could also have it in the same file, but wrapped in another root/parent object, like this:
{
"object1": {
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"code-runner.runInTerminal": true,
"explorer.confirmDelete": false,
"editor.linkedEditing": true,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"files.autoSaveDelay": 1,
"files.autoSave": "afterDelay",
"liveServer.settings.CustomBrowser": "firefox",
"tabnine.experimentalAutoImports": true,
"workbench.iconTheme": "easy-icons",
"workbench.colorTheme": "Field Lights",
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
}
},
"object2": {
"actionButtons": {
"defaultColor": "white",
"reloadButton": "Reload",
"commands": [
{
"name" : "Build",
"color": "white",
"command": "idf.py build"
},
{
"name" : "Run",
"color": "white",
"command": "idf.py flash -p COM1 -b 921600 monitor"
}
]
}
}
}
Or do it as an array, like this:
[
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"code-runner.runInTerminal": true,
"explorer.confirmDelete": false,
"editor.linkedEditing": true,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"files.autoSaveDelay": 1,
"files.autoSave": "afterDelay",
"liveServer.settings.CustomBrowser": "firefox",
"tabnine.experimentalAutoImports": true,
"workbench.iconTheme": "easy-icons",
"workbench.colorTheme": "Field Lights",
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
}
},
{
"actionButtons": {
"defaultColor": "white",
"reloadButton": "Reload",
"commands": [
{
"name" : "Build",
"color": "white",
"command": "idf.py build"
},
{
"name" : "Run",
"color": "white",
"command": "idf.py flash -p COM1 -b 921600 monitor"
}
]
}
}
]

How to read value from JSON file in Angular11?

I want to read value from this JSON file in my Angular application, How can I do that?
(this JSON file is not inside the folder of my application). And I have another problem when I use Angular charts (Pie or LineChart...) in two components it worked in one component and not in the other What's the problem please?
{
"name": "Global Information",
"numberOfRequests": {
"total": 5,
"ok": 0,
"ko": 5
},
"minResponseTime": {
"total": 144,
"ok": 0,
"ko": 144
},
"maxResponseTime": {
"total": 146,
"ok": 0,
"ko": 146
},
"meanResponseTime": {
"total": 145,
"ok": 0,
"ko": 145
},
"standardDeviation": {
"total": 1,
"ok": 0,
"ko": 1
},
"percentiles1": {
"total": 145,
"ok": 0,
"ko": 145
},
"percentiles2": {
"total": 145,
"ok": 0,
"ko": 145
},
"percentiles3": {
"total": 146,
"ok": 0,
"ko": 146
},
"percentiles4": {
"total": 146,
"ok": 0,
"ko": 146
},
"group1": {
"name": "t < 800 ms",
"count": 0,
"percentage": 0
},
"group2": {
"name": "800 ms < t < 1200 ms",
"count": 0,
"percentage": 0
},
"group3": {
"name": "t > 1200 ms",
"count": 0,
"percentage": 0
},
"group4": {
"name": "failed",
"count": 5,
"percentage": 100
},
"meanNumberOfRequestsPerSecond": {
"total": 5.0,
"ok": 0,
"ko": 5.0
}
}
Just add "resolveJsonModule":true in you tsconfig file:
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"declaration": false,
"noImplicitAny": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"strictPropertyInitialization": false,
"target": "es2015",
"module": "es2020",
"lib": [
"es2018",
"dom"
],
"resolveJsonModule": true,
"esModuleInterop": true
},
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictTemplates": true
}
}
Now you can simply import your Json file anywhere.
Import { data } from 'path/to/json/file.json'

How to make design for pagination like below image in datatable jquery

I want to make pagination like this image using datatable Jquery. Please help me to make like this.
Image
here is my code:
$("#tblComplex").DataTable({
"destroy": true,
"serverSide": true,
"bRetrieve": true,
"searching": false,
"order": [0, "asc"],
"pagingType": "simple",
"dom": '<"wrapper"tilp>',
"language": {
"paginate": {
"next": '<span><img src="images/next.svg" alt="next-arrow" /></span>',
"previous": '<span><img src="images/previous.svg" alt="prev-arrow" /></span>'
}
},
//"pageLength": 5,
//"lengthMenu": [[5, 10, 20, -1], [5, 10, 20, 'Show All']],
"ajax": {
"url": "/Complex/GetComplexList",
"type": "Post",
"datatype": "json",
"dataSrc": "complexListData"
},
"columns": [
{ "title": "Id", "data": "id", "orderable": true, "visible": false },
{
"title": "Name", "data": "name", "orderable": true, "visible": true },
{ "title": "Address", "data": "address", "orderable": true, "visible": true }
]
});
I found a solution.
we have to add just class name of css.
for example:
page 1 from 10
we have to define this in dom
"dom": '<"class1"<"class2"i>>

linking JSON to html for using particles.js does not work

I have downloaded the JSON library configuaration from this website : https://vincentgarreau.com/particles.js/#default. I am new to JSON and therefore I dont understand what has gone wrong. When I compile only a blue screen pops up on my browser, which means that only css plays. Could someone please help me understand what has gone wrong? I am sorry for the long post, but I honestly dont know how else to fit it so that I can give a clear picture of what I am doing.
This is my HTML file called particles.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="particles.js"></script>
<link href="particles.css" rel="stylesheet" type="text/css">
</head>
<body id="particles-js">
<script type="text/javascript">
particlesJS("particles-js",<strong>particlesjs-config.json</strong>);
</script>
</body>
</html>
This is my CSS file called particles.css
body{
background: cornflowerblue;
}
And this is the JSON configuration I downloaded. The file is called particlesjs-config.json
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#ffffff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 3,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#ffffff",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}
See this page
https://github.com/VincentGarreau/particles.js
It looks like you're loading the JSON file incorrectly. Should be similar to this
<script>
particlesJS.load('particles-js', 'particles.json', function(){
console.log('particles.json loaded...do your thing!');
});
</script>