Mqtt configuration issue

Hoping someone can help me get an issue straightened out that I don’t really know what to do to fix.

Essentially I am trying to use a energy monitoring outlet with a washing machine to track its status.

I have the configuration including mqtt sensors inside of a package file within the “packages” directory and have it pulled into my configuration.yaml with the !include statement.

packages: !include_dir_named packages

Below is a screenshot of what I am getting within the package file in Visual Studio Code. It says "String does not match the pattern of “DEPRECATED^”. (Below this area I have also written it in the “new” way but have it commented out as you will see in the screenshot.–it has the header key of mqtt:)

The first question I will ask is, will this code (pasted below) work as it is ? The configuration check is going to “valid” so it makes me think I can leave it as is?

sensor:
  # # MQTT Sensor for DishWasher Status.  
  # - platform: mqtt
  #   name: "DishWasher Status"
  #   state_topic: "house/dishwasher/status"
  # MQTT Sensor for Washing Machine Status. 
  - platform: mqtt
    name: "Washer Status"
    state_topic: "house/washer/status"
  - platform: mqtt
    name: "Washer Last Complete"
    state_topic: "house/washer/time_complete"
  - platform: mqtt
    name: "Washer Last Emptied"
    state_topic: "house/washer/time_emptied"

When I try to use the new mqtt sensor method. The configuration doesn’t go to “valid”. Is it because it has the key “mqtt:”? What is my best way forward if I want to use the new code method when I have package files that have sensors in them (mqtt sensors as in the old code style are scattered throughout)?-- I hear/ read this is going to be a “have to” at version 2022.9 of home assistant.

Do I essentially need to create a mqtt area (or “key” I guess it’s called) in every package file that contains mqtt sensors and pull the current mqtt sensors out of the “sensors” key that exist in each file in the current version?

mqtt:
#   # # MQTT Sensor for DishWasher Status.  
#   # - platform: mqtt
#   #   name: "DishWasher Status"
#   #   state_topic: "house/dishwasher/status"
#   # MQTT Sensor for Washing Machine Status. 
#   sensor:
#     - name: "Washer Status"
#       state_topic: "house/washer/status"
#     - name: "Washer Last Complete"
#       state_topic: "house/washer/time_complete"
#     - name: "Washer Last Emptied"
#       state_topic: "house/washer/time_emptied"

yes, all you need is

mqtt:
  sensor:
    - name: "Washer Status"
      state_topic: "house/washer/status"
    - name: "Washer Last Complete"
      state_topic: "house/washer/time_complete"
    - name: "Washer Last Emptied"
      state_topic: "house/washer/time_emptied"

I appreciate your response @petro and I understand. Thank you!!