Skip to content

Commit

Permalink
Resolve lint error in client-data dir and added lint job in CI.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavik001 committed Dec 9, 2023
1 parent 0ce8ebb commit 7916219
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ CHECKS
docker-compose.yml
Dockerfile
LICENSE
nightwatch.config.js
nightwatch.conf.js
README.md
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ module.exports = {
},
rules: {
"no-prototype-builtins": "off",
"no-undef": "warn",
},
};
14 changes: 14 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,17 @@ jobs:

- name: Run Prettier check
run: npx prettier --check .


lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npx eslint .
6 changes: 5 additions & 1 deletion client-data/js/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @licend
*/

const Minitpl = require('./minitpl')
var Tools = {};

Tools.i18n = (function i18n() {
Expand Down Expand Up @@ -75,6 +75,7 @@ Tools.connect = function () {
socket_params.query = "token=" + params.get("token");
}

// eslint-disable-next-line no-undef
this.socket = io.connect("", socket_params);

//Receive draw instructions from the server
Expand Down Expand Up @@ -588,6 +589,7 @@ Tools.toolHooks = [
};
}

// eslint-disable-next-line no-unused-vars
function wrapUnsetHover(f, toolName) {
return function unsetHover(evt) {
document.activeElement &&
Expand Down Expand Up @@ -643,6 +645,7 @@ Tools.generateUID = function (prefix, suffix) {
Tools.createSVGElement = function createSVGElement(name, attrs) {
var elem = document.createElementNS(Tools.svg.namespaceURI, name);
if (typeof attrs !== "object") return elem;
// eslint-disable-next-line no-unused-vars
Object.keys(attrs).forEach(function (key, i) {
elem.setAttributeNS(null, key, attrs[key]);
});
Expand Down Expand Up @@ -764,6 +767,7 @@ Tools.svg.height.baseVal.value = document.body.clientHeight;
var dy = evt.clientY - pos.scroll;
menu.scrollTop = pos.top - dy;
}
// eslint-disable-next-line no-unused-vars
function menu_mouseup(evt) {
menu.removeEventListener("mousemove", menu_mousemove);
document.removeEventListener("mouseup", menu_mouseup);
Expand Down
1 change: 1 addition & 0 deletions client-data/js/canvascolor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// @use_types_for_optimization true
// ==/ClosureCompiler==

// eslint-disable-next-line no-unused-vars
var canvascolor = (function () {
//Code Isolation
"use strict";
Expand Down
5 changes: 3 additions & 2 deletions client-data/js/minitpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
*
* @licend
*/

Minitpl = (function () {
// eslint-disable-next-line no-unused-vars
const Minitpl = (function () {
// eslint-disable-next-line no-unused-vars
function Minitpl(elem, data) {
this.elem = typeof elem === "string" ? document.querySelector(elem) : elem;
if (!elem) {
Expand Down
Loading

0 comments on commit 7916219

Please sign in to comment.