1.0.10 ā€¢ Published 1 year ago

eslint-plugin-gdx-lint v1.0.10

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

gdx-lint/vue-setup-sorting

Rule that warns if Vue setup script sorted in a wrong way. šŸ”§ This rule is NOT automatically fixable by the --fix CLI option.

Fail

const fuf = computed(() => store.payment.fuf);
const some = ref(''); // `some` should appear after Const, Props, Emit, ref in the script tag.

Pass

const MAGIC_NUMBER = 100000000000;
defineProps();
defineEmits();

const some = ref('');
const fuf = computed<string>(() => store.payment.fuf);

function someFunction(): void {
    // ...
}
const { doSomeLogic } = useSomeHook();
onMounted(() => someFunction());
someFunction();

Options

This rule supports the following options:

order: [array]:

The default order is ["const", "props", "emits", "ref", "computed", "function", "hook", "lifeCycleHook"].

You can set the options like this:

"gdx-lint/vue-setup-sorting": [
  1, // warning
  {
    "order": [
        "const",
        "props",
        "emits",
        "ref",
        "computed",
        "function",
        "hook",
        "lifeCycleHook"
    ]
  }
]
1.0.9

1 year ago

1.0.8

1 year ago

1.0.10

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago