For people using newer PDM, It's a bit different:
You have to add custom scripts in the project folder to let pylint recognize the correct python interpreter (check here: https://vi.stackexchange.com/questions/45737/pylint-unable-to-find-imports-from-currently-active-virtual-environment)