Skip to content

Commit 0ca9a70

Browse files
committed
Code Editor: Improve types and fix options handling to avoid double-linting at initialization.
* Refactor how CodeMirror is initialized so that the full settings are provided up-front. This avoids the linting from being applied twice at initialization, the first time with an incorrect configuration. * Add initial TypeScript configuration for core with `npm run typecheck:js`. * Add comprehensive types for code editor files: `code-editor.js`, `javascript-lint.js`, and `htmlhint-kses.js`. * Move code editor scripts from `src/js/_enqueues/vendor/codemirror/` to `src/js/_enqueues/lib/codemirror/`. The CodeMirror library is sourced from the npm package as of r61539. * Remove (deprecated) `esprima.js` from being committed to SVN since in r61539 it was switched to using the npm package as its source. * Move `fakejshint.js` to `src/js/_enqueues/deprecated`. Developed in WordPress/wordpress-develop#10900 Follow up to r61611, r61539. Props westonruter, jonsurrell, justlevine. See #64662, #48456. Fixes #64661. Built from https://develop.svn.wordpress.org/trunk@61800 git-svn-id: http://core.svn.wordpress.org/trunk@61106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 3dea30b commit 0ca9a70

7 files changed

Lines changed: 333 additions & 293 deletions

File tree

0 commit comments

Comments
 (0)