Skip to content

Commit

Permalink
Merge pull request #456 from foretagsplatsen/32129139/Bump_our_eslint…
Browse files Browse the repository at this point in the history
…-plugin_in_widgetjs

32129139: Bump our eslint-plugin in widgetjs
  • Loading branch information
DamienCassou authored Dec 14, 2023
2 parents bd1b84a + f3d80a2 commit 7d5f786
Show file tree
Hide file tree
Showing 26 changed files with 1,430 additions and 865 deletions.
11 changes: 5 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ module.exports = {
root: true,
extends: ["plugin:@foretagsplatsen/main"],
parserOptions: {
ecmaVersion: 6,
sourceType: "module"
ecmaVersion: 2022,
sourceType: "module",
},
rules: {
"quotes": ["error", "double"],
"import/no-unused-modules": [
"error",
{
Expand All @@ -19,9 +18,9 @@ module.exports = {
"**/.eslintrc.js",
"webpack*",
"src/router/optionalParameterSegment.js",
"src/router/staticSegment.js"
"src/router/staticSegment.js",
],
},
]
}
],
},
};
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": "^3.0.0",
"@foretagsplatsen/eslint-plugin": "^4.0.1",
"eslint": "^8.55.0",
"jasmine": "^5.1.0",
"jasmine-browser-runner": "^2.3.0",
Expand Down
31 changes: 12 additions & 19 deletions src/Widget2.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import router from "./router.js";
import {eventCategory} from "yaem";
import { eventCategory } from "yaem";
import htmlCanvas from "./htmlCanvas.js";
import jQuery from "jquery";
import {getCurrentWidget, withCurrentWidget} from "./currentWidget.js";
import {newId} from "./idGenerator.js";
import { getCurrentWidget, withCurrentWidget } from "./currentWidget.js";
import { newId } from "./idGenerator.js";

/**
* Base for all widgets. A widget can keep state in variables, contain logic and
Expand Down Expand Up @@ -43,7 +43,7 @@ import {newId} from "./idGenerator.js";
* be generated and assigned.
*/
export default class Widget2 {
constructor({id} = {}) {
constructor({ id } = {}) {
this._id = id || newId();

// When within an update transaction, do not update the widget
Expand Down Expand Up @@ -90,14 +90,12 @@ export default class Widget2 {
* of `_initializeSubwidgets()`). In particular, don't override
* `constructor()`.
*/
_initialize(spec) {
}
_initialize(spec) {}

/**
* Hook evaluated at the end of initialization.
*/
_initializeSubwidgets(spec) {
}
_initializeSubwidgets(spec) {}

//
// Public
Expand Down Expand Up @@ -262,7 +260,7 @@ export default class Widget2 {
_createEvents() {
let names = Array.prototype.slice.apply(arguments);

names.forEach(name => this._createEvent(name));
names.forEach((name) => this._createEvent(name));
}

//
Expand All @@ -282,8 +280,7 @@ export default class Widget2 {
/**
* Widget specific dispose.
*/
_dispose() {
}
_dispose() {}

//
// Render
Expand Down Expand Up @@ -380,27 +377,23 @@ export default class Widget2 {
* Hook evaluated before the widget is attached (or reattached due
* to an update of rendering) to the DOM.
*/
_willAttach() {
}
_willAttach() {}

/**
* Hook evaluated each time the widget is attached (or
* reattached due to an update of rendering) to the DOM.
*/
_didAttach() {
}
_didAttach() {}

/**
* Hook evaluated when a widget is detached from the DOM.
*/
_willDetach() {
}
_willDetach() {}

/**
* Hook evaluated before widget update.
*/
_willUpdate() {
}
_willUpdate() {}

/**
* Re-renders the widget and replace it in the DOM
Expand Down
Loading

0 comments on commit 7d5f786

Please sign in to comment.