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 16, 2024
1 parent afa6a68 commit dcab03d
Show file tree
Hide file tree
Showing 203 changed files with 1,683 additions and 1,282 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"
}
}
58 changes: 58 additions & 0 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Dispatch Update to translations.themeisle.com

on:
push:
tags:
- "*"

jobs:
makepot:
name: Build, make pot file and upload to S3
runs-on: ubuntu-latest

steps:
- name: Check out source files
uses: actions/checkout@v4
- name: Setup node 18
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install composer deps
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
composer install --no-dev --prefer-dist --no-progress
- name: Install NPM deps
run: npm ci
- name: Build files
run: npm run build
- name: Build pot
run: npm run build:makepot
- name: Upload Latest Version to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_DEV_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_KEY_ARTIFACTS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ARTIFACTS }}
SOURCE_DIR: languages/
DEST_DIR: ${{ github.event.repository.name }}-translations/

dispatch-workflow:
runs-on: ubuntu-latest
needs: makepot

steps:
- name: Dispatch workflow
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.BOT_TOKEN }}
repository: Codeinwp/themeisle-translations
event-type: update-potfile
client-payload: |
{
"ref": "${{ github.ref }}",
"potfile": "https://verti-artifacts.s3.amazonaws.com/${{ github.event.repository.name }}-translations/otter-pro.pot",
"slug": "otter-pro"
}
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 dcab03d

Please sign in to comment.