Skip to content

Commit

Permalink
fix: lint and its reported problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Oct 9, 2024
1 parent 8990a37 commit 25fddec
Show file tree
Hide file tree
Showing 200 changed files with 1,619 additions and 1,281 deletions.
30 changes: 27 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"env": {
"browser": true,
"es2021": true
"browser": true
},
"extends": "wordpress",
"extends": "plugin:@wordpress/eslint-plugin/recommended",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
Expand Down Expand Up @@ -63,5 +62,30 @@
"objectsInObjects": false
}
],
"prettier/prettier": ["off"],
"react-hooks/rules-of-hooks": ["warn"],
"dot-notation": ["off"],
"@wordpress/no-unsafe-wp-apis": ["warn"],
"no-undef": ["warn"],
"no-shadow": ["warn"],
"@typescript-eslint/no-shadow": "warn",
"@wordpress/no-base-control-with-label-without-id": ["warn"],
"no-unused-vars": ["warn"],
"@typescript-eslint/no-unused-vars": "warn",
"jsdoc/require-returns-description": ["warn"],
"no-unused-expressions": ["warn"],
"jsdoc/require-returns-type": ["warn"],
"no-nested-ternary": ["warn"],
"no-console": "warn",
"jsdoc/require-param-type": "warn",
"jsdoc/no-undefined-types": "warn",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"import/no-extraneous-dependencies": "warn",
"jsx-a11y/label-has-associated-control": "warn",
"jsx-a11y/alt-text": "warn",
"jsx-a11y/anchor-is-valid": "warn",
"jsx-a11y/no-noninteractive-element-interactions": "warn",
"jsx-a11y/no-autofocus": "warn"
}
}
31 changes: 19 additions & 12 deletions inc/integrations/class-form-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,27 +262,34 @@ public function build_error_body( $form_data ) {
*/
public function build_test_email( $form_data ) {
return sprintf(
"
'
<!doctype html>
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html;\" charset=\"utf-8\"/>
<meta http-equiv="Content-Type" content="text/html;" charset="utf-8"/>
<!-- view port meta tag -->
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/>
<title>%s%s</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>%s</title>
</head>
<body>
%s
<br><br>
Location: <a href='%s'>link</a>.
%s
</body>
</html>
",
esc_html__( 'Mail From: ', 'otter-blocks' ),
sanitize_email( get_site_option( 'admin_email' ) ),
esc_html( __( 'This a test email. If you receive this email, your SMTP set-up is working for sending emails via Form Block.', 'otter-blocks' ) ),
$form_data->get_data_from_payload( 'site' )
',
sprintf(
// translators: %s is the admin email address.
__( 'Mail From: %s', 'otter-blocks' ),
sanitize_email( get_site_option( 'admin_email' ) )
),
esc_html__( 'This a test email. If you receive this email, your SMTP set-up is working for sending emails via Form Block.', 'otter-blocks' ),
sprintf(
// translators: %s is the URL of the site from which the email was sent.
__( 'Location: %s', 'otter-blocks' ),
'<a href="' . $form_data->get_data_from_payload( 'site' ) . '">' . esc_html__( 'link', 'otter-blocks' ) . '</a>'
)
);
}

Expand Down
Loading

0 comments on commit 25fddec

Please sign in to comment.