Skip to content

Commit f4d3670

Browse files
committed
MLE-24763 Upgrading from jshint to eslint
No linting fixes yet. Changing from the older jshint to the modern eslint. The eslint config doesn't enforce whitespace yet, will do that in a later PR.
1 parent 448f4ac commit f4d3670

File tree

5 files changed

+493
-1195
lines changed

5 files changed

+493
-1195
lines changed

.jshintrc

Lines changed: 0 additions & 11 deletions
This file was deleted.

eslint.config.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2015-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3+
*/
4+
5+
// ESLint 9+ flat config
6+
const globals = require("globals");
7+
8+
module.exports = [
9+
{
10+
// Base configuration for all JS files
11+
files: ["**/*.js"],
12+
languageOptions: {
13+
ecmaVersion: 2022,
14+
sourceType: "commonjs", // Node.js uses CommonJS
15+
globals: {
16+
...globals.commonjs,
17+
...globals.node,
18+
...globals.browser, // Add browser globals like setTimeout
19+
structuredClone: "readonly",
20+
// Legacy globals from old config
21+
Atomics: "readonly",
22+
SharedArrayBuffer: "readonly"
23+
}
24+
},
25+
rules: {
26+
// Spacing and formatting
27+
"indent": "off", // TODO: Fix indentation in separate PR
28+
"linebreak-style": ["error", "unix"],
29+
"quotes": ["error", "single"],
30+
"semi": ["error", "always"],
31+
32+
// Modern best practices
33+
"eqeqeq": "error",
34+
"curly": ["error", "all"], // Require braces for all control structures
35+
"no-unused-vars": "error",
36+
"no-undef": "error",
37+
38+
// Spacing rules (disabled for initial setup - TODO: Fix in separate PR)
39+
"arrow-spacing": "off",
40+
"space-before-blocks": "off",
41+
"space-before-function-paren": "off",
42+
"space-in-parens": "off",
43+
"object-curly-spacing": "off",
44+
"keyword-spacing": "off",
45+
"comma-spacing": "off",
46+
"key-spacing": "off",
47+
"space-infix-ops": "off",
48+
49+
// Style rules (disabled for initial setup - TODO: Fix in separate PR)
50+
"array-bracket-spacing": "off",
51+
"block-spacing": "off",
52+
"brace-style": "off",
53+
"func-call-spacing": "off",
54+
"no-trailing-spaces": "off",
55+
56+
// Disable console errors for this project
57+
"no-console": "off",
58+
59+
// Bracket notation preference
60+
"dot-notation": "error"
61+
}
62+
},
63+
{
64+
// Ignore patterns
65+
ignores: [
66+
"**/data/*.js",
67+
"node_modules/**",
68+
"coverage/**"
69+
]
70+
}
71+
];

gulpfile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
const path = require('path');
55
const gulp = require('gulp');
6-
const jshint = require('gulp-jshint');
6+
const eslint = require('gulp-eslint-new');
77
const mocha = require('gulp-mocha');
88
const jsdoc = require('gulp-jsdoc3');
99

@@ -17,9 +17,10 @@ const basicloader = require('./lib/basic-loader.js');
1717
const streamToArray = require("stream-to-array");
1818

1919
function lint() {
20-
return gulp.src('lib/*')
21-
.pipe(jshint({lookup:true}))
22-
.pipe(jshint.reporter('default'));
20+
return gulp.src('lib/*.js')
21+
.pipe(eslint({ overrideConfigFile: 'eslint.config.js' }))
22+
.pipe(eslint.format())
23+
.pipe(eslint.failAfterError());
2324
}
2425

2526
function test() {

0 commit comments

Comments
 (0)