Add the path to rclpy in your linter import paths. For my case it was /home/khairulm/ros2_foxy/install/rclpy/lib/python3.8/site-packages
Add the path to rclpy in your linter import paths. For my case it was /home/khairulm/ros2_foxy/install/rclpy/lib/python3.8/site-packages