Skip to content

Commit

Permalink
Merge pull request #81 from oclif/mdonnalley/eslint-9
Browse files Browse the repository at this point in the history
chore(W-17692101): eslint 9
  • Loading branch information
mdonnalley authored Jan 30, 2025
2 parents aa8f91f + 63d460d commit 287c4d8
Show file tree
Hide file tree
Showing 8 changed files with 1,788 additions and 769 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@oclif/prettier-config"
22 changes: 22 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {includeIgnoreFile} from '@eslint/compat'
import oclif from 'eslint-config-oclif'
import prettier from 'eslint-config-prettier'
import path from 'node:path'
import {fileURLToPath} from 'node:url'

const gitignorePath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.gitignore')

export default [
includeIgnoreFile(gitignorePath),
...oclif,
prettier,
{
rules: {
'@typescript-eslint/no-require-imports': 'off',
'perfectionist/sort-objects': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/no-empty-file': 'off',
},
},
]
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "dist/index.js",
"repository": "oclif/plugin-test-core-v2",
"files": [
"/bin",
"bin",
"/dist",
"/npm-shrinkwrap.json",
"/oclif.manifest.json"
Expand All @@ -22,14 +22,16 @@
"@oclif/plugin-plugins": "^3.10.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.5",
"@oclif/prettier-config": "^0.2.1",
"@oclif/test": "^2.5.6",
"@types/chai": "^4",
"@types/mocha": "^9.0.0",
"@types/node": "^16.18.125",
"chai": "^4",
"eslint": "^7.32.0",
"eslint-config-oclif": "^4",
"eslint-config-oclif-typescript": "^1.0.3",
"eslint": "^9.19.0",
"eslint-config-oclif": "^6.0.0",
"eslint-config-prettier": "^10.0.1",
"mocha": "^9",
"oclif": "^3.17.2",
"shx": "^0.3.4",
Expand Down Expand Up @@ -57,15 +59,15 @@
},
"scripts": {
"build": "shx rm -rf dist && tsc -b",
"lint": "eslint . --ext .ts --config .eslintrc",
"lint": "eslint",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "yarn lint",
"prepack": "yarn build && oclif manifest && oclif readme",
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
"version": "oclif readme && git add README.md"
},
"engines": {
"node": ">=12.0.0"
"node": ">=18.0.0"
},
"bugs": "https://github.com/oclif/plugin-test-core-v2/issues",
"keywords": [
Expand Down
22 changes: 10 additions & 12 deletions src/commands/core-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,25 @@ type Result = {
}

export default class CoreV2 extends Command {
static flags = {
optionalString: Flags.string(),
defaultString: Flags.string({
default: 'simple string default',
}),
defaultFnString: Flags.string({
default: async () => Promise.resolve('async fn default'),
}),
}

static args = {
optionalArg: Args.string(),
defaultArg: Args.string({
default: 'simple string default',
}),
defaultFnArg: Args.string({
default: async () => Promise.resolve('async fn default'),
default: async () => 'async fn default',
}),
}

static enableJsonFlag = true
static flags = {
optionalString: Flags.string(),
defaultString: Flags.string({
default: 'simple string default',
}),
defaultFnString: Flags.string({
default: async () => 'async fn default',
}),
}

async run(): Promise<Result> {
const {args, flags} = await this.parse(CoreV2)
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/init.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path')
const path = require('node:path')
process.env.TS_NODE_PROJECT = path.resolve('test/tsconfig.json')
process.env.NODE_ENV = 'development'

global.oclif = global.oclif || {}
global.oclif.columns = 80
globalThis.oclif = globalThis.oclif || {}
globalThis.oclif.columns = 80
Loading

0 comments on commit 287c4d8

Please sign in to comment.