Skip to content

configuration.js default export requires eslint rule#1523

Open
frumbert wants to merge 1 commit intomoodle:mainfrom
frumbert:frumbert-tinymce-eslint-patch
Open

configuration.js default export requires eslint rule#1523
frumbert wants to merge 1 commit intomoodle:mainfrom
frumbert:frumbert-tinymce-eslint-patch

Conversation

@frumbert
Copy link
Contributor

grunt complains that

Promise executor functions should not be async no-async-promise-executor

This change skips the async check

grunt complains that

Promise executor functions should not be async  no-async-promise-executor

This change skips the async check
Copilot AI review requested due to automatic review settings February 19, 2026 00:04
@netlify
Copy link

netlify bot commented Feb 19, 2026

Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 75a23e6
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6996539d24d6840008cb3876
😎 Deploy Preview https://deploy-preview-1523--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the TinyMCE plugin type documentation to avoid an ESLint failure (no-async-promise-executor) triggered by a JavaScript example snippet in the docs.

Changes:

  • Adds an eslint-disable-next-line no-async-promise-executor directive to a documented export default new Promise(async (resolve) => { ... }) example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +515 to 517
// eslint-disable-next-line no-async-promise-executor
export default new Promise(async(resolve) => {
// ... Plugin code goes here.
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using // eslint-disable-next-line no-async-promise-executor here documents an ESLint suppression rather than showing a recommended pattern, and it may not fully resolve the lint failure because this same new Promise(async (resolve) => ...) pattern appears elsewhere in this doc (and in the versioned copies). Prefer rewriting the example(s) to avoid an async Promise executor (e.g., export an async IIFE that returns the tuple, or keep a non-async executor and call an inner async function with explicit reject handling) so the docs and linting both align with the rule.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This eslint suggestion is already present in the source of almost all the built-in plugins, such as https://github.com/moodle/moodle/blob/main/public/lib/editor/tiny/plugins/autosave/amd/src/plugin.js
While refactoring might be the better solution in the long run, it's not how it works right now and this is documentation about how it works right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments