Skip to content

Commit 9ae8152

Browse files
committed
Replace eslint with oxlint
- replace eslint with oxlint - add vscode suggested extensions and settings - replace npm test:plus w/ npm check
1 parent c8620a2 commit 9ae8152

59 files changed

Lines changed: 918 additions & 2752 deletions

Some content is hidden

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

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For items that are not-applicable, mark "N/A" and ✔.
99
- [ ] Tests are included and test edge cases
1010
- [ ] Tests have been run locally and pass
1111
- [ ] Code coverage has not gone down and all code touched or added is covered.
12-
- [ ] Code passes lint and prettier (hint: use `npm run test:plus` to run tests, lint, and prettier)
12+
- [ ] Code passes lint and prettier (hint: use `npm run check` to run tests, lint, and prettier)
1313
- [ ] All dependent libraries are appropriately updated or have a corresponding PR related to this change
1414
- [ ] `cql4browsers.js` built with `npm run build:browserify` if source changed.
1515

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ lib-test
33
node_modules
44
.DS_Store
55
.nyc_output
6-
.vscode
6+
.vscode/*
7+
!.vscode/extensions.json
8+
!.vscode/settings.sample.json
79
coverage
810
*.original.coffee
911
yarn-error.log

.oxlintrc.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"env": {
4+
"builtin": true,
5+
"es6": true,
6+
"mocha": true,
7+
"node": true
8+
},
9+
"ignorePatterns": [
10+
"**/lib",
11+
"**/lib-test",
12+
"test-server/**",
13+
"examples/browser/cql4browsers.js"
14+
],
15+
"rules": {
16+
"no-loss-of-precision": "off",
17+
"no-unused-vars": [
18+
"error",
19+
{
20+
"argsIgnorePattern": "^_"
21+
}
22+
],
23+
"no-var": "error",
24+
"prefer-const": "error",
25+
"prefer-rest-params": "error",
26+
"prefer-spread": "error",
27+
"curly": "error",
28+
"no-console": [
29+
"warn",
30+
{
31+
"allow": [
32+
"warn",
33+
"error"
34+
]
35+
}
36+
]
37+
},
38+
"overrides": [
39+
{
40+
"files": [
41+
"test/elm/**/*.js"
42+
],
43+
"rules": {
44+
"unicorn/no-empty-file": "off"
45+
}
46+
}
47+
]
48+
}

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
// recommended for lint and code formatting
4+
"oxc.oxc-vscode",
5+
"esbenp.prettier-vscode"
6+
]
7+
}

.vscode/settings.sample.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"[javascript][typescript][typescriptreact]": {
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
},
6+
"[json]": {
7+
"editor.formatOnSave": true,
8+
"editor.defaultFormatter": "vscode.json-language-features"
9+
}
10+
}

DEPENDENCY_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ The following notes about the app's dependencies should be revisited and resolve
33
As of 2026-07-27:
44

55
- `@types/node`: Consider updating to `26.x` in the future, but for now `24.x` still has plent of time in LTS.
6-
- `typescript`: `7.x` uses a new native compiler without a native API. Libraries like `ts-node` and `typescript-eslint` do not yet support it.
6+
- `typescript`: `7.x` uses a new native compiler without a native API. Libraries like `ts-node` do not yet support it.
77
- `tslog` (test-server only): `5.x` is ESM-only and replaces v4's flat logger settings such as `hideLogPositionForProduction` and `prettyLogTemplate`. Updating will require some migration.

bin/browserify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
/* eslint-disable no-console */
3+
/* oxlint-disable no-console */
44

55
// We cannot use browserify CLI because there is no way to pass options into presets
66

eslint.config.mjs

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

examples/browser/cql4browsers.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ __exportStar(require("./ratio"), exports);
560560
"use strict";
561561
Object.defineProperty(exports, "__esModule", { value: true });
562562
exports.MAX_TIME_VALUE = exports.MIN_TIME_VALUE = exports.MAX_DATE_VALUE = exports.MIN_DATE_VALUE = exports.MAX_DATETIME_VALUE = exports.MIN_DATETIME_VALUE = exports.Date = exports.DateTime = void 0;
563-
/* eslint-disable @typescript-eslint/ban-ts-comment */
564563
const uncertainty_1 = require("./uncertainty");
565564
const util_1 = require("../util/util");
566565
const luxon_1 = require("luxon");
@@ -1245,7 +1244,7 @@ class DateTime extends AbstractDate {
12451244
// consider seconds and milliseconds as a single combined precision with decimal semantics
12461245
// this means that if milliseconds are not specified, then we treat it as though their
12471246
// millisecond value is "0" so that no Uncertainty will be produced
1248-
/* eslint-disable @typescript-eslint/no-this-alias */
1247+
/* oxlint-disable @typescript/no-this-alias */
12491248
let aDateTime = this;
12501249
let bDateTime = other;
12511250
if (this.second !== null &&
@@ -2501,7 +2500,6 @@ class ThreeValuedLogic {
25012500
return null;
25022501
}
25032502
else {
2504-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
25052503
// @ts-ignore
25062504
return val.reduce((a, b) => (!a ^ !b) === 1);
25072505
}
@@ -3942,7 +3940,6 @@ var __importStar = (this && this.__importStar) || (function () {
39423940
})();
39433941
Object.defineProperty(exports, "__esModule", { value: true });
39443942
exports.build = build;
3945-
/* eslint-disable @typescript-eslint/ban-ts-comment */
39463943
const E = __importStar(require("./expressions"));
39473944
const util_1 = require("../util/util");
39483945
function build(json) {
@@ -4389,6 +4386,7 @@ exports.If = If;
43894386
class CaseItem {
43904387
constructor(json) {
43914388
this.when = (0, builder_1.build)(json.when);
4389+
// oxlint-disable-next-line unicorn/no-thenable -- CaseItem mirrors ELM's `then` field.
43924390
this.then = (0, builder_1.build)(json.then);
43934391
}
43944392
}
@@ -4467,7 +4465,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
44674465
exports.DurationBetween = exports.DifferenceBetween = exports.TimezoneOffsetFrom = exports.TimeFrom = exports.DateFrom = exports.DateTimeComponentFrom = exports.TimeOfDay = exports.Now = exports.Today = exports.Time = exports.Date = exports.DateTime = void 0;
44684466
exports.doAfter = doAfter;
44694467
exports.doBefore = doBefore;
4470-
/* eslint-disable @typescript-eslint/ban-ts-comment */
44714468
const expression_1 = require("./expression");
44724469
const builder_1 = require("./builder");
44734470
const literal_1 = require("./literal");
@@ -6559,7 +6556,6 @@ var __importStar = (this && this.__importStar) || (function () {
65596556
})();
65606557
Object.defineProperty(exports, "__esModule", { value: true });
65616558
exports.Precision = exports.SameOrBefore = exports.SameOrAfter = exports.SameAs = exports.Before = exports.After = exports.Length = exports.ProperContains = exports.ProperIn = exports.ProperIncludedIn = exports.ProperIncludes = exports.IncludedIn = exports.Includes = exports.Contains = exports.In = exports.Indexer = exports.Intersect = exports.Except = exports.Union = exports.NotEqual = exports.Equivalent = exports.Equal = void 0;
6562-
/* eslint-disable @typescript-eslint/ban-ts-comment */
65636559
const expression_1 = require("./expression");
65646560
const logic_1 = require("../datatypes/logic");
65656561
const datetime_1 = require("../datatypes/datetime");
@@ -7121,7 +7117,6 @@ class ByDirection extends expression_1.Expression {
71217117
this.low_order = this.direction === 'asc' || this.direction === 'ascending' ? -1 : 1;
71227118
this.high_order = this.low_order * -1;
71237119
}
7124-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
71257120
// @ts-ignore
71267121
async exec(ctx, a, b) {
71277122
if (a === b) {
@@ -7152,7 +7147,6 @@ class ByExpression extends expression_1.Expression {
71527147
this.low_order = this.direction === 'asc' || this.direction === 'ascending' ? -1 : 1;
71537148
this.high_order = this.low_order * -1;
71547149
}
7155-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
71567150
// @ts-ignore
71577151
async exec(ctx, a, b) {
71587152
let sctx = ctx.childContext(a);
@@ -8593,7 +8587,7 @@ function guessSpecifierType(val) {
85938587
else if (Array.isArray(val)) {
85948588
// Get unique types from the array (by converting to string and putting in a Set)
85958589
const typesAsStrings = Array.from(new Set(val.map(v => JSON.stringify(guessSpecifierType(v)))));
8596-
const types = typesAsStrings.map(ts => (/^{/.test(ts) ? JSON.parse(ts) : ts));
8590+
const types = typesAsStrings.map(ts => (ts.startsWith('{') ? JSON.parse(ts) : ts));
85978591
return {
85988592
type: elmTypes_1.ELM_LIST_TYPE_SPECIFIER,
85998593
elementType: types.length == 1 ? types[0] : { type: elmTypes_1.ELM_CHOICE_TYPE_SPECIFIER, choice: types }
@@ -9181,7 +9175,7 @@ class ConsoleMessageListener {
91819175
this.logSourceOnTrace = logSourceOnTrace;
91829176
}
91839177
onMessage(source, code, severity, message) {
9184-
// eslint-disable-next-line no-console
9178+
// oxlint-disable-next-line no-console
91859179
const print = severity === 'Error' ? console.error : console.log;
91869180
let content = `${severity}: [${code}] ${message}`;
91879181
if (severity === 'Trace' && this.logSourceOnTrace) {

examples/node/exec-age.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
/* eslint-disable
2-
no-console,
3-
*/
1+
/* oxlint-disable no-console */
2+
43
const cql = require('../../lib/cql');
54
const measure = require('./age.json');
65

0 commit comments

Comments
 (0)