ronparkdev / eslint-plugin-sort-annotation

Lint rule for sort the value or properties if it has @sort or @sort-keys annotation
13 stars 2 forks source link

Sort objects keys without need for `const` #7

Open KnifeFed opened 1 year ago

KnifeFed commented 1 year ago

Currently, none of these scenarios do anything for me:

// @sort-keys:deep
export default defineNuxtConfig({
  typescript: {
    tsConfig: {
      compilerOptions: {
        moduleResolution: 'bundler',
      },
    },
    typeCheck: true,
    strict: true,
  },
})
export default defineNuxtConfig(
  // @sort-keys:deep
  {
    typescript: {
      tsConfig: {
        compilerOptions: {
          moduleResolution: 'bundler',
        },
      },
      typeCheck: true,
      strict: true,
    },
  }
)
export default defineNuxtConfig({
  // @sort-keys:deep
  typescript: {
    tsConfig: {
      compilerOptions: {
        moduleResolution: 'bundler',
      },
    },
    typeCheck: true,
    strict: true,
  },
})
export default defineNuxtConfig({
  typescript:
    // @sort-keys:deep
    {
      tsConfig: {
        compilerOptions: {
          moduleResolution: 'bundler',
        },
      },
      typeCheck: true,
      strict: true,
    },
})

It would be nice if sorting worked in these cases.

ronparkdev commented 1 year ago

Hi KnifeFed, I think sorting outside of const is an important feature. I'll see if I can figure out how to cover that safely.