leo-buneev / eslint-plugin-sort-keys-fix

Fork of https://eslint.org/docs/rules/sort-keys that allows automatic fixing
95 stars 22 forks source link

Conflict with vue/order-in-components rule #38

Closed iliubinskii closed 5 months ago

iliubinskii commented 2 years ago

Thx for the plugin.

This pluging conflicts with this Vue rule: https://eslint.vuejs.org/rules/order-in-components.html

For example, Vue rule puts "name" property above "component" property.

Vue rule sorts ONLY default export.

So, the conflict could be fixed by adding option "ignoreDefaultExport".

Foexl commented 5 months ago

@iliubinskii Have you found a solution?

iliubinskii commented 5 months ago

You can try my rule: https://iliubinskii.github.io/eslint-plugin-misc/sort-keys.html

        "misc/sort-keys": [
          "warn",
          {
            overrides: [
              {
                _id: "defineComponent",
                customOrder: [
                  "name",
                  "functional",
                  "components",
                  "directives",
                  "inheritAttrs",
                  "props",
                  "emits",
                  "setup",
                  "template"
                ],
                selector:
                  "CallExpression[callee.name=defineComponent] > ObjectExpression"
              }
            ]
          }
        ]