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

Update config docs to warn about antipattern #5850

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions website/en/docs/config/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ module.system.node.resolve_dirname=custom_node_modules
Then Flow will look in directories named `node_modules` or
`custom_node_modules`.

It is important to use `module.system.node.resolve_dirname` only for external dependency sources such as `node_modules`. If your aim is to enable your internal modules to import each other via absolute paths (to avoid long `../../..` relative paths), use [`module.name_mapper`](https://flow.org/en/docs/config/options/#toc-module-name-mapper-regex-string) instead. This is because using `module.system.node.resolve_dirname` opts into a new feature added in v0.57.0 intended for `node_modules`, whereby Flow skips checking any files that aren't direct or transitive dependencies of other files outside this directory—probably not what you want.

> **Note:** you can specify `module.system.node.resolve_dirname` multiple times

#### `module.use_strict` _`(boolean)`_ <a class="toc" id="toc-module-use-strict-boolean" href="#toc-module-use-strict-boolean"></a>
Expand Down