SIGN IN SIGN UP

Add new AvoidUsingArrayList rule (#2174)

* Implemented the AvoidUsingArrayList rule to warn when the ArrayList class is used in PowerShell scripts. Added tests for both violations and non-violations of this rule. Updated documentation to include the new rule and its guidelines.

* Testing-Commit-CSpell-issue

* Apply suggestion from @liamjpeters

I clearly used several other rules as a kind of template...🤪

Co-authored-by: Liam Peters <liamjpeters@gmail.com>

* Update docs/Rules/AvoidUsingArrayList.md

Co-authored-by: Liam Peters <liamjpeters@gmail.com>

* Updated rule help

* Changed "unintentionally"

* Update Rules/AvoidUsingArrayList.cs

Co-authored-by: Liam Peters <liamjpeters@gmail.com>

* Update Tests/Rules/AvoidUsingArrayList.tests.ps1

Co-authored-by: Liam Peters <liamjpeters@gmail.com>

* ArrayListName could be null

* Resolved camelCase

* Remove ComponentModel namespace

* Fixed tests

* Updated Tests

* fixed and tested empty (dynamic) BoundParameter

* Robuster Pester tests

* Configurable (enable by default)

* Fixed ConstantValue null check test and rule

* Better UsingStatements handling and disable AvoidUsingArrayList by default

* `[ArrayList]::new()` without a `using namespace System.Collections`

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Resolve Copilot suggestions and resolved `Method not found: ScriptBlockAst.get_UsingStatements()` error

---------

Co-authored-by: Liam Peters <liamjpeters@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
I
iRon7 committed
6dadae3b7cf6a5913d8d4470012f2e4e10832b01
Parent: 97f30d6
Committed by GitHub <noreply@github.com> on 5/18/2026, 5:19:03 PM