Skip to content

Commit 5ec8425

Browse files
authored
chore: use eslint-plugin-perfectionist (#807)
1 parent bcba56e commit 5ec8425

File tree

117 files changed

+3112
-2977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+3112
-2977
lines changed

.eslintrc.json

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
2-
"extends": [
3-
"oclif",
4-
"oclif-typescript",
5-
"prettier"
6-
],
2+
"extends": ["oclif", "oclif-typescript", "prettier", "plugin:perfectionist/recommended-natural"],
73
"rules": {
8-
"sort-imports": "error",
94
"unicorn/prefer-module": "off",
10-
"unicorn/import-style": "error",
115
"unicorn/no-array-reduce": "off",
12-
"unicorn/prefer-array-some": "off",
13-
"no-useless-constructor": "off"
6+
"no-useless-constructor": "off",
7+
"perfectionist/sort-object-types": "off",
8+
"perfectionist/sort-union-types": "off"
149
}
1510
}

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@
3939
"@oclif/test": "^3.0.1",
4040
"@types/ansi-styles": "^3.2.1",
4141
"@types/benchmark": "^2.1.2",
42-
"@types/chai-as-promised": "^7.1.5",
4342
"@types/chai": "^4.3.4",
43+
"@types/chai-as-promised": "^7.1.5",
4444
"@types/clean-stack": "^2.1.1",
4545
"@types/cli-progress": "^3.11.0",
4646
"@types/ejs": "^3.1.2",
4747
"@types/indent-string": "^4.0.1",
4848
"@types/js-yaml": "^3.12.7",
4949
"@types/mocha": "^10.0.2",
50-
"@types/node-notifier": "^8.0.2",
5150
"@types/node": "^18",
51+
"@types/node-notifier": "^8.0.2",
5252
"@types/slice-ansi": "^4.0.0",
5353
"@types/strip-ansi": "^5.2.1",
5454
"@types/supports-color": "^8.1.1",
@@ -63,6 +63,7 @@
6363
"eslint-config-oclif": "^5.0.0",
6464
"eslint-config-oclif-typescript": "^2.0.1",
6565
"eslint-config-prettier": "^9.0.0",
66+
"eslint-plugin-perfectionist": "^2.1.0",
6667
"fancy-test": "^3.0.1",
6768
"globby": "^11.1.0",
6869
"husky": "^8",

src/args.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import {URL} from 'node:url'
2+
3+
import {Command} from './command'
14
import {Arg, ArgDefinition} from './interfaces/parser'
25
import {dirExists, fileExists} from './util/fs'
3-
import {Command} from './command'
4-
import {URL} from 'node:url'
56
import {isNotFalsy} from './util/util'
67

78
/**
@@ -36,7 +37,7 @@ export const boolean = custom<boolean>({
3637
parse: async (b) => Boolean(b) && isNotFalsy(b),
3738
})
3839

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

0 commit comments

Comments
 (0)