Skip to content

Commit 58ebe9e

Browse files
committed
chore: migrate cli to modern eslint
1 parent 5d02799 commit 58ebe9e

16 files changed

+82
-96
lines changed

cli/.eslintignore

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

cli/.eslintrc.json

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

cli/.mocharc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module.exports = {
33
timeout: 10000,
44
reporter: 'spec',
55
recursive: true
6-
}
6+
}

cli/eslint.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { baseConfig } from '@packages/eslint-config'
2+
3+
export default [
4+
...baseConfig,
5+
{
6+
ignores: ['./index.js', '**/*.d.ts', 'lib/**/*.js', 'angular/**/*', 'react/**/*', 'svelte/**/*', 'vue/**/*', 'mount-utils/**/*'],
7+
},
8+
{
9+
rules: {
10+
'@stylistic/semi': 'off',
11+
'@stylistic/comma-dangle': 'off',
12+
'@stylistic/quotes': 'off',
13+
'@stylistic/no-undef': 'off',
14+
'padding-line-between-statements': 'off',
15+
'@stylistic/arrow-parens': 'off',
16+
},
17+
},
18+
]

cli/lib/util.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ const util = {
451451

452452
async function _getRealArch (): Promise<string> {
453453
const osPlatform = os.platform()
454-
// eslint-disable-next-line no-restricted-syntax
454+
455455
const osArch = os.arch()
456456

457457
debug('detecting arch %o', { osPlatform, osArch })
@@ -476,7 +476,6 @@ const util = {
476476
if (['aarch64_be', 'aarch64', 'armv8b', 'armv8l'].includes(stdout)) return 'arm64'
477477
}
478478

479-
// eslint-disable-next-line no-restricted-syntax
480479
const pkgArch = arch()
481480

482481
if (pkgArch === 'x86') return 'ia32'

cli/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"clean": "tsx ./scripts/clean.ts",
99
"dtslint": "dtslint types",
1010
"postinstall": "patch-package && tsx ./scripts/post-install.ts",
11-
"lint": "eslint --ext .ts,.tsx,.json,.vue .",
11+
"lint": "eslint",
1212
"prebuild": "yarn postinstall && tsx ./scripts/start-build.ts",
1313
"size": "t=\"cypress-v0.0.0.tgz\"; yarn pack --filename \"${t}\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
1414
"test": "yarn test-unit",
@@ -75,6 +75,7 @@
7575
"@cypress/sinon-chai": "2.9.1",
7676
"@cypress/svelte": "0.0.0-development",
7777
"@cypress/vue": "0.0.0-development",
78+
"@packages/eslint-config": "0.0.0-development",
7879
"@packages/root": "0.0.0-development",
7980
"@types/bluebird": "3.5.33",
8081
"@types/chai": "4.2.15",
@@ -91,7 +92,9 @@
9192
"cross-env": "7.0.3",
9293
"dependency-check": "4.1.0",
9394
"dtslint": "4.2.1",
95+
"eslint": "^9.31.0",
9496
"execa-wrap": "1.4.0",
97+
"jiti": "^2.4.2",
9598
"mocha": "6.2.2",
9699
"mock-fs": "5.4.0",
97100
"mocked-env": "1.3.2",

cli/test/lib/tasks/verify_spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ const DEFAULT_VERIFY_TIMEOUT = 30000
2828
let stdout: any
2929
let spawnedProcess: any
3030

31-
/* eslint-disable no-octal */
32-
3331
context('lib/tasks/verify', () => {
3432
before(async function () {
3533
const mochaMain = await import('mocha-banner')

cli/test/spec_helper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function throwIfFnNotStubbed (stub: any, method: string): void {
8282
const $stub = sinon.stub
8383

8484
sinon.stub = function (obj?: any, method?: string): any {
85-
/* eslint-disable prefer-rest-params */
8685
const stub = $stub.apply(this, arguments as any)
8786

8887
let fns = [method]

cli/test/support/stdout.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const stdoutModule = {
99
process.stdout.write = function (str: any): boolean {
1010
logs.push(str)
1111

12-
/* eslint-disable prefer-rest-params */
1312
return write.apply(this, arguments as any)
1413
}
1514

cli/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
99
"noImplicitAny": false,
1010
"types": [
11-
"mocha"
11+
"mocha",
12+
"node"
1213
]
1314
},
1415
"include": [

0 commit comments

Comments
 (0)