ACF PRO stubs also installed other dependencies like WP stubs.
composer require php-stubs/acf-pro-stubs
If you're not installing the ACF stubs, add the WP stubs using the below command:
composer require php-stubs/wordpress-stubs
Once installed add the stubs to your project, by copying the location of the stubs from the returned install notes:
@example: Using version ^6.2 for php-stubs/wordpress-stubs
@example: php-stubs/acf-pro-stubs
"php.stubs": [
"*"
"php-stubs/acf-pro-stubs",
"php-stubs/wordpress-stubs",
],