-
-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check eslint-plugin-unicorn rules to enable/configure/disable #2439
Comments
Created PR #2419 for |
Created PR #2421 for Note: The rule is contested. |
Created PR #2440 for |
Created PR #2441 for |
@faker-js/members, @faker-js/maintainers I'm unsure about the consistent function scoping one. It basically wants us to move most inline functions to be standalone methods. e.g. convert from dish(): string {
const toTitleCase = (s: string) =>
s
.split(' ')
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
.join(' ');
return toTitleCase(
this.faker.helpers.arrayElement(this.faker.definitions.food.dish)
);
} to const toTitleCase = (s: string) =>
s
.split(' ')
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
.join(' ');
[...]
dish(): string {
return toTitleCase(
this.faker.helpers.arrayElement(this.faker.definitions.food.dish)
);
} |
Also, what are your thoughts regarding ? |
This makes sense, because instead of every single function call, only once the function will be created and than reused for multiple calls of the outer function. |
IMO |
I'm with you on this one. See my comment in #3315. While you could argue about some of the suggestions could be valid, I'd much rather see time spend on actual features or bug fixes for our users than having to fight in discussions about variable name nitpicking. |
Finally 🥳 I created the last PR for this issue: #3320 for |
Followup on #2418
Currently all the following rules are disabled because they cause issues in the code:
Undecided
unicorn/prevent-abbreviations
Last updated: 2023-10-07
Rejected
unicorn/import-style
unicorn/no-nested-ternary
unicorn/no-null
unicorn/no-object-as-default-parameter
unicorn/no-zero-fractions
unicorn/numeric-separators-style
unicorn/number-literal-case
unicorn/prefer-string-slice
#2814unicorn/prefer-ternary
Accepted
unicorn/catch-error-name
unicorn/consistent-destructuring
unicorn/consistent-function-scoping
unicorn/escape-case
unicorn/explicit-length-check
unicorn/filename-case
unicorn/no-array-callback-reference
unicorn/no-array-for-each
unicorn/no-array-reduce
unicorn/no-array-push-push
unicorn/no-await-expression-member
unicorn/no-console-spaces
unicorn/no-for-loop
unicorn/no-hex-escape
unicorn/no-instanceof-array
unicorn/no-negated-condition
unicorn/no-new-array
unicorn/no-process-exit
unicorn/no-useless-switch-case
unicorn/prefer-array-flat-map
unicorn/prefer-array-some
unicorn/prefer-at
unicorn/prefer-code-point
unicorn/prefer-date-now
unicorn/prefer-export-from
unicorn/prefer-includes
unicorn/prefer-module
unicorn/prefer-native-coercion-functions
unicorn/prefer-negative-index
unicorn/prefer-node-protocol
unicorn/prefer-number-properties
unicorn/prefer-object-from-entries
unicorn/prefer-optional-catch-binding
unicorn/prefer-string-replace-all
unicorn/prefer-spread
unicorn/prefer-string-starts-ends-with
unicorn/prefer-top-level-await
unicorn/require-array-join-separator
unicorn/switch-case-braces
unicorn/text-encoding-identifier-case
Please leave a comment if you wish to tackle any of these.
Legend:
#1234
: Reference to the related PR.The above list can be updated using the following command:
The text was updated successfully, but these errors were encountered: