Skip to content

Commit b81b9ce

Browse files
committed
Add a couple of new eslint-plugin-unicorn rules
The recent `eslint-plugin-unicorn` update added, and replaced, a few rules that seem useful for us; please refer to https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v59.0.0 Note that none of the following rules required any code-changes: - Replace `no-array-push-push` with `prefer-single-call`, see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-call.md - Add `no-unnecessary-slice-end`, see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-slice-end.md - Add `no-unnecessary-array-flat-depth`, see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-flat-depth.md - Add `no-unnecessary-array-splice-count`, see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-splice-count.md
1 parent b05351c commit b81b9ce

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

eslint.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,16 @@ export default [
126126
"perfectionist/sort-exports": "error",
127127
"perfectionist/sort-named-exports": "error",
128128
"unicorn/no-abusive-eslint-disable": "error",
129-
"unicorn/no-array-push-push": "error",
130129
"unicorn/no-array-reduce": ["error", { allowSimpleOperations: true }],
131130
"unicorn/no-console-spaces": "error",
132131
"unicorn/no-instanceof-builtins": "error",
133132
"unicorn/no-invalid-remove-event-listener": "error",
134133
"unicorn/no-new-buffer": "error",
135134
"unicorn/no-single-promise-in-promise-methods": "error",
136135
"unicorn/no-typeof-undefined": ["error", { checkGlobalVariables: false }],
136+
"unicorn/no-unnecessary-array-flat-depth": "error",
137+
"unicorn/no-unnecessary-array-splice-count": "error",
138+
"unicorn/no-unnecessary-slice-end": "error",
137139
"unicorn/no-useless-promise-resolve-reject": "error",
138140
"unicorn/no-useless-spread": "error",
139141
"unicorn/prefer-array-find": "error",
@@ -153,6 +155,7 @@ export default [
153155
"unicorn/prefer-negative-index": "error",
154156
"unicorn/prefer-optional-catch-binding": "error",
155157
"unicorn/prefer-regexp-test": "error",
158+
"unicorn/prefer-single-call": "error",
156159
"unicorn/prefer-string-replace-all": "error",
157160
"unicorn/prefer-string-starts-ends-with": "error",
158161
"unicorn/prefer-ternary": ["error", "only-single-line"],

0 commit comments

Comments
 (0)