eslint-config-scratch: React + ES6 Edition#9
eslint-config-scratch: React + ES6 Edition#9rschamp merged 9 commits intoscratchfoundation:masterfrom rschamp:lint
Conversation
null !== undefined
node relevant at the root, but not in src. Broser relevant in src, but not in root.
rschamp
left a comment
There was a problem hiding this comment.
Annotated the things that are new from scratchfoundation/scratch-vm#298. I did this first, so some of the linting I did on this repo is obsolete after linting scratch-vm.
Not noted is the first thing I did, which was enforce the .jsx extension for files containing JSX.
| // Draw the costume to the rendered canvas. | ||
| const img = this.img; | ||
| const context = this.refs.costumeCanvas.getContext('2d'); | ||
| const context = this.canvas.getContext('2d'); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| svgToImage(body, (err, img) => { | ||
| if (!err) { | ||
| svgToImage(body, (svgErr, img) => { | ||
| if (!svgErr) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| } else { | ||
| // Raster graphics: create Image and draw it. | ||
| let img = new Image(); | ||
| const img = new Image(); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| width={this.props.width} | ||
| ref={this._getCanvas} // eslint-disable-line react/jsx-sort-props | ||
| /> | ||
| ); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| height: React.PropTypes.number, | ||
| direction: React.PropTypes.number | ||
| url: React.PropTypes.string, | ||
| width: React.PropTypes.number |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
|
||
| StageComponent.defaultProps = { | ||
| canvasRef: function () {}, | ||
| canvasRef: () => {}, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| this.workspace | ||
| .getFlyout() | ||
| .getWorkspace() | ||
| .addChangeListener(this.props.vm.flyoutBlockListener); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| return ( | ||
| <BlocksComponent | ||
| componentRef={c => this.blocks = c} | ||
| componentRef={c => (this.blocks = c)} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| componentWillUnmount () { | ||
| this.vmManager.detachKeyboardEvents(); | ||
| this.props.vm.stopAll(); | ||
| } |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
|
||
| GUI.propTypes = { | ||
| backdropLibraryProps: React.PropTypes.object, | ||
| backdropLibraryProps: shapeFromPropTypes(BackdropLibrary.propTypes, {omit: ['vm']}), |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
Merging this now only so I can avoid conflicts as I work today. If rules should be adjusted I can update and fix in another PR. |
Update privacy.html
# [4.1.0-hotfix.1](v4.0.38...v4.1.0-hotfix.1) (2024-10-19) ### Bug Fixes * add pinch to zoom support ([#21](#21)) ([a690749](a690749)) * add support for Scratch-style procedures ([#6](#6)) ([df207e4](df207e4)) * adjust key event filtering to fix the when key pressed block ([#13](#13)) ([06b011f](06b011f)) * allow typing into comments ([#15](#15)) ([668fbb9](668fbb9)) * avoid clearing the state of the sensing_of block by refreshing the toolbox ([#28](#28)) ([9bd036b](9bd036b)) * call reportValue on the ScratchBlocks module instead of the workspace ([#11](#11)) ([1898c52](1898c52)) * call the new glow methods on ScratchBlocks ([#12](#12)) ([be4386d](be4386d)) * fix bug that prevented displaying the procedure editor modal on mobile ([#26](#26)) ([8b1bf24](8b1bf24)) * make dropdown menu shadow block colors consistent ([#22](#22)) ([45d4803](45d4803)) * modify inject options to reflect Scratch behaviors ([#5](#5)) ([59bf3c5](59bf3c5)) * only refresh the toolbox when procedures are created via undo ([#19](#19)) ([f6dfd53](f6dfd53)) * partially roll back flyout optimization ([#25](#25)) ([1745c59](1745c59)) * patch the getCheckboxState method in the new flyout ([#7](#7)) ([dd98dd8](dd98dd8)) * preserve toolbox scroll position when switching between sprites/the stage ([#10](#10)) ([c8bc880](c8bc880)) * prevent exception when switching languages ([#27](#27)) ([d174ae9](d174ae9)) * reenable the Scratch colour eyedropper ([a7b1a10](a7b1a10)) * select extension categories when added ([#8](#8)) ([2d58403](2d58403)) * show the correct toolbox based on sprites or the stage being selected ([#4](#4)) ([dbbb251](dbbb251)) * specify the function to be used for prompting about variables ([#17](#17)) ([ee80f13](ee80f13)) * temporarily disable functionality in scratch-gui for compatibility with patched scratch-blocks ([#1](#1)) ([905f043](905f043)) * update the toolbox in response to procedure deletion/creation ([#18](#18)) ([505011d](505011d)) * Use toolboxitemid instead of id as the identifier attribute for toolbox categories ([#9](#9)) ([077415b](077415b)) ### Features * plumb Scratch variable support into the UI ([#16](#16)) ([c92f244](c92f244))
# [4.1.0-beta.1](v4.0.38...v4.1.0-beta.1) (2024-10-19) ### Bug Fixes * add pinch to zoom support ([#21](#21)) ([a690749](a690749)) * add support for Scratch-style procedures ([#6](#6)) ([df207e4](df207e4)) * adjust key event filtering to fix the when key pressed block ([#13](#13)) ([06b011f](06b011f)) * allow typing into comments ([#15](#15)) ([668fbb9](668fbb9)) * avoid clearing the state of the sensing_of block by refreshing the toolbox ([#28](#28)) ([9bd036b](9bd036b)) * call reportValue on the ScratchBlocks module instead of the workspace ([#11](#11)) ([1898c52](1898c52)) * call the new glow methods on ScratchBlocks ([#12](#12)) ([be4386d](be4386d)) * fix bug that prevented displaying the procedure editor modal on mobile ([#26](#26)) ([8b1bf24](8b1bf24)) * make dropdown menu shadow block colors consistent ([#22](#22)) ([45d4803](45d4803)) * modify inject options to reflect Scratch behaviors ([#5](#5)) ([59bf3c5](59bf3c5)) * only refresh the toolbox when procedures are created via undo ([#19](#19)) ([f6dfd53](f6dfd53)) * partially roll back flyout optimization ([#25](#25)) ([1745c59](1745c59)) * patch the getCheckboxState method in the new flyout ([#7](#7)) ([dd98dd8](dd98dd8)) * preserve toolbox scroll position when switching between sprites/the stage ([#10](#10)) ([c8bc880](c8bc880)) * prevent exception when switching languages ([#27](#27)) ([d174ae9](d174ae9)) * reenable the Scratch colour eyedropper ([a7b1a10](a7b1a10)) * **release:** release beta branch under beta label(?) ([e5cc322](e5cc322)) * select extension categories when added ([#8](#8)) ([2d58403](2d58403)) * show the correct toolbox based on sprites or the stage being selected ([#4](#4)) ([dbbb251](dbbb251)) * specify the function to be used for prompting about variables ([#17](#17)) ([ee80f13](ee80f13)) * temporarily disable functionality in scratch-gui for compatibility with patched scratch-blocks ([#1](#1)) ([905f043](905f043)) * update the toolbox in response to procedure deletion/creation ([#18](#18)) ([505011d](505011d)) * Use toolboxitemid instead of id as the identifier attribute for toolbox categories ([#9](#9)) ([077415b](077415b)) ### Features * plumb Scratch variable support into the UI ([#16](#16)) ([c92f244](c92f244))
# [4.1.0-spork.1](v4.0.39...v4.1.0-spork.1) (2024-10-21) ### Bug Fixes * add pinch to zoom support ([#21](#21)) ([a690749](a690749)) * add support for Scratch-style procedures ([#6](#6)) ([df207e4](df207e4)) * adjust key event filtering to fix the when key pressed block ([#13](#13)) ([06b011f](06b011f)) * allow typing into comments ([#15](#15)) ([668fbb9](668fbb9)) * avoid clearing the state of the sensing_of block by refreshing the toolbox ([#28](#28)) ([9bd036b](9bd036b)) * call reportValue on the ScratchBlocks module instead of the workspace ([#11](#11)) ([1898c52](1898c52)) * call the new glow methods on ScratchBlocks ([#12](#12)) ([be4386d](be4386d)) * fix bug that prevented displaying the procedure editor modal on mobile ([#26](#26)) ([8b1bf24](8b1bf24)) * make dropdown menu shadow block colors consistent ([#22](#22)) ([45d4803](45d4803)) * modify inject options to reflect Scratch behaviors ([#5](#5)) ([59bf3c5](59bf3c5)) * only refresh the toolbox when procedures are created via undo ([#19](#19)) ([f6dfd53](f6dfd53)) * partially roll back flyout optimization ([#25](#25)) ([1745c59](1745c59)) * patch the getCheckboxState method in the new flyout ([#7](#7)) ([dd98dd8](dd98dd8)) * preserve toolbox scroll position when switching between sprites/the stage ([#10](#10)) ([c8bc880](c8bc880)) * prevent exception when switching languages ([#27](#27)) ([d174ae9](d174ae9)) * reenable the Scratch colour eyedropper ([a7b1a10](a7b1a10)) * **release:** release beta branch under beta label(?) ([17c5b19](17c5b19)) * select extension categories when added ([#8](#8)) ([2d58403](2d58403)) * show the correct toolbox based on sprites or the stage being selected ([#4](#4)) ([dbbb251](dbbb251)) * specify the function to be used for prompting about variables ([#17](#17)) ([ee80f13](ee80f13)) * temporarily disable functionality in scratch-gui for compatibility with patched scratch-blocks ([#1](#1)) ([905f043](905f043)) * update the toolbox in response to procedure deletion/creation ([#18](#18)) ([505011d](505011d)) * Use toolboxitemid instead of id as the identifier attribute for toolbox categories ([#9](#9)) ([077415b](077415b)) ### Features * plumb Scratch variable support into the UI ([#16](#16)) ([c92f244](c92f244))
# [5.2.0-hotfix.1](v5.1.36...v5.2.0-hotfix.1) (2025-02-13) ### Bug Fixes * add pinch to zoom support ([#21](#21)) ([a690749](a690749)) * add support for Scratch-style procedures ([#6](#6)) ([df207e4](df207e4)) * allow typing into comments ([#15](#15)) ([668fbb9](668fbb9)) * avoid clearing the state of the sensing_of block by refreshing the toolbox ([#28](#28)) ([9bd036b](9bd036b)) * call reportValue on the ScratchBlocks module instead of the workspace ([#11](#11)) ([1898c52](1898c52)) * call the new glow methods on ScratchBlocks ([#12](#12)) ([be4386d](be4386d)) * fix bug that prevented displaying the procedure editor modal on mobile ([#26](#26)) ([8b1bf24](8b1bf24)) * fix preserving toolbox scroll position for new continuous toolbox plugin ([#30](#30)) ([b8f19dc](b8f19dc)) * make dropdown menu shadow block colors consistent ([#22](#22)) ([45d4803](45d4803)) * modify inject options to reflect Scratch behaviors ([#5](#5)) ([59bf3c5](59bf3c5)) * only refresh the toolbox when procedures are created via undo ([#19](#19)) ([f6dfd53](f6dfd53)) * partially roll back flyout optimization ([#25](#25)) ([1745c59](1745c59)) * patch the getCheckboxState method in the new flyout ([#7](#7)) ([dd98dd8](dd98dd8)) * preserve toolbox scroll position when switching between sprites/the stage ([#10](#10)) ([c8bc880](c8bc880)) * prevent exception when switching languages ([#27](#27)) ([d174ae9](d174ae9)) * reenable the Scratch colour eyedropper ([a7b1a10](a7b1a10)) * **release:** release beta branch under beta label(?) ([17c5b19](17c5b19)) * select extension categories when added ([#8](#8)) ([2d58403](2d58403)) * show the correct toolbox based on sprites or the stage being selected ([#4](#4)) ([dbbb251](dbbb251)) * specify the function to be used for prompting about variables ([#17](#17)) ([ee80f13](ee80f13)) * temporarily disable functionality in scratch-gui for compatibility with patched scratch-blocks ([#1](#1)) ([905f043](905f043)) * update "colour" property names for dark theme and mocks ([de06a2f](de06a2f)) * update the toolbox in response to procedure deletion/creation ([#18](#18)) ([505011d](505011d)) * Use toolboxitemid instead of id as the identifier attribute for toolbox categories ([#9](#9)) ([077415b](077415b)) ### Features * plumb Scratch variable support into the UI ([#16](#16)) ([c92f244](c92f244))
…toolbox categories (scratchfoundation#9)
…toolbox categories (scratchfoundation#9)
…toolbox categories (scratchfoundation#9)
…toolbox categories (scratchfoundation#9)
# [5.2.0-spork.1](v5.1.103...v5.2.0-spork.1) (2025-08-27) ### Bug Fixes * add pinch to zoom support ([#21](#21)) ([a690749](a690749)) * add support for Scratch-style procedures ([#6](#6)) ([df207e4](df207e4)) * adjust key event filtering to fix the when key pressed block ([#13](#13)) ([06b011f](06b011f)) * allow typing into comments ([#15](#15)) ([668fbb9](668fbb9)) * avoid clearing the state of the sensing_of block by refreshing the toolbox ([#28](#28)) ([9bd036b](9bd036b)) * call reportValue on the ScratchBlocks module instead of the workspace ([#11](#11)) ([1898c52](1898c52)) * call the new glow methods on ScratchBlocks ([#12](#12)) ([be4386d](be4386d)) * fix bug that prevented displaying the procedure editor modal on mobile ([#26](#26)) ([8b1bf24](8b1bf24)) * fix issue that could prevent variables from appearing in the toolbox ([#31](#31)) ([0570261](0570261)) * fix preserving toolbox scroll position for new continuous toolbox plugin ([#30](#30)) ([b8f19dc](b8f19dc)) * make dropdown menu shadow block colors consistent ([#22](#22)) ([45d4803](45d4803)) * modify inject options to reflect Scratch behaviors ([#5](#5)) ([59bf3c5](59bf3c5)) * only refresh the toolbox when procedures are created via undo ([#19](#19)) ([f6dfd53](f6dfd53)) * partially roll back flyout optimization ([#25](#25)) ([1745c59](1745c59)) * patch the getCheckboxState method in the new flyout ([#7](#7)) ([dd98dd8](dd98dd8)) * plumb `FieldNote` through to the VM ([#33](#33)) ([fb762c2](fb762c2)) * preserve toolbox scroll position when switching between sprites/the stage ([#10](#10)) ([c8bc880](c8bc880)) * prevent exception when switching languages ([#27](#27)) ([d174ae9](d174ae9)) * reenable the Scratch colour eyedropper ([a7b1a10](a7b1a10)) * **release:** release beta branch under beta label(?) ([17c5b19](17c5b19)) * select extension categories when added ([#8](#8)) ([2d58403](2d58403)) * show the correct toolbox based on sprites or the stage being selected ([#4](#4)) ([dbbb251](dbbb251)) * specify the function to be used for prompting about variables ([#17](#17)) ([ee80f13](ee80f13)) * temporarily disable functionality in scratch-gui for compatibility with patched scratch-blocks ([#1](#1)) ([905f043](905f043)) * update the toolbox in response to procedure deletion/creation ([#18](#18)) ([505011d](505011d)) * use serialization wrapper ([#32](#32)) ([6e46a18](6e46a18)) * Use toolboxitemid instead of id as the identifier attribute for toolbox categories ([#9](#9)) ([077415b](077415b)) ### Features * plumb Scratch variable support into the UI ([#16](#16)) ([c92f244](c92f244))
This gives a sense of the linting rules I applied for React and ES6 in eslint-config-scratch.