mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
chore: add always_put_control_body_on_new_line lint (#28352)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
7837d40f57
commit
12f7b2a005
122 changed files with 774 additions and 263 deletions
|
|
@ -40,7 +40,9 @@ class LoginForm extends HookConsumerWidget {
|
|||
final log = Logger('LoginForm');
|
||||
|
||||
String? _validateUrl(String? url) {
|
||||
if (url == null || url.isEmpty) return null;
|
||||
if (url == null || url.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final parsedUrl = Uri.tryParse(url);
|
||||
if (parsedUrl == null || !parsedUrl.isAbsolute || !parsedUrl.scheme.startsWith("http") || parsedUrl.host.isEmpty) {
|
||||
|
|
@ -51,9 +53,15 @@ class LoginForm extends HookConsumerWidget {
|
|||
}
|
||||
|
||||
String? _validateEmail(String? email) {
|
||||
if (email == null || email == '') return null;
|
||||
if (email.endsWith(' ')) return 'login_form_err_trailing_whitespace'.tr();
|
||||
if (email.startsWith(' ')) return 'login_form_err_leading_whitespace'.tr();
|
||||
if (email == null || email == '') {
|
||||
return null;
|
||||
}
|
||||
if (email.endsWith(' ')) {
|
||||
return 'login_form_err_trailing_whitespace'.tr();
|
||||
}
|
||||
if (email.startsWith(' ')) {
|
||||
return 'login_form_err_leading_whitespace'.tr();
|
||||
}
|
||||
if (email.contains(' ') || !email.contains('@')) {
|
||||
return 'login_form_err_invalid_email'.tr();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue