Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
singleQuote: true,
// Some properties must be quoted to preserve closure compiler behavior.
// Don't ever change whether properties are quoted.
quoteProps: 'preserve',
quoteProps: 'consistent',
// Don't add spaces around braces for object literals.
bracketSpacing: false,
// Put HTML tag closing brackets on same line as last attribute.
Expand Down
68 changes: 34 additions & 34 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ module.exports = [
...globals.commonjs,
...globals.node,
...globals.es5,
'Blockly': true,
'goog': true,
Blockly: true,
goog: true,
},
parser: babelParser,
parserOptions: {
Expand All @@ -63,7 +63,7 @@ module.exports = [
settings: {
jsdoc: {
tagNamePreference: {
'returns': 'returns',
returns: 'returns',
},
mode: 'closure',
},
Expand All @@ -72,7 +72,7 @@ module.exports = [
rules: {
// http://eslint.org/docs/rules/
'camelcase': 'warn',
'new-cap': ['error', {'capIsNewExceptionPattern': '^.*Error'}],
'new-cap': ['error', {capIsNewExceptionPattern: '^.*Error'}],
// Allow TODO comments.
'no-warning-comments': 'off',
'no-invalid-this': 'off',
Expand All @@ -88,14 +88,14 @@ module.exports = [
'jsdoc/require-returns': [
'error',
{
'forceRequireReturn': false,
forceRequireReturn: false,
},
],
'jsdoc/require-description': [
'warn',
{
// Don't require descriptions if these tags are present.
'exemptedBy': ['inheritdoc', 'param', 'return', 'returns', 'type'],
exemptedBy: ['inheritdoc', 'param', 'return', 'returns', 'type'],
},
],
'jsdoc/check-tag-names': 'off',
Expand All @@ -105,11 +105,11 @@ module.exports = [
'jsdoc/require-jsdoc': [
'warn',
{
'enableFixer': false,
'require': {
'FunctionDeclaration': true,
'ClassDeclaration': true,
'MethodDefinition': true,
enableFixer: false,
require: {
FunctionDeclaration: true,
ClassDeclaration: true,
MethodDefinition: true,
},
},
],
Expand Down Expand Up @@ -151,16 +151,16 @@ module.exports = [
'jsdoc/require-jsdoc': [
'warn',
{
'enableFixer': false,
'publicOnly': true,
enableFixer: false,
publicOnly: true,
},
],
// params and returns docs are optional.
'jsdoc/require-param-description': ['off'],
'jsdoc/require-returns': ['off'],
// Ensure there is a blank line between the body and any @tags,
// as required by the tsdoc spec.
'jsdoc/tag-lines': ['error', 'any', {'startLines': 1}],
'jsdoc/tag-lines': ['error', 'any', {startLines: 1}],

// Already handled by tsc.
'no-dupe-class-members': 'off',
Expand All @@ -170,25 +170,25 @@ module.exports = [
'@typescript-eslint/array-type': [
'error',
{
'default': 'array-simple',
default: 'array-simple',
},
],
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': [
'error',
{
'types': {
'Object': {
'message': "Use {} or 'object' instead.",
types: {
Object: {
message: "Use {} or 'object' instead.",
},
'String': {
'message': "Use 'string' instead.",
String: {
message: "Use 'string' instead.",
},
'Number': {
'message': "Use 'number' instead.",
Number: {
message: "Use 'number' instead.",
},
'Boolean': {
'message': "Use 'boolean' instead.",
Boolean: {
message: "Use 'boolean' instead.",
},
},
},
Expand All @@ -197,20 +197,20 @@ module.exports = [
'@typescript-eslint/naming-convention': [
'error',
{
'selector': 'default',
'format': ['camelCase', 'PascalCase'],
selector: 'default',
format: ['camelCase', 'PascalCase'],
},
{
'selector': 'class',
'format': ['PascalCase'],
selector: 'class',
format: ['PascalCase'],
},
{
// Disallow starting interaces with 'I'
'selector': 'interface',
'format': ['PascalCase'],
'custom': {
'regex': '^I[A-Z]',
'match': false,
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
],
Expand All @@ -236,7 +236,7 @@ module.exports = [
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{'accessibility': 'no-public'},
{accessibility: 'no-public'},
],
'@typescript-eslint/no-require-imports': 'error',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {
Blockly.Events.enable();

return {
'itemCount': this.itemCount,
itemCount: this.itemCount,
};
},

Expand Down
2 changes: 1 addition & 1 deletion plugins/block-dynamic-connection/src/dynamic_text_join.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {
Blockly.Events.enable();

return {
'itemCount': this.itemCount,
itemCount: this.itemCount,
};
},

Expand Down
153 changes: 76 additions & 77 deletions plugins/block-dynamic-connection/test/dynamic_if.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,35 +506,35 @@ suite('If block', function () {
{
title: 'one if one else with children - json',
json: {
'type': 'dynamic_if',
'id': '1',
'extraState': {
'elseIfCount': 1,
'hasElse': true,
type: 'dynamic_if',
id: '1',
extraState: {
elseIfCount: 1,
hasElse: true,
},
'inputs': {
'IF0': {
'block': {
'type': 'logic_boolean',
'id': '2',
'fields': {
'BOOL': 'TRUE',
inputs: {
IF0: {
block: {
type: 'logic_boolean',
id: '2',
fields: {
BOOL: 'TRUE',
},
},
},
'IF1': {
'block': {
'type': 'logic_boolean',
'id': '3',
'fields': {
'BOOL': 'TRUE',
IF1: {
block: {
type: 'logic_boolean',
id: '3',
fields: {
BOOL: 'TRUE',
},
},
},
'ELSE': {
'block': {
'type': 'text_print',
'id': '4',
ELSE: {
block: {
type: 'text_print',
id: '4',
},
},
},
Expand All @@ -550,85 +550,84 @@ suite('If block', function () {
{
title: 'one if one else with children - json with stringified old XML',
json: {
'type': 'dynamic_if',
'id': '1',
'extraState':
'<mutation inputs="1,3,2" else="true" next="4"></mutation>',
'inputs': {
'IF1': {
'block': {
'type': 'logic_boolean',
'id': '2',
'fields': {
'BOOL': 'TRUE',
type: 'dynamic_if',
id: '1',
extraState: '<mutation inputs="1,3,2" else="true" next="4"></mutation>',
inputs: {
IF1: {
block: {
type: 'logic_boolean',
id: '2',
fields: {
BOOL: 'TRUE',
},
},
},
'IF3': {
'block': {
'type': 'logic_boolean',
'id': '3',
'fields': {
'BOOL': 'TRUE',
IF3: {
block: {
type: 'logic_boolean',
id: '3',
fields: {
BOOL: 'TRUE',
},
},
},
'IF2': {
'block': {
'type': 'logic_boolean',
'id': '4',
'fields': {
'BOOL': 'TRUE',
IF2: {
block: {
type: 'logic_boolean',
id: '4',
fields: {
BOOL: 'TRUE',
},
},
},
'ELSE': {
'block': {
'type': 'text_print',
'id': '5',
ELSE: {
block: {
type: 'text_print',
id: '5',
},
},
},
},
expectedJson: {
'type': 'dynamic_if',
'id': '1',
'extraState': {
'elseIfCount': 2,
'hasElse': true,
type: 'dynamic_if',
id: '1',
extraState: {
elseIfCount: 2,
hasElse: true,
},
'inputs': {
'IF0': {
'block': {
'type': 'logic_boolean',
'id': '2',
'fields': {
'BOOL': 'TRUE',
inputs: {
IF0: {
block: {
type: 'logic_boolean',
id: '2',
fields: {
BOOL: 'TRUE',
},
},
},
'IF1': {
'block': {
'type': 'logic_boolean',
'id': '3',
'fields': {
'BOOL': 'TRUE',
IF1: {
block: {
type: 'logic_boolean',
id: '3',
fields: {
BOOL: 'TRUE',
},
},
},
'IF2': {
'block': {
'type': 'logic_boolean',
'id': '4',
'fields': {
'BOOL': 'TRUE',
IF2: {
block: {
type: 'logic_boolean',
id: '4',
fields: {
BOOL: 'TRUE',
},
},
},
'ELSE': {
'block': {
'type': 'text_print',
'id': '5',
ELSE: {
block: {
type: 'text_print',
id: '5',
},
},
},
Expand Down
Loading