Skip to content
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

32129139: Bump our eslint-plugin in widgetjs #456

Merged
merged 4 commits into from
Dec 14, 2023
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
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