Skip to content

Commit

Permalink
chore: fix more lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
maribethb committed Jan 19, 2022
1 parent d143928 commit 02ca31e
Show file tree
Hide file tree
Showing 37 changed files with 122 additions and 117 deletions.
2 changes: 1 addition & 1 deletion plugins/block-dynamic-connection/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/block-extension-tooltip/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions plugins/block-extension-tooltip/src/tooltip_monkey_patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import * as Blockly from 'blockly/core';
(() => {
const renderStandardTooltip = (el: HTMLElement, tooltipDiv: HTMLElement) => {
let tip = BlocklyTooltip.getTooltipOfObject(el);
// Allow the any due to incomplete blockly typing.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tip = (Blockly.utils as any).string.wrap(tip, BlocklyTooltip.LIMIT);
// Create new text, line by line.
const lines = tip.split('\n');
Expand All @@ -27,6 +29,8 @@ import * as Blockly from 'blockly/core';
};

const renderTooltip = (el: HTMLElement, tooltipDiv: HTMLElement) => {
// Allow the any due to tooltips shoving properties into HTMLElements.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const customTooltip = (el as any).customTooltip;
if (customTooltip) {
const customEl = customTooltip();
Expand All @@ -40,6 +44,8 @@ import * as Blockly from 'blockly/core';
}
};

// Allow the any due to incomplete blockly typing.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const BlocklyTooltip = (Blockly.Tooltip as any);
BlocklyTooltip.show_ = function() {
if (BlocklyTooltip.blocked_) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/block-plus-minus/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions plugins/block-plus-minus/src/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Blockly.defineBlocksWithJsonArray([
/**
* Defines the what are essentially info-getters for the procedures_defnoreturn
* block.
* @type {{callType_: string, getProcedureDef: (function(): *[])}}
* @type {{callType_: string, getProcedureDef: (function(): Array)}}
*/
const getDefNoReturn = {
/**
Expand All @@ -124,7 +124,7 @@ Blockly.Extensions.registerMixin('get_procedure_def_no_return', getDefNoReturn);
/**
* Defines what are essentially info-getters for the procedures_def_return
* block.
* @type {{callType_: string, getProcedureDef: (function(): *[])}}
* @type {{callType_: string, getProcedureDef: (function(): Array)}}
*/
const getDefReturn = {
/**
Expand Down
2 changes: 1 addition & 1 deletion plugins/block-test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/content-highlight/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/continuous-toolbox/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/dev-scripts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/dev-tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugins/dev-tools/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface FieldGeneratorOptions {

interface PlaygroundTab {
generate: () => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
state: any;
tabElement: HTMLElement;
}
Expand Down
15 changes: 5 additions & 10 deletions plugins/dev-tools/src/playground/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@ import {addGUIControls} from './options';
import {LocalStorageState} from './state';
import {renderCheckbox, renderCodeTab, renderPlayground} from './ui';

/**
* @typedef {?} dat
*/

/**
* @typedef {?} monaco
*/
// Declare external types to make eslint happy.
/* global dat, monaco */

/**
* @typedef {function(!HTMLElement,!Blockly.BlocklyOptions):
Expand All @@ -43,9 +38,9 @@ let CreateWorkspaceFn;

/**
* @typedef {{
* generate: function():void,
* generate: function(): void,
* state: ?,
* tabElement: !HTMLElement,
* tabElement: !HTMLElement
* }}
*/
let PlaygroundTab;
Expand All @@ -72,7 +67,7 @@ let PlaygroundTab;
* addGenerator: function(string,!Blockly.Generator,string=):void,
* getCurrentTab: function():!PlaygroundTab,
* getGUI: function():!dat.GUI,
* getWorkspace: function():!Blockly.WorkspaceSvg,
* getWorkspace: function():!Blockly.WorkspaceSvg
* }}
*/
let PlaygroundAPI;
Expand Down
2 changes: 2 additions & 0 deletions plugins/dev-tools/src/playground/monaco.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

// Declare external types to make eslint happy.
/* global monaco */

/**
* Load the monaco editor.
Expand Down
17 changes: 11 additions & 6 deletions plugins/dev-tools/src/playground/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@
* @author samelh@google.com (Sam El-Husseini)
*/


/**
* Render the playground layout.
* @param {HTMLElement} container The container to render the playground in.
* @return {{
* @typedef {{
* blocklyDiv: HTMLElement,
* minimizeButton: HTMLElement,
* monacoDiv: HTMLElement,
* guiContainer: HTMLElement,
* playgroundDiv: HTMLElement,
* tabsDiv: HTMLElement,
* tabButtons: HTMLElement,
* }} An object with the various playground components.
* tabButtons: HTMLElement
* }}
*/
let PlaygroundLayout;


/**
* Render the playground layout.
* @param {HTMLElement} container The container to render the playground in.
* @return {PlaygroundLayout} An object with the various playground components.
*/
export function renderPlayground(container) {
container.style.display = 'flex';
Expand Down
2 changes: 1 addition & 1 deletion plugins/disable-top-blocks/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion plugins/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ module.exports = {
// http://eslint.org/docs/rules/
'camelcase': 'warn',
'new-cap': ['error', {'capIsNewExceptionPattern': '^.*Error'}],
// Allow TODO comments.
'no-warning-comments': 'off',
// Allow long import lines.
'max-len': ['error', {'ignorePattern': '^import'}],
'no-invalid-this': 'off',
// valid-jsdoc does not work properly for interface methods.
// https://github.com/eslint/eslint/issues/9978
Expand All @@ -59,7 +63,8 @@ module.exports = {
// https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules
'require-jsdoc': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-description-complete-sentence': 'warn',
// This should warn instead, but it's broken for long record type params.
'jsdoc/require-description-complete-sentence': 'off',
'jsdoc/require-returns': [
'error',
{
Expand Down
Loading

0 comments on commit 02ca31e

Please sign in to comment.