Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
titanism opened this issue Jun 11, 2022 · 0 comments

Comments

@titanism
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant