How to use the eslint-plugin-vue/lib/utils/casing.getConverter function in eslint-plugin-vue

To help you get started, we’ve selected a few eslint-plugin-vue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github learningequality / kolibri / packages / eslint-plugin-kolibri / lib / rules / vue-component-registration-casing.js View on Github external
function create(context) {
  const selectedCase = context.options[0];
  const caseType =
    allowedCaseOptions.indexOf(selectedCase) !== -1 ? selectedCase : allowedCaseOptions[0];
  const converter = casing.getConverter(caseType);

  return utils.executeOnVue(context, obj => {
    const node = obj.properties.find(
      p =>
        p.type === 'Property' &&
        p.key.type === 'Identifier' &&
        p.key.name === 'components' &&
        p.value.type === 'ObjectExpression'
    );

    if (!node) {
      return;
    }

    const items = node.value.properties;
    for (const item of items) {