Skip to content

Commit

Permalink
chore: use eslint-plugin-perfectionist (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley authored Oct 3, 2023
1 parent bcba56e commit 5ec8425
Show file tree
Hide file tree
Showing 117 changed files with 3,112 additions and 2,977 deletions.
13 changes: 4 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
"extends": [
"oclif",
"oclif-typescript",
"prettier"
],
"extends": ["oclif", "oclif-typescript", "prettier", "plugin:perfectionist/recommended-natural"],
"rules": {
"sort-imports": "error",
"unicorn/prefer-module": "off",
"unicorn/import-style": "error",
"unicorn/no-array-reduce": "off",
"unicorn/prefer-array-some": "off",
"no-useless-constructor": "off"
"no-useless-constructor": "off",
"perfectionist/sort-object-types": "off",
"perfectionist/sort-union-types": "off"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@
"@oclif/test": "^3.0.1",
"@types/ansi-styles": "^3.2.1",
"@types/benchmark": "^2.1.2",
"@types/chai-as-promised": "^7.1.5",
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.5",
"@types/clean-stack": "^2.1.1",
"@types/cli-progress": "^3.11.0",
"@types/ejs": "^3.1.2",
"@types/indent-string": "^4.0.1",
"@types/js-yaml": "^3.12.7",
"@types/mocha": "^10.0.2",
"@types/node-notifier": "^8.0.2",
"@types/node": "^18",
"@types/node-notifier": "^8.0.2",
"@types/slice-ansi": "^4.0.0",
"@types/strip-ansi": "^5.2.1",
"@types/supports-color": "^8.1.1",
Expand All @@ -63,6 +63,7 @@
"eslint-config-oclif": "^5.0.0",
"eslint-config-oclif-typescript": "^2.0.1",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-perfectionist": "^2.1.0",
"fancy-test": "^3.0.1",
"globby": "^11.1.0",
"husky": "^8",
Expand Down
7 changes: 4 additions & 3 deletions src/args.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {URL} from 'node:url'

import {Command} from './command'
import {Arg, ArgDefinition} from './interfaces/parser'
import {dirExists, fileExists} from './util/fs'
import {Command} from './command'
import {URL} from 'node:url'
import {isNotFalsy} from './util/util'

/**
Expand Down Expand Up @@ -36,7 +37,7 @@ export const boolean = custom<boolean>({
parse: async (b) => Boolean(b) && isNotFalsy(b),
})

export const integer = custom<number, {min?: number; max?: number}>({
export const integer = custom<number, {max?: number; min?: number}>({
async parse(input, _, opts) {
if (!/^-?\d+$/.test(input)) throw new Error(`Expected an integer but received: ${input}`)
const num = Number.parseInt(input, 10)
Expand Down
Loading

0 comments on commit 5ec8425

Please sign in to comment.