question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Betterer vscode extension fails to display problems

See original GitHub issue

We have a test which counts remaining js files in our project, which appears to work correctly when running yarn betterer, however when executed by the vscode extension, betterer fails to report problems. If I add a console.log to the .betterer.ts below, it does appear to be running, but no output appears either inline or in problems and no errors are reported.

.betterer.ts

import { typescriptBetterer } from "@betterer/typescript";
import { regexpBetterer } from "@betterer/regexp";
import { smaller } from "@betterer/constraints";

const { execSync } = require("child_process");

const jsFileCount = parseInt(execSync(
  'find . -type f -name "*.js" -not -path "./node_modules/*" | wc -l',
  { encoding: "utf8" }
)
  .replace("\n", "")
  .trim());

export default {
  "stricter compilation": typescriptBetterer("./tsconfig.json", {
    strict: true,
  }),
  "no TSFixMe types": regexpBetterer("**/*.ts", /(\s*TSFixMe)/i),
  "migrate js files to ts": {
    test: () => jsFileCount,
    constraint: smaller,
    goal: 0,
  },
};

Code: 1.46.1 Betterer extension: 1.2.0 Betterer: 3.0.0 MacOS: 10.15.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
phenomnomnominalcommented, Jul 7, 2020

Ahh, sorry I misunderstood that! I’ll give it a go and try to reproduce it!

This is our test by the way:

import {
  BettererFileTest,
  BettererFileIssuesMapRaw,
  BettererFileResolver,
} from '@betterer/betterer';
import * as fs from 'fs';

export function noGlobMatches(
  message: string,
): BettererFileTest {
  return new BettererFileTest(new BettererFileResolver(), async files => {
    const issues: BettererFileIssuesMapRaw = {};
    files.forEach(filePath => {
      issues[filePath] = [
        {
          message,
          filePath,
          fileText: fs.readFileSync(filePath, 'utf-8'),
          start: 0,
          end: 1,
          hash: message,
        },
      ];
    });
    return issues;
  });
}
0reactions
phenomnomnominalcommented, Mar 9, 2021

Duplicate of #224

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSC extension never showing a result · Issue #224 - GitHub
I tried the extension after #210 got merged (I'm now on 3.0.2) and I never get ... Betterer vscode extension fails to display...
Read more >
Betterer VS Code - Visual Studio Marketplace
Extension for Visual Studio Code - VSCode extension for ... VS Code screen capture output showing Betterer highlighting issues in a project.
Read more >
Troubleshoot Terminal launch failures - Visual Studio Code
Some terminal launch failures may be due to your shell installation and are not specific to VS Code. The exit codes displayed come...
Read more >
Managing Extensions in Visual Studio Code
VS Code makes it easy to manage your extensions. You can install, disable, update, and uninstall extensions through the Extensions view, the Command...
Read more >
Visual Studio Code extension bisect utility
Open the Extensions view (Ctrl+Shift+X), disable an extension, reload the window (Developer: Reload Window), and check to see if the problem ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found