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

VSCode extension feels slow, especially compared to eslint #1171

Open
tarngerine opened this issue Aug 23, 2023 · 0 comments
Open

VSCode extension feels slow, especially compared to eslint #1171

tarngerine opened this issue Aug 23, 2023 · 0 comments

Comments

@tarngerine
Copy link

tarngerine commented Aug 23, 2023

Describe the bug
I only have a single eslint rule, which runs very quickly in eslint. Porting it over to betterer, it runs way slower in VSCode.

Also, it only runs on save — eslint runs as you type

To Reproduce

betterer.ts:

import { eslint } from "@betterer/eslint";

export default {
  "require JSDoc for exports": () =>
    eslint({
      "jsdoc/require-jsdoc": [
        "warn",
        {
          publicOnly: true,
          require: {
            ArrowFunctionExpression: true,
            ClassDeclaration: true,
            ClassExpression: true,
            FunctionDeclaration: true,
            FunctionExpression: true,
            MethodDefinition: true,
          },
          contexts: [
            'CallExpression[callee.name="observer"]', // observer(SomeComponent)
            'CallExpression[callee.name="suspenseObserver"]', // suspenseObserver(SomeComponent)
            'MemberExpression[object.name="React"][property.name="forwardRef"]', // React.forwardRef
            'MemberExpression[object.name="React"][property.name="createContext"]', // React.createContext
            'Identifier[name="styled"]', // styled.div, styled()
            "TSInterfaceDeclaration", // interface
            "TSTypeAliasDeclaration", // type
            "TSEnumDeclaration", // enum
          ],
          enableFixer: false,
        },
      ],
    }).include("./client/src/**/*.{ts,tsx}"),
};

Expected behavior
To be as fast as eslint:

CleanShot.2023-08-23.at.12.01.04.mp4

Actual behavior
Takes a split second longer, and also requires saving

CleanShot.2023-08-23.at.11.58.27.mp4

Versions (please complete the following information):

  • OS: MacOS Ventura latest
  • Betterer Version: 4.5.0
  • Node Version 18.17.0
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