I want to migrate my codebase to nullable references. One of migration strategies consists of adding #nullable disable
prefix to all files. How I can do it automatically?
One way is to:
^(?<![\n])
#nullable disable\n
*.cs
^(?<![\n])
is a regex which matches the start of a line (^
) which isn't preceeded by a newline ((?<![\n])
). In other words, the start of the first line of a file.