Skip to content

Ideas about how to significantly improve performance #201

Open
@SukkaW

Description

@SukkaW

Currently, when eslint-plugin-import-x finds an import, it will resolve the real path of the module (through the eslint import resolvers), read the file, and then parse the module into the AST using the configured parsers (import-x/parser) or the default parser (ruleContext.parserPath). Then eslint-plugin-import-x tried to extract all exports/imports by walking through AST.

Parse any referenced modules are very heavy tasks, resulting eslint-plugin-import-x being slow. But if we use something like es-module-lexer or cjs-module-lexer to scan the imports/exports we skip the entire parsing-into-AST process and significantly improve performance for a few rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions