aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinigami <[email protected]>2023-10-06 23:14:01 +0200
committerGitHub <[email protected]>2023-10-06 23:14:01 +0200
commit1ee46a7c19056a43c27993790b1ff54e2e9bba21 (patch)
treee4f599f1a45f3369fbec91125c0eb6a4753f01f7
parentc0386ac7d7197d059086dff7593cc62d2bff4b50 (diff)
downloadfaker-1ee46a7c19056a43c27993790b1ff54e2e9bba21.tar.xz
faker-1ee46a7c19056a43c27993790b1ff54e2e9bba21.zip
infra(deps): add eslint unicorn (#2418)
Co-authored-by: ST-DDT <[email protected]>
-rw-r--r--.eslintrc.js59
-rw-r--r--package.json1
-rw-r--r--pnpm-lock.yaml62
3 files changed, 122 insertions, 0 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index 99af9334..583e3c8d 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -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: {
@@ -37,6 +38,64 @@ module.exports = defineConfig({
'deprecation/deprecation': 'error',
+ 'unicorn/no-nested-ternary': 'off', // incompatible with prettier
+ 'unicorn/no-null': 'off', // incompatible with TypeScript
+ 'unicorn/number-literal-case': 'off', // incompatible with prettier
+
+ // 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: The following rules currently conflict with our code.
+ // Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
+ '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-array-reduce': '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-useless-switch-case': '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' },
diff --git a/package.json b/package.json
index 9a740e26..30c6ae27 100644
--- a/package.json
+++ b/package.json
@@ -109,6 +109,7 @@
"eslint-plugin-deprecation": "~2.0.0",
"eslint-plugin-jsdoc": "~46.8.2",
"eslint-plugin-prettier": "~5.0.0",
+ "eslint-plugin-unicorn": "~48.0.1",
"eslint-plugin-vitest": "~0.3.1",
"glob": "~10.3.10",
"npm-run-all": "~4.1.5",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 66ae7711..608d4764 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -67,6 +67,9 @@ devDependencies:
eslint-plugin-prettier:
specifier: ~5.0.0
+ eslint-plugin-unicorn:
+ specifier: ~48.0.1
+ version: 48.0.1([email protected])
eslint-plugin-vitest:
specifier: ~0.3.1
version: 0.3.1(@typescript-eslint/[email protected])([email protected])([email protected])
@@ -2078,6 +2081,13 @@ packages:
engines: {node: '>=8'}
dev: true
+ resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==}
+ engines: {node: '>=4'}
+ dependencies:
+ escape-string-regexp: 1.0.5
+ dev: true
+
resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
engines: {node: '>=6'}
@@ -3036,6 +3046,30 @@ packages:
synckit: 0.8.5
dev: true
+ resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==}
+ engines: {node: '>=16'}
+ peerDependencies:
+ eslint: '>=8.44.0'
+ dependencies:
+ '@babel/helper-validator-identifier': 7.22.20
+ '@eslint-community/eslint-utils': 4.4.0([email protected])
+ ci-info: 3.8.0
+ clean-regexp: 1.0.0
+ eslint: 8.50.0
+ esquery: 1.5.0
+ indent-string: 4.0.0
+ is-builtin-module: 3.2.1
+ jsesc: 3.0.2
+ lodash: 4.17.21
+ pluralize: 8.0.0
+ read-pkg-up: 7.0.1
+ regexp-tree: 0.1.27
+ regjsparser: 0.10.0
+ semver: 7.5.4
+ strip-indent: 3.0.0
+ dev: true
+
resolution: {integrity: sha512-GeR3zISHmqUGWK2sfW+eyCZivMqiQYzPf9UttHXBiEyMveS/jkKLHCrHUllwr3Hz1+i0zoseANd2xL0cFha8Eg==}
engines: {node: 14.x || >= 16}
@@ -4096,6 +4130,17 @@ packages:
engines: {node: '>=12.0.0'}
dev: true
+ resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
+ engines: {node: '>=6'}
+ hasBin: true
+ dev: true
+
resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
dev: true
@@ -4866,6 +4911,11 @@ packages:
pathe: 1.1.1
dev: true
+ resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
+ engines: {node: '>=4'}
+ dev: true
+
resolution: {integrity: sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==}
engines: {node: ^10 || ^12 || >=14}
@@ -5070,6 +5120,11 @@ packages:
strip-indent: 3.0.0
dev: true
+ resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==}
+ hasBin: true
+ dev: true
+
resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==}
engines: {node: '>= 0.4'}
@@ -5079,6 +5134,13 @@ packages:
set-function-name: 2.0.1
dev: true
+ resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==}
+ hasBin: true
+ dependencies:
+ jsesc: 0.5.0
+ dev: true
+
resolution: {integrity: sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==}
dependencies: