Skip to content

Commit 31d2d54

Browse files
committed
WIP - Convert to ESLint 9
1 parent 7e8bf7a commit 31d2d54

Some content is hidden

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

45 files changed

+404
-272
lines changed

eslint.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const config = createConfig([
4949
files: ['**/*.ts'],
5050
extends: typescript,
5151
rules: {
52+
'@typescript-eslint/no-explicit-any': 'error',
5253
'@typescript-eslint/explicit-function-return-type': [
5354
'error',
5455
{
@@ -74,6 +75,9 @@ const config = createConfig([
7475
'!src/ui/**',
7576
],
7677
extends: nodejs,
78+
rules: {
79+
'n/no-process-env': 'off',
80+
},
7781
},
7882

7983
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"dependencies": {
2929
"@metamask/action-utils": "^1.0.0",
3030
"@metamask/auto-changelog": "^4.0.0",
31-
"@metamask/utils": "^9.0.0",
31+
"@metamask/utils": "^11.8.1",
3232
"debug": "^4.3.4",
3333
"execa": "^8.0.1",
3434
"express": "^4.21.2",

src/command-line-arguments.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
import yargs from 'yargs/yargs';
21
import { hideBin } from 'yargs/helpers';
2+
import yargs from 'yargs/yargs';
33

4+
/**
5+
*
6+
*/
47
export type CommandLineArguments = {
58
projectDirectory: string;
69
tempDirectory: string | undefined;

src/dirname.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { fileURLToPath } from 'url';
21
import { dirname } from 'path';
2+
import { fileURLToPath } from 'url';
33

44
const __filename = fileURLToPath(import.meta.url);
55
const __dirname = dirname(__filename);

src/editor.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { when } from 'jest-when';
2+
23
import { determineEditor } from './editor.js';
34
import * as envModule from './env.js';
45
import * as miscUtils from './misc-utils.js';

src/editor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { debug, resolveExecutable } from './misc-utils.js';
44
/**
55
* Information about the editor present on the user's computer.
66
*
7-
* @property path - The path to the executable representing the editor.
8-
* @property args - Command-line arguments to pass to the executable when
7+
* path - The path to the executable representing the editor.
8+
*
9+
* args - Command-line arguments to pass to the executable when
910
* calling it.
1011
*/
1112
export type Editor = {

src/env.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
*
3+
*/
14
type Env = {
25
EDITOR: string | undefined;
36
};

src/fs.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import * as actionUtils from '@metamask/action-utils';
12
import fs from 'fs';
3+
import { when } from 'jest-when';
24
import path from 'path';
35
import { rimraf } from 'rimraf';
4-
import { when } from 'jest-when';
5-
import * as actionUtils from '@metamask/action-utils';
6-
import { withSandbox } from '../tests/helpers.js';
6+
77
import {
88
readFile,
99
writeFile,
@@ -13,6 +13,7 @@ import {
1313
ensureDirectoryPathExists,
1414
removeFile,
1515
} from './fs.js';
16+
import { withSandbox } from '../tests/helpers.js';
1617

1718
jest.mock('@metamask/action-utils');
1819

src/fs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import fs from 'fs';
21
import {
32
readJsonObjectFile as underlyingReadJsonObjectFile,
43
writeJsonFile as underlyingWriteJsonFile,
54
} from '@metamask/action-utils';
5+
import fs from 'fs';
6+
67
import { wrapError, isErrorWithCode } from './misc-utils.js';
78

89
/**

src/initial-parameters.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
import { when } from 'jest-when';
12
import os from 'os';
23
import path from 'path';
3-
import { when } from 'jest-when';
4+
5+
import * as commandLineArgumentsModule from './command-line-arguments.js';
6+
import * as envModule from './env.js';
7+
import { determineInitialParameters } from './initial-parameters.js';
8+
import * as projectModule from './project.js';
49
import {
510
buildMockProject,
611
buildMockPackage,
712
createNoopWriteStream,
813
} from '../tests/unit/helpers.js';
9-
import { determineInitialParameters } from './initial-parameters.js';
10-
import * as commandLineArgumentsModule from './command-line-arguments.js';
11-
import * as envModule from './env.js';
12-
import * as projectModule from './project.js';
1314

1415
jest.mock('./command-line-arguments');
1516
jest.mock('./env');

0 commit comments

Comments
 (0)