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

Update dependency prettier to v3 #473

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 6, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
prettier (source) 2.8.4 -> 3.0.2 age adoption passing confidence

Release Notes

prettier/prettier (prettier)

v3.0.2

Compare Source

diff

Break after = of assignment if RHS is poorly breakable AwaitExpression or YieldExpression (#​15204 by @​seiyab)
// Input
const { section, rubric, authors, tags } = await utils.upsertCommonData(mainData);

// Prettier 3.0.1
const { section, rubric, authors, tags } = await utils.upsertCommonData(
  mainData,
);

// Prettier 3.0.2
const { section, rubric, authors, tags } =
  await utils.upsertCommonData(mainData);
Do not add trailing comma for grouped scss comments (#​15217 by @​auvred)
/* Input */
$foo: (
	'property': (),
	// comment 1
	// comment 2
)

/* Prettier 3.0.1 */
$foo: (
  "property": (),
  // comment 1
  // comment 2,
);

/* Prettier 3.0.2 */
$foo: (
  "property": (),
  // comment 1
  // comment 2
);
Print declare and export keywords for nested namespace (#​15249 by @​sosukesuzuki)
// Input
declare namespace abc1.def {}
export namespace abc2.def {}

// Prettier 3.0.1
namespace abc1.def {}
namespace abc2.def {}

// Prettier 3.0.2
declare namespace abc1.def {}
export namespace abc2.def {}

v3.0.1

Compare Source

diff

Fix cursor positioning for a special case (#​14812 by @​fisker)
// <|> is the cursor position

/* Input */
// All messages are represented in JSON.
// So, the prettier.py controls a subprocess which spawns "node {this_file}".
import {<|>  } from "fs"

/* Prettier 3.0.0 */
// All messages are represented in JSON.
// So, the prettier.py <|>controls a subprocess which spawns "node {this_file}".
import {} from "fs"

/* Prettier 3.0.1 */
// All messages are represented in JSON.
// So, the prettier.py controls a subprocess which spawns "node {this_file}".
import {<|>} from "fs"
Fix plugins/estree.d.ts to make it a module (#​15018 by @​kingyue737)

Add export {} in plugins/estree.d.ts to fix the "File is not a module" error

Add parenthesis around leading multiline comment in return statement (#​15037 by @​auvred)
// Input
function fn() {
  return (
    /**
     * @&#8203;type {...}
     */ expresssion
  )
}

// Prettier 3.0.0
function fn() {
  return /**
   * @&#8203;type {...}
   */ expresssion;
}

// Prettier 3.0.1
function fn() {
  return (
    /**
     * @&#8203;type {...}
     */ expresssion
  );
}
Add support for Vue "Generic Components" (#​15066 by @​auvred)

https://blog.vuejs.org/posts/vue-3-3#generic-components

<!-- Input -->
<script setup lang="ts" generic="T extends Type1 & Type2 & (Type3 | Type4), U extends string | number | boolean"></script>

<!-- Prettier 3.0.0 -->
<script
  setup
  lang="ts"
  generic="T extends Type1 & Type2 & (Type3 | Type4), U extends string | number | boolean"
></script>

<!-- Prettier 3.0.1 -->
<script
  setup
  lang="ts"
  generic="
    T extends Type1 & Type2 & (Type3 | Type4),
    U extends string | number | boolean
  "
></script>
Fix comments print in IfStatement (#​15076 by @​fisker)
function a(b) {
  if (b) return 1; // comment
  else return 2;
}

/* Prettier 3.0.0 */
Error: Comment "comment" was not printed. Please report this error!

/* Prettier 3.0.1 */
function a(b) {
  if (b) return 1; // comment
  else return 2;
}
Add missing type definition for printer.preprocess (#​15123 by @​so1ve)
export interface Printer<T = any> {
  // ...
+ preprocess?:
+   | ((ast: T, options: ParserOptions<T>) => T | Promise<T>)
+   | undefined;
}
Add missing getVisitorKeys method type definition for Printer (#​15125 by @​auvred)
const printer: Printer = {
  print: () => [],
  getVisitorKeys(node, nonTraversableKeys) {
    return ["body"];
  },
};
Add typing to support readonly array properties of AST Node (#​15127 by @​auvred)
// Input
interface TestNode {
  readonlyArray: readonly string[];
}

declare const path: AstPath<TestNode>;

path.map(() => "", "readonlyArray");

// Prettier 3.0.0
interface TestNode {
  readonlyArray: readonly string[];
}

declare const path: AstPath<TestNode>;

path.map(() => "", "readonlyArray");
//                  ^ Argument of type '"readonlyArray"' is not assignable to parameter of type '"regularArray"'. ts(2345)

// Prettier 3.0.1
interface TestNode {
  readonlyArray: readonly string[];
}

declare const path: AstPath<TestNode>;

path.map(() => "", "readonlyArray");
Add space before unary minus followed by a function call (#​15129 by @​pamelalozano)
// Input
div {
  margin: - func();
}

// Prettier 3.0.0
div {
  margin: -func();
}

// Prettier 3.0.1
div {
  margin: - func();
}

v3.0.0

Compare Source

diff

🔗 Release Notes

v2.8.8

Compare Source

This version is a republished version of v2.8.7.
A bad version was accidentally published and it can't be unpublished, apologies for the churn.

v2.8.7

Compare Source

diff

Allow multiple decorators on same getter/setter (#​14584 by @​fisker)
// Input
class A {
  @&#8203;decorator()
  get foo () {}
  
  @&#8203;decorator()
  set foo (value) {}
}

// Prettier 2.8.6
SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3)
  3 |   get foo () {}
  4 |   
> 5 |   @&#8203;decorator()
    |   ^^^^^^^^^^^^
  6 |   set foo (value) {}
  7 | }

// Prettier 2.8.7
class A {
  @&#8203;decorator()
  get foo() {}

  @&#8203;decorator()
  set foo(value) {}
}

v2.8.6

Compare Source

diff

Allow decorators on private members and class expressions (#​14548 by @​fisker)
// Input
class A {
  @&#8203;decorator()
  #privateMethod () {}
}

// Prettier 2.8.5
SyntaxError: Decorators are not valid here. (2:3)
  1 | class A {
> 2 |   @&#8203;decorator()
    |   ^^^^^^^^^^^^
  3 |   #privateMethod () {}
  4 | }

// Prettier 2.8.6
class A {
  @&#8203;decorator()
  #privateMethod() {}
}

v2.8.5

Compare Source

diff

Support TypeScript 5.0 (#​14391 by @​fisker, #​13819 by @​fisker, @​sosukesuzuki)

TypeScript 5.0 introduces two new syntactic features:

  • const modifiers for type parameters
  • export type * declarations
Add missing parentheses for decorator (#​14393 by @​fisker)
// Input
class Person {
  @&#8203;(myDecoratorArray[0])
  greet() {}
}

// Prettier 2.8.4
class Person {
  @&#8203;myDecoratorArray[0]
  greet() {}
}

// Prettier 2.8.5
class Person {
  @&#8203;(myDecoratorArray[0])
  greet() {}
}
Add parentheses for TypeofTypeAnnotation to improve readability (#​14458 by @​fisker)
// Input
type A = (typeof node.children)[];

// Prettier 2.8.4
type A = typeof node.children[];

// Prettier 2.8.5
type A = (typeof node.children)[];
Support max_line_length=off when parsing .editorconfig (#​14516 by @​josephfrazier)

If an .editorconfig file is in your project and it sets max_line_length=off for the file you're formatting,
it will be interpreted as a printWidth of Infinity rather than being ignored
(which previously resulted in the default printWidth of 80 being applied, if not overridden by Prettier-specific configuration).

<!-- Input -->
<div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/>

<!-- Prettier 2.8.4 -->
<div
  className="HelloWorld"
  title={`You are visitor number ${num}`}
  onMouseOver={onMouseOver}
/>;

<!-- Prettier 2.8.5 -->
<div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />;

Configuration

📅 Schedule: Branch creation - "after 7am and before 11am every weekday" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from a team as a code owner July 6, 2023 08:21
@renovate renovate bot added the dependencies Pull requests that update a dependency file label Jul 6, 2023
@hmcts-platform-operations

Plan Result (sbox-00-genesis)

No changes. Your infrastructure matches the configuration.

@hmcts-platform-operations

Plan Result (sbox-07-network-rg)

No changes. Your infrastructure matches the configuration.

@hmcts-platform-operations

Plan Result (sbox-01-network)

Plan: 1 to add, 0 to change, 0 to destroy.
  • Create
    • azurerm_private_dns_zone_virtual_network_link.private_endpoint["privatelink.azurewebsites.net"]
Change Result (Click me)
  # azurerm_private_dns_zone_virtual_network_link.private_endpoint["privatelink.azurewebsites.net"] will be created
  + resource "azurerm_private_dns_zone_virtual_network_link" "private_endpoint" {
      + id                    = (known after apply)
      + name                  = "sssbox"
      + private_dns_zone_name = "privatelink.azurewebsites.net"
      + registration_enabled  = false
      + resource_group_name   = "core-infra-intsvc-rg"
      + tags                  = {
          + "application"  = "core"
          + "builtFrom"    = "hmcts/aks-sds-deploy"
          + "businessArea" = "Cross-Cutting"
          + "criticality"  = "Low"
          + "environment"  = "sandbox"
          + "expiresAfter" = "3000-01-01"
        }
      + virtual_network_id    = "/subscriptions/a8140a9e-f1b0-481f-a4de-09e2ee23f7ab/resourceGroups/ss-sbox-network-rg/providers/Microsoft.Network/virtualNetworks/ss-sbox-vnet"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

@hmcts-platform-operations

Plan Result (sbox-05-mis)

Plan: 1 to add, 0 to change, 0 to destroy.
  • Create
    • azurerm_role_assignment.log_analytics_role_aks_sp
Change Result (Click me)
  # azurerm_role_assignment.log_analytics_role_aks_sp will be created
  + resource "azurerm_role_assignment" "log_analytics_role_aks_sp" {
      + id                               = (known after apply)
      + name                             = (known after apply)
      + principal_id                     = (sensitive value)
      + principal_type                   = (known after apply)
      + role_definition_id               = (known after apply)
      + role_definition_name             = "Log Analytics Contributor"
      + scope                            = "/subscriptions/bf308a5c-0624-4334-8ff8-8dca9fd43783/resourceGroups/oms-automation/providers/Microsoft.OperationalInsights/workspaces/hmcts-sandbox"
      + skip_service_principal_aad_check = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

@hmcts-platform-operations

Plan Result (sbox-aks)

Plan: 0 to add, 2 to change, 0 to destroy.
  • Update
    • module.kubernetes["00"].azurerm_monitor_diagnostic_setting.kubernetes_cluster_diagnostic_setting[0]
    • module.kubernetes["01"].azurerm_monitor_diagnostic_setting.kubernetes_cluster_diagnostic_setting[0]
Change Result (Click me)
  # module.kubernetes["00"].azurerm_monitor_diagnostic_setting.kubernetes_cluster_diagnostic_setting[0] will be updated in-place
  ~ resource "azurerm_monitor_diagnostic_setting" "kubernetes_cluster_diagnostic_setting" {
        id                             = "/subscriptions/a8140a9e-f1b0-481f-a4de-09e2ee23f7ab/resourceGroups/ss-sbox-00-rg/providers/Microsoft.ContainerService/managedClusters/ss-sbox-00-aks|DiagLogAnalytics"
      + log_analytics_destination_type = "AzureDiagnostics"
        name                           = "DiagLogAnalytics"
        # (2 unchanged attributes hidden)

      - log {
          - category = "cloud-controller-manager" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "cluster-autoscaler" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "csi-azuredisk-controller" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "csi-azurefile-controller" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "csi-snapshot-controller" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "guard" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-apiserver" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-audit" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-audit-admin" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-controller-manager" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-scheduler" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      + log {
          + category = "cluster-autoscaler"
          + enabled  = true
        }
      + log {
          + category = "guard"
          + enabled  = true
        }
      + log {
          + category = "kube-apiserver"
          + enabled  = true
        }
      + log {
          + category = "kube-audit-admin"
          + enabled  = false
        }
      + log {
          + category = "kube-controller-manager"
          + enabled  = true
        }
      + log {
          + category = "kube-scheduler"
          + enabled  = true
        }

        # (6 unchanged blocks hidden)
    }

  # module.kubernetes["01"].azurerm_monitor_diagnostic_setting.kubernetes_cluster_diagnostic_setting[0] will be updated in-place
  ~ resource "azurerm_monitor_diagnostic_setting" "kubernetes_cluster_diagnostic_setting" {
        id                             = "/subscriptions/a8140a9e-f1b0-481f-a4de-09e2ee23f7ab/resourceGroups/ss-sbox-01-rg/providers/Microsoft.ContainerService/managedClusters/ss-sbox-01-aks|DiagLogAnalytics"
      + log_analytics_destination_type = "AzureDiagnostics"
        name                           = "DiagLogAnalytics"
        # (2 unchanged attributes hidden)

      - log {
          - category = "cloud-controller-manager" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "cluster-autoscaler" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "csi-azuredisk-controller" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "csi-azurefile-controller" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "csi-snapshot-controller" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "guard" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-apiserver" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-audit" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-audit-admin" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-controller-manager" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      - log {
          - category = "kube-scheduler" -> null
          - enabled  = true -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }
      + log {
          + category = "cluster-autoscaler"
          + enabled  = true
        }
      + log {
          + category = "guard"
          + enabled  = true
        }
      + log {
          + category = "kube-apiserver"
          + enabled  = true
        }
      + log {
          + category = "kube-audit-admin"
          + enabled  = false
        }
      + log {
          + category = "kube-controller-manager"
          + enabled  = true
        }
      + log {
          + category = "kube-scheduler"
          + enabled  = true
        }

        # (6 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

@renovate renovate bot changed the title fix(deps): update dependency prettier to v3 Update dependency prettier to v3 Jul 13, 2023
@renovate renovate bot force-pushed the renovate/prettier-3.x branch from d6eb5c1 to 691ab3e Compare August 3, 2023 08:07
@hmcts-platform-operations

Plan Result (Genesis)

No changes. Your infrastructure matches the configuration.

@hmcts-platform-operations
Copy link

hmcts-platform-operations commented Aug 3, 2023

Plan Result (Network)

No changes. Your infrastructure matches the configuration.

@hmcts-platform-operations
Copy link

hmcts-platform-operations commented Aug 3, 2023

Plan Result (Managed_Identity)

Plan: 0 to add, 1 to change, 0 to destroy.
  • Update
    • azurerm_resource_group.application-mi
Change Result (Click me)
  # azurerm_resource_group.application-mi will be updated in-place
  ~ resource "azurerm_resource_group" "application-mi" {
        id       = "/subscriptions/a8140a9e-f1b0-481f-a4de-09e2ee23f7ab/resourceGroups/managed-identities-sbox-rg"
        name     = "managed-identities-sbox-rg"
      ~ tags     = {
          + "application"  = "core"
          + "builtFrom"    = "hmcts/aks-sds-deploy"
          + "businessArea" = "Cross-Cutting"
          + "criticality"  = "Low"
          + "environment"  = "sandbox"
          + "expiresAfter" = "3000-01-01"
          + "startupMode"  = "always"
        }
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

@hmcts-platform-operations
Copy link

hmcts-platform-operations commented Aug 3, 2023

Plan Result (Aks)

No changes. Your infrastructure matches the configuration.

@renovate
Copy link
Contributor Author

renovate bot commented Aug 29, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants