How to use the eslint-plugin-vue/lib/utils.iterateProperties 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-no-unused-methods.js View on Github external
eslintPluginVueUtils.executeOnVue(context, obj => {
      unusedProperties = Array.from(
        eslintPluginVueUtils.iterateProperties(obj, new Set([GROUP_METHODS]))
      );

      remove(unusedProperties, property => {
        return (
          thisExpressionsVariablesNames.includes(property.name) ||
          befoureRouteEnterInstanceProperties.includes(property.name) ||
          watchStringMethods.includes(property.name)
        );
      });

      if (!hasTemplate && unusedProperties.length) {
        utils.reportUnusedProperties(context, unusedProperties, disabledLines);
      }
    })
  );
github learningequality / kolibri / packages / eslint-plugin-kolibri / lib / utils.js View on Github external
getWatchersNames(obj) {
    const watchers = Array.from(
      eslintPluginVueUtils.iterateProperties(obj, new Set([GROUP_WATCH]))
    );
    return watchers.map(watcher => watcher.name);
  },
github learningequality / kolibri / packages / eslint-plugin-kolibri / lib / rules / vue-no-unused-translations.js View on Github external
eslintPluginVueUtils.executeOnVue(context, obj => {
      definitionNodes = Array.from(
        eslintPluginVueUtils.iterateProperties(obj, new Set([GROUP_$TRS]))
      );

      if (!hasTemplate) {
        utils.reportUnusedTranslations(context, definitionNodes, usedStrings);
      }
    })
  );
github learningequality / kolibri / packages / eslint-plugin-kolibri / lib / rules / vue-no-unused-properties.js View on Github external
eslintPluginVueUtils.executeOnVue(context, obj => {
      unusedProperties = Array.from(
        eslintPluginVueUtils.iterateProperties(
          obj,
          new Set([GROUP_PROPS, GROUP_DATA, GROUP_COMPUTED])
        )
      );

      const watchersNames = utils.getWatchersNames(obj);

      remove(unusedProperties, property => {
        return (
          thisExpressionsVariablesNames.includes(property.name) ||
          befoureRouteEnterInstanceProperties.includes(property.name) ||
          watchersNames.includes(property.name)
        );
      });

      if (!hasTemplate && unusedProperties.length) {