-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix linting warnings #9103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix linting warnings #9103
Changes from all commits
8285f24
51cf373
886ffdd
6a3fab3
0d580c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -447,25 +447,5 @@ function renderer(p5, fn) { | |
| p5.Renderer = Renderer; | ||
| } | ||
|
|
||
| /** | ||
| * Helper fxn to measure ascent and descent. | ||
| * Adapted from http://stackoverflow.com/a/25355178 | ||
| * @private | ||
| */ | ||
| function calculateOffset(object) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also this |
||
| let currentLeft = 0, | ||
| currentTop = 0; | ||
| if (object.offsetParent) { | ||
| do { | ||
| currentLeft += object.offsetLeft; | ||
| currentTop += object.offsetTop; | ||
| } while ((object = object.offsetParent)); | ||
| } else { | ||
| currentLeft += object.offsetLeft; | ||
| currentTop += object.offsetTop; | ||
| } | ||
| return [currentLeft, currentTop]; | ||
| } | ||
|
|
||
| export default renderer; | ||
| export { Renderer }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -437,13 +437,6 @@ export class Renderer3D extends Renderer { | |
| } | ||
| } | ||
|
|
||
| remove() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see where this went but it still feels like a refactor |
||
| this.wrappedElt.remove(); | ||
| this.wrappedElt = null; | ||
| this.canvas = null; | ||
| this.elt = null; | ||
| } | ||
|
|
||
| ////////////////////////////////////////////// | ||
| // Geometry Building | ||
| ////////////////////////////////////////////// | ||
|
|
@@ -1351,7 +1344,7 @@ export class Renderer3D extends Renderer { | |
| for (const savedKey in props) { | ||
| try { | ||
| this.drawingContext[savedKey] = props[savedKey]; | ||
| } catch (err) { | ||
| } catch { | ||
| // ignore read-only property errors | ||
| } | ||
| } | ||
|
|
@@ -1934,7 +1927,7 @@ export class Renderer3D extends Renderer { | |
| throw Error('_yAlignOffset: height is required'); | ||
| } | ||
|
|
||
| let { textLeading, textBaseline, textSize, textFont } = this.states; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same (minor) |
||
| let { textLeading, textBaseline, textSize } = this.states; | ||
| let yOff = 0, | ||
| numLines = dataArr.length; | ||
| let totalHeight = | ||
|
|
@@ -2176,6 +2169,10 @@ export class Renderer3D extends Renderer { | |
| if (this._textCanvas) { | ||
| this._textCanvas.parentElement.removeChild(this._textCanvas); | ||
| } | ||
| this.wrappedElt.remove(); | ||
| this.wrappedElt = null; | ||
| this.canvas = null; | ||
| this.elt = null; | ||
| super.remove(); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -233,5 +233,5 @@ function inferType(value) { | |
| } | ||
|
|
||
| function escapeRegExp(str) { | ||
| return str.replace(/[-\[\]/\{}\()\*+\?.\\^\$|]/g, '\\$&'); | ||
| return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1146,6 +1146,7 @@ function files(p5, fn) { | |
| case 'xml': | ||
| // NOTE: still need to normalize type handling/mapping | ||
| // datatype = 'xml'; | ||
| // falls through | ||
| case 'txt': | ||
| default: | ||
| datatype = 'text'; | ||
|
|
@@ -2119,17 +2120,6 @@ function files(p5, fn) { | |
| // The following line is CC BY SA 3 by user Fregante https://stackoverflow.com/a/23522755 | ||
| return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); | ||
| }; | ||
|
|
||
| /** | ||
| * Helper function, a callback for download that deletes | ||
| * an invisible anchor element from the DOM once the file | ||
| * has been automatically downloaded. | ||
| * | ||
| * @private | ||
| */ | ||
| function destroyClickedElement(event) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
| document.body.removeChild(event.target); | ||
| } | ||
| } | ||
|
|
||
| export default files; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,8 @@ import { MatrixInterface } from './MatrixInterface'; | |
| * Reference/Global_Objects/SIMD | ||
| */ | ||
|
|
||
| let GLMAT_ARRAY_TYPE = Array; | ||
| let isMatrixArray = x => Array.isArray(x); | ||
| if (typeof Float32Array !== 'undefined') { | ||
| GLMAT_ARRAY_TYPE = Float32Array; | ||
| isMatrixArray = x => Array.isArray(x) || x instanceof Float32Array; | ||
| } | ||
|
|
||
|
|
@@ -131,7 +129,6 @@ export class MatrixNumjs extends MatrixInterface { | |
| * @return {MatrixNumjs} the copy of the MatrixNumjs object | ||
| */ | ||
| get() { | ||
| let temp = new MatrixNumjs(this.mat4); | ||
| return new MatrixNumjs(this.mat4); | ||
| } | ||
|
|
||
|
|
@@ -522,7 +519,6 @@ export class MatrixNumjs extends MatrixInterface { | |
| x = x[0]; // must be last | ||
| } | ||
| this._mat4 = this._mat4.flatten(); | ||
| const vect = nj.array([x, y, z, 1]); | ||
| this._mat4.set(0, x * this._mat4.get(0)); | ||
| this._mat4.set(1, x * this._mat4.get(1)); | ||
| this._mat4.set(2, x * this._mat4.get(2)); | ||
|
|
@@ -805,12 +801,11 @@ export class MatrixNumjs extends MatrixInterface { | |
| * @chainable | ||
| */ | ||
| mult3x3(multMatrix) { | ||
| let _src; | ||
| let tempMatrix = multMatrix; | ||
| if (multMatrix === this || multMatrix === this._mat3) { | ||
| // mat3; // only need to allocate in this rare case | ||
| } else if (multMatrix instanceof MatrixNumjs) { | ||
| _src = multMatrix.mat3; | ||
| // tempMatrix already holds the matrix we need | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| } else if (isMatrixArray(multMatrix)) { | ||
| multMatrix._mat3 = nj.array(arguments); | ||
| } else if (arguments.length === 9) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ import { | |
| NodeTypeRequiredFields, | ||
| NodeTypeToName, | ||
| BasePriority, | ||
| StatementType, | ||
| BaseType | ||
| } from './ir_types'; | ||
| import * as FES from './strands_FES'; | ||
|
|
@@ -149,11 +148,6 @@ function createNode(graph, node) { | |
| return id; | ||
| } | ||
|
|
||
| function getNodeKey(node) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
| const key = JSON.stringify(node); | ||
| return key; | ||
| } | ||
|
|
||
| function validateNode(node) { | ||
| const nodeType = node.nodeType; | ||
| const requiredFields = NodeTypeRequiredFields[nodeType]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to fix warnings but code should not be removed, you can add a flag o ignore the warning maybe?