eslint-plugin-gdx-lint
v1.0.10
Published
Rule that warns if Vue setup script sorted in a wrong way. 🔧 This rule is NOT automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
Downloads
5
Readme
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"
]
}
]