Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(W-17692101): eslint 9 #79

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-pre-core",
"files": [
"/bin",
"bin",
"/dist",
"/npm-shrinkwrap.json",
"/oclif.manifest.json"
Expand All @@ -24,14 +24,16 @@
"@oclif/plugin-plugins": "^3.10.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.5",
"@oclif/prettier-config": "^0.2.1",
"@oclif/test": "^1.2.8",
"@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 @@ -59,15 +61,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": ">=16.0.0"
},
"bugs": "https://github.com/oclif/plugin-test-cjs-config/issues",
"keywords": [
Expand Down
25 changes: 12 additions & 13 deletions src/commands/pre-core.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import {Command, flags} from '@oclif/command'

type Result = {
args: { [name: string]: any }
flags: { [name: string]: any }
args: {[name: string]: unknown}
flags: {[name: string]: unknown}
}

export default class PreCore extends Command {
static flags = {
optionalString: flags.string(),
defaultString: flags.string({
default: 'simple string default',
}),
defaultFnString: flags.string({
default: () => 'fn default',
}),
json: flags.boolean(),
}

static args = [
{
name: 'optionalArg',
Expand All @@ -30,6 +19,16 @@ export default class PreCore extends Command {
default: (): string => 'fn default',
},
]
static flags = {
optionalString: flags.string(),
defaultString: flags.string({
default: 'simple string default',
}),
defaultFnString: flags.string({
default: () => 'fn default',
}),
json: flags.boolean(),
}

async run(): Promise<Result> {
const {args, flags} = this.parse(PreCore)
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
Loading