Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ea72ed8
Add config
jakebailey Aug 25, 2023
e72cade
[generated] eslint --fix
jakebailey Aug 25, 2023
c9ed25d
Manual fixes
jakebailey Aug 25, 2023
4089625
Date.now
jakebailey Aug 25, 2023
85b689b
No object reduce
jakebailey Aug 25, 2023
57b777e
Buffer.from
jakebailey Aug 25, 2023
a65798d
Set
jakebailey Aug 25, 2023
61f5fb1
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Sep 1, 2023
62206d9
Enable lint rule now that helper is gone
jakebailey Sep 1, 2023
d575268
Drop rule, I'm not gonna fix 240 of these by hand
jakebailey Sep 1, 2023
a6a82bf
Don't new Array + join for padding
jakebailey Sep 1, 2023
c8263be
Fix compile err
jakebailey Sep 5, 2023
db0344e
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Sep 6, 2023
a834ea6
Fix lint
jakebailey Sep 6, 2023
8f707b5
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Dec 11, 2023
18f411d
Bump and fix
jakebailey Dec 11, 2023
2145843
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Jan 20, 2024
fef5532
Fix lint
jakebailey Jan 20, 2024
b1d2b24
Bump
jakebailey Jan 20, 2024
1764b8e
Classify
jakebailey Jan 20, 2024
695ed0f
More triage
jakebailey Jan 20, 2024
74b6550
More triage
jakebailey Jan 20, 2024
4681bc0
More triage
jakebailey Jan 20, 2024
7771ddf
More triage
jakebailey Jan 20, 2024
844233b
More triage
jakebailey Jan 20, 2024
33366b2
More triage
jakebailey Jan 20, 2024
200ee8b
More triage
jakebailey Jan 20, 2024
3da23d0
More triage
jakebailey Jan 20, 2024
eb7ba9f
More triage
jakebailey Jan 20, 2024
c251a2b
number literal
jakebailey Jan 20, 2024
12ad192
More triage
jakebailey Jan 20, 2024
ee0f535
More triage
jakebailey Jan 20, 2024
a079fd6
More triage
jakebailey Jan 21, 2024
5fae6cc
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Mar 19, 2024
5ac2b65
disable
jakebailey Mar 19, 2024
10fafc0
new
jakebailey Mar 19, 2024
ce92c95
fmt
jakebailey Mar 19, 2024
2a4ac4e
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Apr 22, 2024
e0ae3ff
fix lints
jakebailey Apr 22, 2024
f2853a1
update now that it doesn't crash
jakebailey Apr 22, 2024
c1814d3
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Jun 27, 2024
e0e8eaa
Drop raw
jakebailey Jun 27, 2024
571bd74
Fix some
jakebailey Jun 28, 2024
5998579
structuredClone
jakebailey Jun 28, 2024
e35981f
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Aug 4, 2024
37c2dca
Remove cast
jakebailey Aug 4, 2024
10fc6fa
Fix more
jakebailey Aug 4, 2024
ceb0ebb
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Aug 13, 2024
9bcfd34
Fix lock
jakebailey Aug 13, 2024
507fffc
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Aug 14, 2024
da0907f
Merge branch 'main' into eslint-plugin-unicorn
jakebailey Apr 2, 2025
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
90 changes: 90 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
import eslint from "@eslint/js";
import * as regexpPlugin from "eslint-plugin-regexp";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import fs from "fs";
import globals from "globals";
import { createRequire } from "module";
Expand Down Expand Up @@ -38,6 +39,7 @@ export default tseslint.config(
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
regexpPlugin.configs["flat/recommended"],
eslintPluginUnicorn.configs["flat/recommended"],
{
plugins: {
local: {
Expand Down Expand Up @@ -156,6 +158,94 @@ export default tseslint.config(
"local/no-keywords": "error",
"local/jsdoc-format": "error",
"local/js-extensions": "error",

// eslint-plugin-unicorn
// good
"unicorn/prefer-includes": "error",
"unicorn/new-for-builtins": "error",
"unicorn/prefer-logical-operator-over-ternary": "error",
"unicorn/no-instanceof-array": "error",
"unicorn/prefer-optional-catch-binding": "error",
"unicorn/require-array-join-separator": "error",
"unicorn/throw-new-error": "error",
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-fallback-in-spread": "error",
"unicorn/prefer-modern-math-apis": "error",
"unicorn/prefer-array-find": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-date-now": "error",
"unicorn/prefer-object-from-entries": "error",
"unicorn/no-new-buffer": "error",
"unicorn/prefer-set-has": "error",
"unicorn/prefer-string-trim-start-end": "error",
"unicorn/no-zero-fractions": "error",
"unicorn/prefer-regexp-test": "error",
"unicorn/number-literal-case": "error",

// likely yes
"unicorn/error-message": "off", // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2265
"unicorn/prefer-math-min-max": "off",
"unicorn/prefer-global-this": "off",

// likely no
"unicorn/prefer-string-raw": "off",
"unicorn/consistent-existence-index-check": "off",

// no
"unicorn/filename-case": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/empty-brace-spaces": "off",
"unicorn/catch-error-name": "off",
"unicorn/prefer-module": "off",
"unicorn/switch-case-braces": "off",
"unicorn/numeric-separators-style": "off",
"unicorn/import-style": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/text-encoding-identifier-case": "off",
"unicorn/no-process-exit": "off",
"unicorn/prefer-export-from": "off",
"unicorn/prefer-ternary": "off",
"unicorn/template-indent": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-method-this-argument": "off", // false positives
"unicorn/no-nested-ternary": "off",
"unicorn/consistent-destructuring": "off", // false positives
"unicorn/no-hex-escape": "off",
"unicorn/no-object-as-default-parameter": "off",
"unicorn/escape-case": "off",
"unicorn/prefer-type-error": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/no-negated-condition": "off",
"unicorn/no-lonely-if": "off",
"unicorn/prefer-math-trunc": "off", // Treats `1 << 0` as invalid
"unicorn/no-array-for-each": "off", // false positives
"unicorn/no-for-loop": "off", // quick fix produces slower `.entries()`
"unicorn/prefer-at": "off", // perf
"unicorn/prefer-switch": "off", // quick fix produces non-idiomatic code for this repo
"unicorn/no-typeof-undefined": "off", // False positive when checking for a global without throwing
"unicorn/no-null": "off", // if we remove the other plugin
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-string-replace-all": "off", // not available in node 14
"unicorn/no-array-push-push": "off",
"unicorn/no-new-array": "off", // I like it, but we have a few canonical use cases
"unicorn/explicit-length-check": "off", // I like it, but it's a lot of changes
"unicorn/prefer-node-protocol": "off", // I like it, but it's pure style
"unicorn/prefer-code-point": "off", // I suspect this is correct, but it's a lot of changes in fiddly bits of the code
"unicorn/no-array-reduce": "off",
"unicorn/no-useless-switch-case": "off",
"unicorn/prefer-native-coercion-functions": "off",
"unicorn/prefer-spread": "off",
"unicorn/prefer-event-target": "off",
"unicorn/better-regex": "off", // doesn't always produce a good alternative
"unicorn/prefer-string-slice": "off", // Probably good, but most are not fixed
"unicorn/prefer-reflect-apply": "off", // tbh don't understand the difference
"unicorn/prefer-top-level-await": "off",
"unicorn/prefer-negative-index": "off",
"unicorn/no-unreadable-array-destructuring": "off",
"unicorn/no-negation-in-equality-check": "off", // inaccurate
"unicorn/prefer-structured-clone": "off", // Unavailable until Node 17
"unicorn/consistent-assert": "off", // Noisy style
"local/no-array-mutating-method-expressions": "error",
},
},
Expand Down
Loading