ci: improve linting, GitHub Actions workflows (#149)

* release: release 2.7.2

* fix: urgent 2.7.3 release to fix fatal error

* chore: remove un-needed setup script

* ci: remove steps from pre-push command

* chore: remove un-needed PHP-Commitizen config

* chore: put image files in correct folders

* chore: move GitHub image into `.github/` dir

* fix: classic editor button

* fix: call correct jQuery Tools file in dev env

* docs: replace license with Markdown version

* ci: clean up PHP linting commands

If anyone has noticed me playing musical filepaths with these commands
for a while, it's because I kept getting inconsistent results from the
use of double-globs (i.e., `**`). However, I've finally figured out
that this is because Composer is running these scripts in its own shell,
so the double-glob that works when I run the command manually in my
Terminal doesn't work when Composer runs it in its.

* chore: lint PHP files

* build: update JS linting standards

* chore: lint JS file

* build: add node-sass

* build: add additional stylelint rules

* chore: lint stylesheets with new rulesets

* refactor: move ESLint settings to `package.json`

* chore: move Prettier config to `package.json`

It is not yet possible to move `.prettierignore` to `package.json` too,
but this appears to be on the horizon; see [this Issue][prettier-issue].

[prettier-issue]: https://github.com/prettier/prettier/issues/3460

* fix: move WPML config into Plugin folder

* chore: move Stylelint config into `package.json`

* chore: remove unused `.distignore`

It can always be re-added at a later date if it becomes useful.

* chore: format file

* build: add HTML linting

* fix: add image alt tag

* ci: clean up GitHub Actions workflows

* fix: fix workflow

* fix: fix indentation

* ci: add YAML validation

* chore: make valid

* ci: add YAML validation

* chore: lint code

* ci: change dep install back to original

* chore: lint license
This commit is contained in:
Ben Goldsworthy 2021-04-26 17:17:44 +01:00 committed by GitHub
parent ac819034e5
commit 4af8849eec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 15881 additions and 1771 deletions

View file

@ -4,8 +4,11 @@
* Edit: be careful to maintain version number near EOF
*/
/*eslint-disable no-undef */
(function () {
tinymce.create('tinymce.plugins.Footnotes', {
/*eslint-enable no-undef */
/*eslint-disable jsdoc/no-undefined-types */
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished its initialization so use the onInit event
@ -14,7 +17,8 @@
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init: function (ed, url) {
init: (ed, url) => {
/*eslint-enable jsdoc/no-undefined-types */
ed.addButton('footnotes', {
title: 'footnotes',
cmd: 'footnotes',
@ -28,43 +32,33 @@
data: {
action: 'footnotes_getTags',
},
success: function (data, textStatus, XMLHttpRequest) {
var tags = JSON.parse(data);
var returnText = tags.start + ed.selection.getContent() + tags.end;
ed.execCommand('insertHTML', true, returnText);
success: (data) => {
const tags = JSON.parse(data);
const returnText = tags.start + ed.selection.getContent() + tags.end;
ed.insertContent(returnText);
},
error: function (MLHttpRequest, textStatus, errorThrown) {
console.log('Error: ' + errorThrown);
/*eslint-disable no-unused-vars */
error: (XMLHttpRequest, textStatus, errorThrown) => {
/*eslint-enable no-unused-vars */
/*eslint-disable no-console */
console.error('Error: ' + errorThrown);
/*eslint-enable no-console */
},
});
});
},
/**
* Creates control instances based on the incoming name. This method is normally not
* needed since the addButton method of the tinymce.Editor class is an easier way of adding buttons,
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
* method can be used to create those.
*
* @param {String} n Name of the control to create.
* @param {tinymce.ControlManager} cm Control manager to use in order to create new control.
* @return {tinymce.ui.Control} New control instance or null if no control was created.
*/
createControl: function (n, cm) {
return null;
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
* @return {Object} Information about the Plugin.
*
* Edit: needs updating the version number manually
*/
getInfo: function () {
getInfo: () => {
return {
longname: 'Inserts the Footnotes short code.',
longname: 'footnotes',
author: 'Mark Cheret',
authorurl: 'https://cheret.org/footnotes/',
infourl: 'https://wordpress.org/plugins/footnotes/',
@ -73,6 +67,8 @@
},
});
/*eslint-disable no-undef */
// Register plugin
tinymce.PluginManager.add('footnotes', tinymce.plugins.Footnotes);
/*eslint-enable no-undef */
})();