Skip to content

Commit 015031d

Browse files
Run lint locally before tests; fix parameter-property lint error (#250)
CI runs `npm run lint` but the local `npm test` did not, so lint failures (like the eslint parameter-property warning in malloySQL.ts) only showed up at publish time. Add `pretest`/`pretest-silent` hooks so lint gates the local test run, and fix the existing violation by collapsing the VirtualURIFileHandler constructor into a parameter property. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 94fe16d commit 015031d

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
},
2222
"scripts": {
2323
"lint": "tsc --noEmit && eslint .",
24+
"pretest": "npm run lint",
2425
"test": "NODE_ENV=test jest --projects jest.config.js --runInBand",
26+
"pretest-silent": "npm run lint",
2527
"test-silent": "NODE_ENV=test JEST_SILENT_REPORTER_SHOW_PATHS=true jest --projects jest.config.js --runInBand --reporters jest-silent-reporter",
2628
"test-e2e": "npm run package-npm test > /dev/null 2>&1 && NODE_ENV=test jest --projects=jest-e2e.config.js --runInBand",
2729
"test-silent-e2e": "npm run package-npm test > /dev/null 2>&1 && NODE_ENV=test JEST_SILENT_REPORTER_SHOW_PATHS=true jest --projects=jest-e2e.config.js --runInBand --reporters jest-silent-reporter",

src/malloy/malloySQL.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ import {
1717
} from './util';
1818

1919
class VirtualURIFileHandler implements URLReader {
20-
private uriReader: URLReader;
2120
private url: URL = new URL('malloy://internal');
2221
private contents: string = '';
2322

24-
constructor(uriReader: URLReader) {
25-
this.uriReader = uriReader;
26-
}
23+
constructor(private uriReader: URLReader) {}
2724

2825
public setVirtualFile(url: URL, contents: string): void {
2926
this.url = url;

0 commit comments

Comments
 (0)