ota-meshi / eslint-plugin-yml

This ESLint plugin provides linting rules for YAML.
https://ota-meshi.github.io/eslint-plugin-yml/
MIT License
113 stars 13 forks source link

Incorrect fix for certain array of objects #314

Closed deathemperor closed 5 months ago

deathemperor commented 5 months ago

Playground

yml with error:

- kind: postgres
  name: apple
  configuration:
    connection_info:
      database_url:
        from_env: APPLE_DATABASE_URL
      isolation_level: read-committed
      pool_settings:
        connection_lifetime: 600
        max_connections: 26
        total_max_connections: 78
      use_prepared_statements: false
  tables: "!include apple/tables/tables.yaml"

result: incorrect yml format, notice kind: postgres has wrong indentation 1 space instead of 2

- configuration:
    connection_info:
      database_url:
        from_env: APPLE_DATABASE_URL
      isolation_level: read-committed
      pool_settings:
        connection_lifetime: 600
        max_connections: 26
        total_max_connections: 78
      use_prepared_statements: false

 kind: postgres
  name: apple
  tables: "!include apple/tables/tables.yaml"