Skip to content

Commit

Permalink
build(deps): eslint 9 adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
wozjac committed Jun 19, 2024
1 parent 1b5b9ba commit e7a51a8
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 34 deletions.
24 changes: 0 additions & 24 deletions config/.eslintrc.json

This file was deleted.

25 changes: 25 additions & 0 deletions config/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import globals from "globals";
import js from "@eslint/js";

export default [
{
ignores: ["node_modules/**", "dist/**", "coverage/**"],
},
js.configs.recommended,
{
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser,
...globals.commonjs,
...globals.jquery,
...globals.mocha,
},
sourceType: "module",
},
rules: {
quotes: ["error", "double"],
semi: ["error", "always"],
},
},
];
32 changes: 26 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"scripts": {
"coverage": "c8 npm test",
"coveralls": "c8 npm test && c8 report --reporter=text-lcov | coveralls",
"lint": "eslint -c config/.eslintrc.json src/**.*js",
"lint": "eslint -c config/eslint.config.js src/**.*js",
"pretest": "npm run lint",
"test": "mocha",
"rollup": "rollup -c config/rollup.config.js && rollup -c config/rollup.config.env.js",
Expand All @@ -40,6 +40,7 @@
"devDependencies": {
"@babel/core": "^7.14.2",
"@babel/preset-env": "^7.14.2",
"@eslint/js": "^9.5.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
Expand All @@ -49,6 +50,7 @@
"coveralls-next": "^4.2.1",
"eslint": "^9.5.0",
"faker": "^5.5.3",
"globals": "^15.6.0",
"jsdoc": "^3.6.7",
"mocha": "^8.4.0",
"mocha-lcov-reporter": "^1.3.0",
Expand Down
2 changes: 0 additions & 2 deletions src/DataGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,12 @@ export class DataGenerator {
-2147483648 + this.getPseudoRandomNumber("Binary") * 4294967295
);
let sMask = "";
/*eslint-disable */
for (
let nFlag = 0, nShifted = nMask;
nFlag < 32;
nFlag++, sMask += String(nShifted >>> 31), nShifted <<= 1
);

/*eslint-enable*/
return sMask;
}
case "DateTimeOffset": {
Expand Down
6 changes: 5 additions & 1 deletion src/ODataMockGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export class ODataMockGenerator {
try {
this._metdataXMLDocument = parseXML(metadata);
} catch (error) {
throw new Error("Metadata XML parsing error - is the document correct?");
throw new Error(
"Metadata XML parsing error - is the document correct? --> " + error
);
}
}

Expand Down Expand Up @@ -188,6 +190,7 @@ export class ODataMockGenerator {
try {
oMockData[oNavProp.to.entitySet][i][oNavProp.to.propRef[j]] =
oEntity[oNavProp.from.propRef[j]];
// eslint-disable-next-line no-unused-vars
} catch (error) {
throw new Error(
`Could not find a respective entry in ${oNavProp.to.entitySet} ` +
Expand Down Expand Up @@ -440,6 +443,7 @@ export class ODataMockGenerator {
}

return generatedValue;
// eslint-disable-next-line no-unused-vars
} catch (error) {
throw new Error(
`faker.js call error, check the config for ${entityType.name}/${property.name}`
Expand Down

0 comments on commit e7a51a8

Please sign in to comment.