Skip to content

Extends does not work for Syntastic Pug Linter unless you have the packages installed globally #186

Open
@titanism

Description

@titanism

In the code for lib/utils.js the linter right now uses resolve (the package) to resolve the package.

  _resolveExtendsFile: function (filePath) {
    if (isAbsolutePath(filePath) || !/\w|@/.test(filePath.charAt(0))) {
      filePath = path.resolve(this._basePath, filePath);

      if (!fs.existsSync(filePath)) {
        throw new Error('Cannot find configuration file "' + filePath + '" to extend');
      }
    } else {
      var packageName = utils.normalizePackageName(filePath, 'pug-lint-config');
      try {
        filePath = resolve.sync(packageName);
      } catch (err) {
        throw new Error('Cannot find module "' + packageName + '" to extend');
      }
    }

    return filePath;
  }

Because it is using resolve.sync it will not find the locally installed package in the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions