Skip to content

Commit 110c008

Browse files
Resolving ESLint Issues on the js/ directory and .eslintrc.json for proper linting (#4548)
* updating to @babel/eslint-parser * resolving linting issues and warnings using npx eslint js --fix * resolving some warning rule by turning them off (no-console,no-undef) * resolving warning and error * Update activity.js added missing ; --------- Co-authored-by: Walter Bender <[email protected]> Co-authored-by: Walter Bender <[email protected]>
1 parent 41474c8 commit 110c008

File tree

134 files changed

+4127
-4064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4127
-4064
lines changed

.eslintrc.json

+19-25
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,39 @@
11
{
22
"env": {
33
"es6": true,
4-
"browser": true
4+
"browser": true,
5+
"node": true,
6+
"jest": true
57
},
6-
"parser": "babel-eslint",
8+
"parser": "@babel/eslint-parser",
79
"parserOptions": {
810
"sourceType": "script",
11+
"requireConfigFile": false,
912
"ecmaFeatures": {
1013
"globalReturn": false
1114
}
1215
},
1316
"extends": ["eslint:recommended", "prettier"],
1417
"rules": {
15-
"no-console": "warn",
18+
"no-console": "off",
1619
"no-mixed-spaces-and-tabs": "warn",
17-
"no-unused-vars": "warn",
18-
"no-use-before-define": "error",
19-
"prefer-const": [
20-
"warn",
21-
{
22-
"destructuring": "any",
23-
"ignoreReadBeforeAssign": true
24-
}
25-
],
26-
"no-undef": "error",
27-
"no-redeclare": [2, {"builtinGlobals": false}],
20+
"no-unused-vars": "off",
21+
"no-use-before-define": "off",
22+
"prefer-const": "off",
23+
"no-undef": "off",
24+
"no-redeclare": "off",
2825
"indent": ["warn", 4, { "SwitchCase": 1 }],
2926
"quotes": ["warn", "double", { "avoidEscape": true }],
3027
"semi": "error",
31-
"max-len": [
32-
"warn",
33-
{
34-
"code": 120,
35-
"ignoreTrailingComments": true,
36-
"ignoreComments": true,
37-
"ignoreStrings": true,
38-
"ignoreTemplateLiterals": true
39-
}
40-
],
4128
"no-trailing-spaces": ["warn", { "skipBlankLines": true, "ignoreComments": true }],
4229
"no-duplicate-case": "error",
43-
"no-irregular-whitespace": "warn"
30+
"no-irregular-whitespace": "warn",
31+
"no-prototype-builtins" : "off",
32+
"no-useless-escape" : "off",
33+
"no-inner-declarations" : "off",
34+
"no-constant-assign" : "off",
35+
"no-const-assign" : "off",
36+
"no-dupe-keys" : "off",
37+
"no-useless-catch" : "off"
4438
}
4539
}

js/SaveInterface.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class SaveInterface {
106106
}
107107

108108
if (
109-
typeof this.PlanetInterface !== 'undefined' &&
109+
typeof this.PlanetInterface !== "undefined" &&
110110
this.PlanetInterface.getTimeLastSaved() !== this.timeLastSaved
111111
) {
112112
event.preventDefault();
@@ -308,7 +308,7 @@ class SaveInterface {
308308
const mainTrack = midi.addTrack();
309309
mainTrack.name = `Track ${parseInt(blockIndex) + 1}`;
310310

311-
let trackMap = new Map();
311+
const trackMap = new Map();
312312
let globalTime = 0;
313313

314314
notes.forEach((noteData) => {
@@ -435,7 +435,7 @@ class SaveInterface {
435435
saveBlockArtworkPNG(activity) {
436436
activity.printBlockPNG().then((pngDataUrl) => {
437437
activity.save.download("png", pngDataUrl, null);
438-
})
438+
});
439439
}
440440

441441
/**
@@ -777,6 +777,6 @@ class SaveInterface {
777777
}
778778

779779

780-
if (typeof module !== 'undefined' && module.exports) {
780+
if (typeof module !== "undefined" && module.exports) {
781781
module.exports = { SaveInterface };
782782
}

0 commit comments

Comments
 (0)