Is states.light Still Correct Format?

I am in the process of updating my template sensors to the new recommended format. I have a sensor that uses states.light to provide a count of lights that are currently on. Is states.light still the appropriate way to do this or is there a newer way perhaps using the states() format?

- name: Custom All Light Status
    unique_id: custom_all_light_status
    state: >-
      {{ states.light
                | rejectattr('attributes.entity_id','defined')
                | selectattr('state', 'eq', 'on')
                | list | count }}

Yes. It selects the State objects of all light entities.

states() is a function to get the state value of a specific entity. For example:

{{ states('light.kitchen') }}

Reference:
Templating - States