@sapphire-sh/utils 1.50.0 → 1.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/eslint.d.ts.map +1 -1
- package/lib/eslint.js +31 -30
- package/lib/eslint.js.map +1 -1
- package/lib/esm/eslint.d.ts.map +1 -1
- package/lib/esm/eslint.js +31 -30
- package/lib/esm/eslint.js.map +1 -1
- package/lib/esm/prettier.d.ts.map +1 -1
- package/lib/esm/prettier.js +0 -1
- package/lib/esm/prettier.js.map +1 -1
- package/lib/prettier.d.ts.map +1 -1
- package/lib/prettier.js +0 -1
- package/lib/prettier.js.map +1 -1
- package/package.json +1 -3
package/lib/eslint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":";AAMA,
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":";AAMA,wBAoIE"}
|
package/lib/eslint.js
CHANGED
|
@@ -11,25 +11,17 @@ const typescript_eslint_1 = __importDefault(require("typescript-eslint"));
|
|
|
11
11
|
exports.default = (0, config_1.defineConfig)(js_1.default.configs.recommended, ...typescript_eslint_1.default.configs.recommended, eslint_config_prettier_1.default, eslint_plugin_promise_1.default.configs['flat/recommended'], {
|
|
12
12
|
rules: {
|
|
13
13
|
// General
|
|
14
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
15
|
+
curly: 'error',
|
|
16
|
+
eqeqeq: ['error', 'always'],
|
|
17
|
+
'func-style': ['error', 'expression'],
|
|
14
18
|
'no-console': 'off',
|
|
19
|
+
'sort-imports': 'error',
|
|
15
20
|
'no-constant-condition': ['error', { checkLoops: false }],
|
|
16
|
-
'no-var': 'error',
|
|
17
|
-
'no-throw-literal': 'error',
|
|
18
|
-
'no-param-reassign': 'error',
|
|
19
|
-
'no-nested-ternary': 'error',
|
|
20
|
-
'no-unneeded-ternary': 'error',
|
|
21
|
-
'prefer-const': 'error',
|
|
22
|
-
'prefer-template': 'error',
|
|
23
|
-
'prefer-destructuring': 'error',
|
|
24
|
-
'prefer-arrow-callback': 'error',
|
|
25
|
-
eqeqeq: ['error', 'always'],
|
|
26
|
-
'object-shorthand': 'error',
|
|
27
|
-
'no-negated-condition': 'error',
|
|
28
21
|
'no-else-return': 'error',
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
|
|
32
|
-
curly: 'error',
|
|
22
|
+
'no-negated-condition': 'error',
|
|
23
|
+
'no-nested-ternary': 'error',
|
|
24
|
+
'no-param-reassign': 'error',
|
|
33
25
|
'no-restricted-globals': [
|
|
34
26
|
'error',
|
|
35
27
|
{ name: 'parseInt', message: 'Use Number.parseInt instead.' },
|
|
@@ -72,8 +64,20 @@ exports.default = (0, config_1.defineConfig)(js_1.default.configs.recommended, .
|
|
|
72
64
|
{ name: 'worker_threads', message: 'Use `node:worker_threads` instead.' },
|
|
73
65
|
{ name: 'zlib', message: 'Use `node:zlib` instead.' },
|
|
74
66
|
],
|
|
67
|
+
'no-throw-literal': 'error',
|
|
68
|
+
'no-unneeded-ternary': 'error',
|
|
69
|
+
'no-var': 'error',
|
|
70
|
+
'object-shorthand': 'error',
|
|
71
|
+
'prefer-arrow-callback': 'error',
|
|
72
|
+
'prefer-const': 'error',
|
|
73
|
+
'prefer-destructuring': 'error',
|
|
74
|
+
'prefer-template': 'error',
|
|
75
|
+
yoda: 'error',
|
|
75
76
|
// TypeScript
|
|
76
|
-
'@typescript-eslint/
|
|
77
|
+
'@typescript-eslint/array-type': ['error', { default: 'array' }],
|
|
78
|
+
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
|
|
79
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
80
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
77
81
|
'@typescript-eslint/naming-convention': [
|
|
78
82
|
'error',
|
|
79
83
|
{
|
|
@@ -82,26 +86,18 @@ exports.default = (0, config_1.defineConfig)(js_1.default.configs.recommended, .
|
|
|
82
86
|
custom: { regex: '^I[A-Z]', match: false },
|
|
83
87
|
},
|
|
84
88
|
],
|
|
85
|
-
'@typescript-eslint/no-namespace': 'off',
|
|
86
|
-
'@typescript-eslint/no-shadow': 'off',
|
|
87
|
-
'@typescript-eslint/consistent-type-imports': 'error',
|
|
88
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
89
89
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
90
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
90
91
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
92
|
+
'@typescript-eslint/no-shadow': 'off',
|
|
91
93
|
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
92
|
-
'@typescript-eslint/
|
|
93
|
-
'@typescript-eslint/array-type': ['error', { default: 'array' }],
|
|
94
|
+
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
|
|
94
95
|
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
95
96
|
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
96
97
|
},
|
|
97
98
|
}, {
|
|
98
99
|
// Type-aware rules (requires parserOptions.project in consumer config)
|
|
99
100
|
rules: {
|
|
100
|
-
'@typescript-eslint/no-floating-promises': 'error',
|
|
101
|
-
'@typescript-eslint/no-misused-promises': 'error',
|
|
102
|
-
'@typescript-eslint/promise-function-async': 'error',
|
|
103
|
-
'promise/prefer-await-to-then': 'error',
|
|
104
|
-
'promise/prefer-await-to-callbacks': 'error',
|
|
105
101
|
'no-restricted-syntax': [
|
|
106
102
|
'error',
|
|
107
103
|
{
|
|
@@ -117,11 +113,16 @@ exports.default = (0, config_1.defineConfig)(js_1.default.configs.recommended, .
|
|
|
117
113
|
message: 'Switch case bodies must be wrapped in a block statement (braces).',
|
|
118
114
|
},
|
|
119
115
|
],
|
|
116
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
117
|
+
'@typescript-eslint/no-misused-promises': 'error',
|
|
120
118
|
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
121
|
-
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
122
|
-
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
123
119
|
'@typescript-eslint/prefer-readonly': 'error',
|
|
120
|
+
'@typescript-eslint/promise-function-async': 'error',
|
|
121
|
+
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
124
122
|
'@typescript-eslint/strict-boolean-expressions': 'error',
|
|
123
|
+
'@typescript-eslint/switch-exhaustiveness-check': ['error', { allowDefaultCaseForExhaustiveSwitch: true }],
|
|
124
|
+
'promise/prefer-await-to-callbacks': 'error',
|
|
125
|
+
'promise/prefer-await-to-then': 'error',
|
|
125
126
|
},
|
|
126
127
|
languageOptions: {
|
|
127
128
|
parserOptions: {
|
package/lib/eslint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":";;;;;AAAA,oDAAgC;AAChC,oFAA8C;AAC9C,kFAA4C;AAC5C,0CAA6C;AAC7C,0EAAyC;AAEzC,kBAAe,IAAA,qBAAY,EAC1B,YAAM,CAAC,OAAO,CAAC,WAAW,EAC1B,GAAG,2BAAQ,CAAC,OAAO,CAAC,WAAW,EAC/B,gCAAQ,EACR,+BAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,EACnC;IACC,KAAK,EAAE;QACN,UAAU;QACV,
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":";;;;;AAAA,oDAAgC;AAChC,oFAA8C;AAC9C,kFAA4C;AAC5C,0CAA6C;AAC7C,0EAAyC;AAEzC,kBAAe,IAAA,qBAAY,EAC1B,YAAM,CAAC,OAAO,CAAC,WAAW,EAC1B,GAAG,2BAA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OAAO,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;QACpG,8CAA8C,EAAE,OAAO;QACvD,0CAA0C,EAAE,OAAO;KACnD;CACD,EACD;IACC,uEAAuE;IACvE,KAAK,EAAE;QACN,sBAAsB,EAAE;YACvB,OAAO;YACP;gBACC,QAAQ,EAAE,6CAA6C;gBACvD,OAAO,EAAE,oCAAoC;aAC7C;YACD;gBACC,QAAQ,EAAE,8CAA8C;gBACxD,OAAO,EAAE,oDAAoD;aAC7D;YACD;gBACC,QAAQ,EAAE,mDAAmD;gBAC7D,OAAO,EAAE,mEAAmE;aAC5E;SACD;QACD,yCAAyC,EAAE,OAAO;QAClD,wCAAwC,EAAE,OAAO;QACjD,6CAA6C,EAAE,OAAO;QACtD,oCAAoC,EAAE,OAAO;QAC7C,2CAA2C,EAAE,OAAO;QACpD,iCAAiC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC;QAC5D,+CAA+C,EAAE,OAAO;QACxD,gDAAgD,EAAE,CAAC,OAAO,EAAE,EAAE,mCAAmC,EAAE,IAAI,EAAE,CAAC;QAC1G,mCAAmC,EAAE,OAAO;QAC5C,8BAA8B,EAAE,OAAO;KACvC;IACD,eAAe,EAAE;QAChB,aAAa,EAAE;YACd,OAAO,EAAE,IAAI;SACb;KACD;CACD,EACD;IACC,OAAO,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,CAAC;CAC5D,CACD,CAAC"}
|
package/lib/esm/eslint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../src/eslint.ts"],"names":[],"mappings":";AAMA,
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../src/eslint.ts"],"names":[],"mappings":";AAMA,wBAoIE"}
|
package/lib/esm/eslint.js
CHANGED
|
@@ -6,25 +6,17 @@ import tseslint from 'typescript-eslint';
|
|
|
6
6
|
export default defineConfig(eslint.configs.recommended, ...tseslint.configs.recommended, prettier, promise.configs['flat/recommended'], {
|
|
7
7
|
rules: {
|
|
8
8
|
// General
|
|
9
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
10
|
+
curly: 'error',
|
|
11
|
+
eqeqeq: ['error', 'always'],
|
|
12
|
+
'func-style': ['error', 'expression'],
|
|
9
13
|
'no-console': 'off',
|
|
14
|
+
'sort-imports': 'error',
|
|
10
15
|
'no-constant-condition': ['error', { checkLoops: false }],
|
|
11
|
-
'no-var': 'error',
|
|
12
|
-
'no-throw-literal': 'error',
|
|
13
|
-
'no-param-reassign': 'error',
|
|
14
|
-
'no-nested-ternary': 'error',
|
|
15
|
-
'no-unneeded-ternary': 'error',
|
|
16
|
-
'prefer-const': 'error',
|
|
17
|
-
'prefer-template': 'error',
|
|
18
|
-
'prefer-destructuring': 'error',
|
|
19
|
-
'prefer-arrow-callback': 'error',
|
|
20
|
-
eqeqeq: ['error', 'always'],
|
|
21
|
-
'object-shorthand': 'error',
|
|
22
|
-
'no-negated-condition': 'error',
|
|
23
16
|
'no-else-return': 'error',
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
curly: 'error',
|
|
17
|
+
'no-negated-condition': 'error',
|
|
18
|
+
'no-nested-ternary': 'error',
|
|
19
|
+
'no-param-reassign': 'error',
|
|
28
20
|
'no-restricted-globals': [
|
|
29
21
|
'error',
|
|
30
22
|
{ name: 'parseInt', message: 'Use Number.parseInt instead.' },
|
|
@@ -67,8 +59,20 @@ export default defineConfig(eslint.configs.recommended, ...tseslint.configs.reco
|
|
|
67
59
|
{ name: 'worker_threads', message: 'Use `node:worker_threads` instead.' },
|
|
68
60
|
{ name: 'zlib', message: 'Use `node:zlib` instead.' },
|
|
69
61
|
],
|
|
62
|
+
'no-throw-literal': 'error',
|
|
63
|
+
'no-unneeded-ternary': 'error',
|
|
64
|
+
'no-var': 'error',
|
|
65
|
+
'object-shorthand': 'error',
|
|
66
|
+
'prefer-arrow-callback': 'error',
|
|
67
|
+
'prefer-const': 'error',
|
|
68
|
+
'prefer-destructuring': 'error',
|
|
69
|
+
'prefer-template': 'error',
|
|
70
|
+
yoda: 'error',
|
|
70
71
|
// TypeScript
|
|
71
|
-
'@typescript-eslint/
|
|
72
|
+
'@typescript-eslint/array-type': ['error', { default: 'array' }],
|
|
73
|
+
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
|
|
74
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
75
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
72
76
|
'@typescript-eslint/naming-convention': [
|
|
73
77
|
'error',
|
|
74
78
|
{
|
|
@@ -77,26 +81,18 @@ export default defineConfig(eslint.configs.recommended, ...tseslint.configs.reco
|
|
|
77
81
|
custom: { regex: '^I[A-Z]', match: false },
|
|
78
82
|
},
|
|
79
83
|
],
|
|
80
|
-
'@typescript-eslint/no-namespace': 'off',
|
|
81
|
-
'@typescript-eslint/no-shadow': 'off',
|
|
82
|
-
'@typescript-eslint/consistent-type-imports': 'error',
|
|
83
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
84
84
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
85
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
85
86
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
87
|
+
'@typescript-eslint/no-shadow': 'off',
|
|
86
88
|
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
87
|
-
'@typescript-eslint/
|
|
88
|
-
'@typescript-eslint/array-type': ['error', { default: 'array' }],
|
|
89
|
+
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
|
|
89
90
|
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
90
91
|
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
91
92
|
},
|
|
92
93
|
}, {
|
|
93
94
|
// Type-aware rules (requires parserOptions.project in consumer config)
|
|
94
95
|
rules: {
|
|
95
|
-
'@typescript-eslint/no-floating-promises': 'error',
|
|
96
|
-
'@typescript-eslint/no-misused-promises': 'error',
|
|
97
|
-
'@typescript-eslint/promise-function-async': 'error',
|
|
98
|
-
'promise/prefer-await-to-then': 'error',
|
|
99
|
-
'promise/prefer-await-to-callbacks': 'error',
|
|
100
96
|
'no-restricted-syntax': [
|
|
101
97
|
'error',
|
|
102
98
|
{
|
|
@@ -112,11 +108,16 @@ export default defineConfig(eslint.configs.recommended, ...tseslint.configs.reco
|
|
|
112
108
|
message: 'Switch case bodies must be wrapped in a block statement (braces).',
|
|
113
109
|
},
|
|
114
110
|
],
|
|
111
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
112
|
+
'@typescript-eslint/no-misused-promises': 'error',
|
|
115
113
|
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
116
|
-
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
117
|
-
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
118
114
|
'@typescript-eslint/prefer-readonly': 'error',
|
|
115
|
+
'@typescript-eslint/promise-function-async': 'error',
|
|
116
|
+
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
119
117
|
'@typescript-eslint/strict-boolean-expressions': 'error',
|
|
118
|
+
'@typescript-eslint/switch-exhaustiveness-check': ['error', { allowDefaultCaseForExhaustiveSwitch: true }],
|
|
119
|
+
'promise/prefer-await-to-callbacks': 'error',
|
|
120
|
+
'promise/prefer-await-to-then': 'error',
|
|
120
121
|
},
|
|
121
122
|
languageOptions: {
|
|
122
123
|
parserOptions: {
|
package/lib/esm/eslint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../src/eslint.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAChC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9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AAiC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC;QAC5D,+CAA+C,EAAE,OAAO;QACxD,gDAAgD,EAAE,CAAC,OAAO,EAAE,EAAE,mCAAmC,EAAE,IAAI,EAAE,CAAC;QAC1G,mCAAmC,EAAE,OAAO;QAC5C,8BAA8B,EAAE,OAAO;KACvC;IACD,eAAe,EAAE;QAChB,aAAa,EAAE;YACd,OAAO,EAAE,IAAI;SACb;KACD;CACD,EACD;IACC,OAAO,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,CAAC;CAC5D,CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,QAAA,MAAM,MAAM,EAAE,MASb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/lib/esm/prettier.js
CHANGED
package/lib/esm/prettier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAW;IACtB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAW;IACtB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,IAAI;CACf,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/lib/prettier.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,QAAA,MAAM,MAAM,EAAE,MASb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/lib/prettier.js
CHANGED
package/lib/prettier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAW;IACtB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAW;IACtB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,IAAI;CACf,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire-sh/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.51.0",
|
|
4
4
|
"description": "@sapphire-sh/utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"eslint": ">=9.0.0",
|
|
56
56
|
"eslint-config-prettier": ">=9.0.0",
|
|
57
57
|
"prettier": ">=3.0.0",
|
|
58
|
-
"prettier-plugin-organize-imports": ">=4.0.0",
|
|
59
58
|
"eslint-plugin-promise": ">=7.0.0",
|
|
60
59
|
"typescript-eslint": ">=8.0.0"
|
|
61
60
|
},
|
|
@@ -83,7 +82,6 @@
|
|
|
83
82
|
"eslint-config-prettier": "^10.1.2",
|
|
84
83
|
"eslint-plugin-promise": "^7.2.1",
|
|
85
84
|
"prettier": "^3.8.1",
|
|
86
|
-
"prettier-plugin-organize-imports": "^4.3.0",
|
|
87
85
|
"typescript": "^5.9.3",
|
|
88
86
|
"typescript-eslint": "^8.29.1",
|
|
89
87
|
"vitest": "^4.1.1"
|