Skip to content

Commit

Permalink
Merge pull request #466 from foretagsplatsen/dependabot/npm_and_yarn/…
Browse files Browse the repository at this point in the history
…foretagsplatsen/eslint-plugin-6.0.0

build(deps-dev): bump @foretagsplatsen/eslint-plugin from 5.0.0 to 6.0.0
  • Loading branch information
DamienCassou committed Feb 12, 2024
2 parents 8596a3c + e46cfaf commit d81ec1a
Show file tree
Hide file tree
Showing 11 changed files with 350 additions and 35 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
module.exports = {
root: true,
extends: ["plugin:@foretagsplatsen/main"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2022,
},
rules: {
"import/no-unused-modules": [
"error",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"test": "jasmine-browser-runner runSpecs --config=jasmine-browser.json"
},
"devDependencies": {
"@foretagsplatsen/eslint-plugin": "^5.0.0",
"@foretagsplatsen/eslint-plugin": "^6.0.0",
"eslint": "^8.56.0",
"jasmine": "^5.1.0",
"jasmine-browser-runner": "^2.3.0",
Expand Down
10 changes: 5 additions & 5 deletions src/htmlCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ Array.prototype.appendToBrush = function (brush) {
* @param {string|HTMLElement} child
*/
TagBrushConstructor.prototype.appendChild = function (child) {
if (this.element.canHaveChildren !== false) {
this.element.appendChild(child);
} else {
if (this.element.canHaveChildren === false) {
this.element.text = this.element.text + child.innerHTML;
} else {
this.element.appendChild(child);
}
};

Expand Down Expand Up @@ -343,8 +343,8 @@ TagBrushConstructor.prototype.getElement = function (object) {
*/
TagBrushConstructor.prototype.render = function () {
let args = Array.prototype.slice.call(arguments);
for (let i = 0; i < args.length; i++) {
this.append(args[i]);
for (const arg of args) {
this.append(arg);
}
return this;
};
Expand Down
2 changes: 1 addition & 1 deletion src/router/hashLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const hashLocation = object.subclass((that, my) => {

function urlFromHash(aHash) {
// Remove hash/hash-bang and any leading /
return url({ rawUrl: aHash.replace(/^#!?[/]?/, "") });
return url({ rawUrl: aHash.replace(/^#!?\/?/, "") });
}

function setCurrentHash(newHash) {
Expand Down
3 changes: 1 addition & 2 deletions src/router/routeFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ function segmentFactory(segmentString, options) {
let segments = abstractSegment.allSubclasses();

// Find segment type from string
for (let i = 0; i < segments.length; i++) {
let segment = segments[i];
for (let segment of segments) {
if (segment.match(segmentString)) {
return segment({
segmentString,
Expand Down
6 changes: 3 additions & 3 deletions src/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ const router = object.subclass((that, my) => {
}

// Merge current parameters with supplied parameters
let currentParameters = !excludeCurrentParameters
? that.getParameters()
: {};
let currentParameters = excludeCurrentParameters
? {}
: that.getParameters();
let allParameters = merge(currentParameters, suppliedParameters);

// Fill with defaults if needed
Expand Down
6 changes: 1 addition & 5 deletions src/router/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ const url = object.subclass((that, my) => {
* @returns {url}
*/
url.build = function (path, query) {
if (
typeof path === "undefined" ||
path === null ||
typeof path !== "string"
) {
if (path === undefined || path === null || typeof path !== "string") {
throw "accepts only string paths";
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/htmlCanvasTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ describe("htmlCanvas", () => {
it("can render almost everything", () => {
withCanvas((html) => {
html.render(0); // toString()
html.render(3.14159265359); // toString()
html.render(3.141_592_653_59); // toString()
html.render("<div>test</div>"); // => DIV element
html.render({}); // as attributes but since it have no keys => nothing
html.render([]); // as array but since empty => nothing
Expand Down
2 changes: 1 addition & 1 deletion webpack.aliases.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require("path");
const path = require("node:path");

module.exports = {
klassified: path.resolve(
Expand Down
2 changes: 1 addition & 1 deletion webpack.base.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require("path");
const path = require("node:path");
const webpack = require("webpack");
const aliases = require("./webpack.aliases.js");

Expand Down

0 comments on commit d81ec1a

Please sign in to comment.