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

Adding ESLint to the project and solving the ESLint Errors #297

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
28287f1
Initialize ESLint
bhavik001 Dec 9, 2023
eb97016
Add prettier
bhavik001 Dec 9, 2023
84b68ad
Resolve Lint error in Test Directory
bhavik001 Dec 9, 2023
a720c55
Resolve Lint error in server/boardData.js file
bhavik001 Dec 9, 2023
780b1d8
Resolve Lint error in server\check_output_directory.js file
bhavik001 Dec 9, 2023
7d35157
Resolve Lint error in server\fs_promises.js & server\jwtauth.js file
bhavik001 Dec 9, 2023
465c579
Updating the remaining files of the server directory
bhavik001 Dec 9, 2023
915f1f2
Resolve Lint error in client-data\js\board.js file
bhavik001 Dec 9, 2023
c35661e
Undo client-data\js\board.js file
bhavik001 Dec 9, 2023
5ce8378
resolve Lint error in client-data\js\canvascolor.js & client-data\js\…
bhavik001 Dec 9, 2023
b04a140
resolve Lint error in client-data\js\minitpl.js & client-data\js\path…
bhavik001 Dec 9, 2023
b98f48b
Resolve Lint error of client-data\tools
bhavik001 Dec 9, 2023
4e920a7
Added Lint job to CI.yml file
bhavik001 Dec 9, 2023
21e0237
Update the ESLint feature for server side
bhavik001 Dec 11, 2023
21b7426
Resolving Errors
bhavik001 Dec 11, 2023
7da292a
Resolving build error
bhavik001 Dec 11, 2023
d0a1ce7
Resolving build error
bhavik001 Dec 11, 2023
149cbc7
Resolve lint error in check_output_directory.js file
bhavik001 Dec 11, 2023
f95490b
Update check_output_directory.js file
bhavik001 Dec 11, 2023
822df1f
Resolve lint error in server\jwtauth.js file
bhavik001 Dec 11, 2023
1143ca5
Resolve lint error in server\jwtBoardnameAuth.js file
bhavik001 Dec 11, 2023
476306a
Resolve lint error in server\jwtBoardnameAuth.js file
bhavik001 Dec 11, 2023
5fcca99
Resolve lint error in server\server.js file
bhavik001 Dec 11, 2023
8da693d
Resolve lint error in server\sockets.js file
bhavik001 Dec 11, 2023
db99344
Adding Some ESLint rules
bhavik001 Dec 11, 2023
23c43f5
Added prettier command inside the lint command only
bhavik001 Dec 11, 2023
011059b
Remove commented code & eslint-disable-next-line...
bhavik001 Dec 11, 2023
a3ea244
Comment out all the stuff
bhavik001 Dec 11, 2023
ff2d1ec
Added return error message again
bhavik001 Dec 11, 2023
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
16 changes: 16 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package.json
package-lock.json
node_modules/
.DS_Store
*.html
.gitignore
.prettierignore
.prettierrc
AUTHORS
CHECKS
docker-compose.yml
Dockerfile
LICENSE
nightwatch.conf.js
README.md
client-data/
36 changes: 36 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
env: {
commonjs: true,
es2021: true,
node: true,
},
extends: "eslint:recommended",
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parserOptions: {
ecmaVersion: "latest",
},
globals: {
Tools: true,
},
rules: {
"no-prototype-builtins": "off",
"no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
semi: ["error", "always"],
"no-cond-assign": ["error", "always"],
curly: "error",
"no-unsafe-finally": "off",
},
};
15 changes: 14 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,23 @@ jobs:

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

- name: Install dependencies
run: npm install

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

lint:
runs-on: ubuntu-latest

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

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npx eslint .
8 changes: 4 additions & 4 deletions client-data/js/intersect.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ if (
};

SVGGraphicsElement.prototype.transformedBBox = function (scale = 1) {
bbox = this.getBBox();
tmatrix = get_transform_matrix(this);
var bbox = this.getBBox();
var tmatrix = get_transform_matrix(this);
tmatrix.e /= scale;
tmatrix.f /= scale;
return {
Expand All @@ -71,13 +71,13 @@ if (
};

SVGSVGElement.prototype.transformedBBox = function (scale = 1) {
bbox = {
var bbox = {
x: this.x.baseVal.value,
y: this.y.baseVal.value,
width: this.width.baseVal.value,
height: this.height.baseVal.value,
};
tmatrix = get_transform_matrix(this);
var tmatrix = get_transform_matrix(this);
tmatrix.e /= scale;
tmatrix.f /= scale;
return {
Expand Down
Loading