Skip to content

Commit d204153

Browse files
committed
chore(deps): add eslint unicorn
1 parent 24415ee commit d204153

File tree

3 files changed

+191
-69
lines changed

3 files changed

+191
-69
lines changed

.eslintrc.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = defineConfig({
1919
'plugin:@typescript-eslint/recommended-type-checked',
2020
'plugin:prettier/recommended',
2121
'plugin:jsdoc/recommended-typescript-error',
22+
'plugin:unicorn/recommended',
2223
],
2324
parser: '@typescript-eslint/parser',
2425
parserOptions: {
@@ -37,6 +38,64 @@ module.exports = defineConfig({
3738

3839
'deprecation/deprecation': 'error',
3940

41+
'unicorn/no-array-reduce': 'off',
42+
'unicorn/no-nested-ternary': 'off',
43+
'unicorn/no-null': 'off',
44+
'unicorn/no-useless-switch-case': 'off',
45+
'unicorn/number-literal-case': 'off',
46+
// TODO @Shinigami92 2023-09-23: prefer-at should be turned on when we drop support for Node 14
47+
'unicorn/prefer-at': 'off',
48+
// TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14
49+
'unicorn/prefer-string-replace-all': 'off',
50+
51+
// TODO @Shinigami92 2023-09-23: All following unicorn rules are turned on by default through the unicorn/recommended set
52+
// they should be turned on individually, removed or potentially configured to our needs
53+
// But read https://github.com/faker-js/faker/pull/2417 for more
54+
'unicorn/better-regex': 'off',
55+
'unicorn/catch-error-name': 'off',
56+
'unicorn/consistent-destructuring': 'off',
57+
'unicorn/consistent-function-scoping': 'off',
58+
'unicorn/escape-case': 'off',
59+
'unicorn/explicit-length-check': 'off',
60+
'unicorn/filename-case': 'off',
61+
'unicorn/import-style': 'off',
62+
'unicorn/no-array-callback-reference': 'off',
63+
'unicorn/no-array-for-each': 'off',
64+
'unicorn/no-array-push-push': 'off',
65+
'unicorn/no-await-expression-member': 'off',
66+
'unicorn/no-console-spaces': 'off',
67+
'unicorn/no-for-loop': 'off',
68+
'unicorn/no-hex-escape': 'off',
69+
'unicorn/no-instanceof-array': 'off',
70+
'unicorn/no-negated-condition': 'off',
71+
'unicorn/no-new-array': 'off',
72+
'unicorn/no-object-as-default-parameter': 'off',
73+
'unicorn/no-process-exit': 'off',
74+
'unicorn/no-zero-fractions': 'off',
75+
'unicorn/numeric-separators-style': 'off',
76+
'unicorn/prefer-array-flat-map': 'off',
77+
'unicorn/prefer-array-some': 'off',
78+
'unicorn/prefer-code-point': 'off',
79+
'unicorn/prefer-date-now': 'off',
80+
'unicorn/prefer-export-from': 'off',
81+
'unicorn/prefer-includes': 'off',
82+
'unicorn/prefer-module': 'off',
83+
'unicorn/prefer-native-coercion-functions': 'off',
84+
'unicorn/prefer-negative-index': 'off',
85+
'unicorn/prefer-node-protocol': 'off',
86+
'unicorn/prefer-number-properties': 'off',
87+
'unicorn/prefer-object-from-entries': 'off',
88+
'unicorn/prefer-optional-catch-binding': 'off',
89+
'unicorn/prefer-spread': 'off',
90+
'unicorn/prefer-string-slice': 'off',
91+
'unicorn/prefer-string-starts-ends-with': 'off',
92+
'unicorn/prefer-ternary': 'off',
93+
'unicorn/prefer-top-level-await': 'off',
94+
'unicorn/prevent-abbreviations': 'off',
95+
'unicorn/require-array-join-separator': 'off',
96+
'unicorn/switch-case-braces': 'off',
97+
'unicorn/text-encoding-identifier-case': 'off',
98+
4099
'@typescript-eslint/array-type': [
41100
'error',
42101
{ default: 'array-simple', readonly: 'generic' },

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"eslint-plugin-deprecation": "~2.0.0",
110110
"eslint-plugin-jsdoc": "~46.8.1",
111111
"eslint-plugin-prettier": "~5.0.0",
112+
"eslint-plugin-unicorn": "~48.0.1",
112113
"eslint-plugin-vitest": "~0.3.1",
113114
"glob": "~10.3.4",
114115
"npm-run-all": "~4.1.5",

0 commit comments

Comments
 (0)