Skip to content

Commit 111b991

Browse files
committed
chore(W-17692101): eslint 9
1 parent 6f06cf9 commit 111b991

File tree

11 files changed

+543
-312
lines changed

11 files changed

+543
-312
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

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

bin/dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node_modules/.bin/ts-node
2-
// eslint-disable-next-line node/shebang, unicorn/prefer-top-level-await
2+
33
;(async () => {
44
const oclif = await import('@oclif/core')
55
await oclif.execute({development: true, dir: __dirname})

bin/run.js

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

3-
// eslint-disable-next-line unicorn/prefer-top-level-await
4-
(async () => {
3+
;(async () => {
54
const oclif = await import('@oclif/core')
65
await oclif.execute({dir: __dirname})
76
})()

eslint.config.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {includeIgnoreFile} from '@eslint/compat'
2+
import oclif from 'eslint-config-oclif'
3+
import prettier from 'eslint-config-prettier'
4+
import path from 'node:path'
5+
import {fileURLToPath} from 'node:url'
6+
7+
const gitignorePath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.gitignore')
8+
9+
export default [
10+
includeIgnoreFile(gitignorePath),
11+
...oclif,
12+
prettier,
13+
{
14+
rules: {
15+
'@typescript-eslint/no-require-imports': 'off',
16+
'perfectionist/sort-objects': 'off',
17+
'unicorn/prefer-module': 'off',
18+
'unicorn/prefer-top-level-await': 'off',
19+
'unicorn/no-empty-file': 'off',
20+
},
21+
},
22+
]

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
"@oclif/plugin-plugins": "^5"
1414
},
1515
"devDependencies": {
16+
"@eslint/compat": "^1.2.5",
1617
"@oclif/prettier-config": "^0.2.1",
1718
"@oclif/test": "^3",
1819
"@types/chai": "^4",
1920
"@types/mocha": "^10",
2021
"@types/node": "^18",
2122
"chai": "^4",
22-
"eslint": "^8",
23-
"eslint-config-oclif": "^5",
24-
"eslint-config-oclif-typescript": "^3",
25-
"eslint-config-prettier": "^9",
23+
"eslint": "^9.19.0",
24+
"eslint-config-oclif": "^6.0.0",
25+
"eslint-config-prettier": "^10.0.1",
2626
"mocha": "^10",
2727
"oclif": "^4",
2828
"shx": "^0.3.3",
@@ -33,7 +33,7 @@
3333
"node": ">=18.0.0"
3434
},
3535
"files": [
36-
"/bin",
36+
"bin",
3737
"/dist",
3838
"/oclif.manifest.json"
3939
],
@@ -64,7 +64,7 @@
6464
"repository": "oclif/plugin-test-core-v3",
6565
"scripts": {
6666
"build": "shx rm -rf dist && tsc -b",
67-
"lint": "eslint . --ext .ts",
67+
"lint": "eslint",
6868
"postpack": "shx rm -f oclif.manifest.json",
6969
"posttest": "yarn lint",
7070
"prepack": "oclif manifest && oclif readme",

src/commands/core-v3.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable perfectionist/sort-objects */
21
import {Args, Command, Flags, Interfaces} from '@oclif/core'
32

43
type Result = {
@@ -16,9 +15,7 @@ export default class CoreV3 extends Command {
1615
default: async () => 'async fn default',
1716
}),
1817
}
19-
2018
static enableJsonFlag = true
21-
2219
static flags = {
2320
optionalString: Flags.string(),
2421
defaultString: Flags.string({

src/commands/hello/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ export default class Hello extends Command {
44
static args = {
55
person: Args.string({description: 'Person to say hello to', required: true}),
66
}
7-
87
static description = 'Say hello'
9-
108
static examples = [
119
`<%= config.bin %> <%= command.id %> friend --from oclif
1210
hello friend from oclif! (./src/commands/hello/index.ts)
1311
`,
1412
]
15-
1613
static flags = {
1714
from: Flags.string({char: 'f', description: 'Who is saying hello', required: true}),
1815
}

src/commands/hello/world.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import {Command} from '@oclif/core'
22

33
export default class World extends Command {
44
static args = {}
5-
65
static description = 'Say hello world'
7-
86
static examples = [
97
`<%= config.bin %> <%= command.id %>
108
hello world! (./src/commands/hello/world.ts)
119
`,
1210
]
13-
1411
static flags = {}
1512

1613
async run(): Promise<void> {

test/commands/core-v3.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// eslint-disable-next-line unicorn/no-empty-file
1+

0 commit comments

Comments
 (0)