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

Ignore node_modules #54

Open
mleonhard-notion opened this issue Aug 9, 2024 · 0 comments
Open

Ignore node_modules #54

mleonhard-notion opened this issue Aug 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mleonhard-notion
Copy link

HI @glato,
Thanks for making emerge. I'm trying to use it on our large TypeScript codebase (>10k files). I need to exclude 150k third-party imported files which are stored in node_modules directories.

When node_modules files are included, the graph structure is dominated by them. For example, in this screenshot, the blue constellation in the center is a file that imports from the @smithy/types library and the library files around it. The orange in the lower-left is the AWS client library. The halo around the graph are unused files from third-party libraries.

image

I tried using the ignore_dependencies_containing option in the config file, but it doesn't work for node_modules:

---
project_name: ts
loglevel: info
analyses:
  - analysis_name: ts
    source_directory: /Users/user/src/
    only_permit_languages:
      - typescript
    only_permit_file_extensions:
      - .ts
      - .tsx
    ignore_dependencies_containing:
      - node_modules
    file_scan:
      - number_of_methods
      - source_lines_of_code
      - dependency_graph
      - fan_in_out
      - louvain_modularity
      - tfidf
    export:
      - directory: /Users/user/emerge-export
      - graphml
      - json
      - tabular_file
      - tabular_console_overall
      - d3

Ideally, the tool would have an ignore_node_modules boolean option which defaults to true. Another option is to have an exclude_file_patterns option which we can set to **/node_modules/**.

Sincerely, Michael

@mleonhard-notion mleonhard-notion added the enhancement New feature or request label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant