Skip to content

Commit

Permalink
chore(deps): add eslint unicorn
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Sep 23, 2023
1 parent 24415ee commit d204153
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 69 deletions.
59 changes: 59 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = defineConfig({
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:prettier/recommended',
'plugin:jsdoc/recommended-typescript-error',
'plugin:unicorn/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand All @@ -37,6 +38,64 @@ module.exports = defineConfig({

'deprecation/deprecation': 'error',

'unicorn/no-array-reduce': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/no-null': 'off',
'unicorn/no-useless-switch-case': 'off',
'unicorn/number-literal-case': 'off',
// TODO @Shinigami92 2023-09-23: prefer-at should be turned on when we drop support for Node 14
'unicorn/prefer-at': 'off',
// TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14
'unicorn/prefer-string-replace-all': 'off',

// TODO @Shinigami92 2023-09-23: All following unicorn rules are turned on by default through the unicorn/recommended set
// they should be turned on individually, removed or potentially configured to our needs
// But read https://github.com/faker-js/faker/pull/2417 for more
'unicorn/better-regex': 'off',
'unicorn/catch-error-name': 'off',
'unicorn/consistent-destructuring': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/escape-case': 'off',
'unicorn/explicit-length-check': 'off',
'unicorn/filename-case': 'off',
'unicorn/import-style': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-push-push': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-console-spaces': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-hex-escape': 'off',
'unicorn/no-instanceof-array': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-new-array': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/no-zero-fractions': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-array-flat-map': 'off',
'unicorn/prefer-array-some': 'off',
'unicorn/prefer-code-point': 'off',
'unicorn/prefer-date-now': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-includes': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-native-coercion-functions': 'off',
'unicorn/prefer-negative-index': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prefer-object-from-entries': 'off',
'unicorn/prefer-optional-catch-binding': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/prefer-string-slice': 'off',
'unicorn/prefer-string-starts-ends-with': 'off',
'unicorn/prefer-ternary': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/require-array-join-separator': 'off',
'unicorn/switch-case-braces': 'off',
'unicorn/text-encoding-identifier-case': 'off',

'@typescript-eslint/array-type': [
'error',
{ default: 'array-simple', readonly: 'generic' },
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"eslint-plugin-deprecation": "~2.0.0",
"eslint-plugin-jsdoc": "~46.8.1",
"eslint-plugin-prettier": "~5.0.0",
"eslint-plugin-unicorn": "~48.0.1",
"eslint-plugin-vitest": "~0.3.1",
"glob": "~10.3.4",
"npm-run-all": "~4.1.5",
Expand Down
Loading

0 comments on commit d204153

Please sign in to comment.