It is actually really simple. If you downgrade packages in ArchLinux you can use "downgrader" for official repositories, but for AUR packages you need to do it manually. The problem I had is that I need <3.0.0 of php-codesniffer. Since php-codesniffer-drupal has that dependency.
Find the right version from AUR git commits, in my case php-codesniffer package. I downloaded snapshot form "Updated to latest stable v2.8.1" commit.
Source code viewer
cd ~/Downloads/ wget https://aur.archlinux.org/cgit/aur.git/snapshot/aur-5fe6c367470d3dda54b33ed9d7009e2146a03a5b.tar.gz tar -xvzf aur-5fe6c367470d3dda54b33ed9d7009e2146a03a5b.tar.gzProgramming Language: Bash
Just extract the snapshot, cd into it and run "makepkg -i".
Source code viewer
cd aur-5fe6c367470d3dda54b33ed9d7009e2146a03a5b makepkg -iProgramming Language: Bash
To avoid overwriting the package on update we add it to IgnorePkg in "/etc/pacman.conf".
Source code viewer
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup IgnorePkg = phpstorm php-codesnifferProgramming Language: INI