Skip to content

Commit 893c54a

Browse files
authored
chore: Update TypeScript-ESLint (#78)
* chore: Update TypeScript-ESLint * Update pnpm-lock.yaml
1 parent d09dc29 commit 893c54a

File tree

5 files changed

+72
-1081
lines changed

5 files changed

+72
-1081
lines changed

eslint.config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22

33
import eslint from '@eslint/js';
44
import nodePlugin from 'eslint-plugin-n';
5-
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
65
import simpleImportSort from 'eslint-plugin-simple-import-sort';
76
import tsEslint from 'typescript-eslint';
87

9-
// mimic CommonJS variables -- not needed if using CommonJS
10-
// import { FlatCompat } from "@eslint/eslintrc";
11-
// const __dirname = fileURLToPath(new URL('.', import.meta.url));
12-
// const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: eslint.configs.recommended});
13-
148
export default tsEslint.config(
159
eslint.configs.recommended,
1610
nodePlugin.configs['flat/recommended'],
17-
eslintPluginPrettierRecommended,
1811
...tsEslint.configs.recommended,
1912
{
2013
ignores: ['**/dist/**', '**/node_modules/**', '/*/*/coverage/**'],

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,14 @@
4545
"homepage": "https://github.com/streetsidesoftware/perf-insight#readme",
4646
"license": "MIT",
4747
"devDependencies": {
48-
"@eslint/eslintrc": "^3.1.0",
4948
"@eslint/js": "^9.8.0",
5049
"@tsconfig/node20": "^20.1.4",
5150
"@types/node": "^20.14.14",
5251
"@vitest/coverage-v8": "^2.0.5",
5352
"cspell": "^8.13.2",
5453
"cspell-trie-lib": "^8.13.2",
5554
"eslint": "^9.8.0",
56-
"eslint-config-prettier": "^9.1.0",
57-
"eslint-import-resolver-typescript": "^3.6.1",
58-
"eslint-plugin-import": "^2.29.1",
5955
"eslint-plugin-n": "^17.10.2",
60-
"eslint-plugin-prettier": "^5.2.1",
6156
"eslint-plugin-simple-import-sort": "^12.1.1",
6257
"globals": "^15.9.0",
6358
"inject-markdown": "^3.1.0",
@@ -66,7 +61,7 @@
6661
"prettier": "^3.3.3",
6762
"ts-node": "^10.9.2",
6863
"typescript": "^5.5.4",
69-
"typescript-eslint": "^7.18.0",
64+
"typescript-eslint": "^8.0.1",
7065
"vite": "^5.4.0",
7166
"vitest": "^2.0.5"
7267
}

packages/perf-insight/src/app.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export async function app(program = defaultCommand): Promise<Command> {
6464

6565
await spawnRunners(files, options);
6666

67-
process.exitCode ? console.log(chalk.red('failed.')) : console.log(chalk.green('done.'));
67+
return process.exitCode ? console.log(chalk.red('failed.')) : console.log(chalk.green('done.'));
6868
});
6969

7070
program.showHelpAfterError();
@@ -127,8 +127,8 @@ function spawnRunner(args: string[]): Promise<number | undefined> {
127127
if (completed) return;
128128
clearTimeout(timeout);
129129
completed = true;
130-
process.connected && process.disconnect();
131-
error ? reject(error) : resolve(exitCode);
130+
if (process.connected) process.disconnect();
131+
return error ? reject(error) : resolve(exitCode);
132132
}
133133

134134
process.on('error', (err) => {

packages/perf-insight/src/perfSuite.mts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,7 @@ async function runTests(
269269
}
270270
}
271271
};
272-
const reportTestIteration =
273-
progress?.testIteration ??
274-
(() => {
275-
spinner.isSpinning && spinner.render();
276-
});
272+
const reportTestIteration = progress?.testIteration ?? (() => spinner.isSpinning && spinner.render());
277273

278274
const context: RunnerContext = {
279275
test,
@@ -304,7 +300,7 @@ async function runTests(
304300
}
305301

306302
function addTest(test: TestDefinition) {
307-
filterTest(test.name) && tests.push(test);
303+
if (filterTest(test.name)) tests.push(test);
308304
}
309305

310306
function test(name: string, method: () => void, timeout?: number): void {

0 commit comments

Comments
 (0)