From 31d6d84b9fb8472aaa86171e93337d6fe3599499 Mon Sep 17 00:00:00 2001 From: Juraj Uhlar Date: Wed, 20 Mar 2024 10:51:53 -0300 Subject: [PATCH] chore: use shared eslint and prettier configurations --- .eslintrc.js | 20 +----- .prettierrc | 12 +--- package.json | 11 ++- pnpm-lock.yaml | 192 +++++++++++++++++++++++++++---------------------- 4 files changed, 115 insertions(+), 120 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 20da382..81f41f1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,21 +1,3 @@ module.exports = { - env: { - browser: true, - es6: true, - node: true, - }, - extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:prettier/recommended'], - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module', - }, - plugins: ['@typescript-eslint', 'prettier'], - rules: { - 'linebreak-style': ['error', 'unix'], - 'prefer-const': 'error', - 'prettier/prettier': 'error', - '@typescript-eslint/no-unused-vars': ['error'], - curly: [2, 'all'], - }, + extends: ['eslint:recommended', '@fingerprintjs/eslint-config-dx-team', 'plugin:prettier/recommended'], } diff --git a/.prettierrc b/.prettierrc index 7a48a62..882c56e 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,11 +1 @@ -{ - "printWidth": 120, - "tabWidth": 2, - "useTabs": false, - "semi": false, - "singleQuote": true, - "trailingComma": "es5", - "bracketSpacing": true, - "bracketSameLine": false, - "arrowParens": "always" -} +"@fingerprintjs/prettier-config-dx-team" diff --git a/package.json b/package.json index 164fd79..8327006 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,8 @@ "watch": "rimraf dist && rollup -c rollup.config.js -w", "lint": "eslint --ext .js,.ts --ignore-path .gitignore --max-warnings 0 .", "lint:fix": "pnpm lint --fix", + "prettier": "prettier src --check", + "prettier:fix": "yarn prettier --write", "test": "jest", "test:coverage": "jest --coverage", "test:dts": "tsc --noEmit --isolatedModules dist/fp-pro-spa.d.ts", @@ -56,23 +58,20 @@ "devDependencies": { "@commitlint/cli": "^19.2.1", "@commitlint/config-conventional": "^19.1.0", + "@fingerprintjs/eslint-config-dx-team": "^0.1.0", + "@fingerprintjs/prettier-config-dx-team": "^0.1.0", + "@fingerprintjs/tsconfig-dx-team": "^0.0.2", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-typescript": "^11.1.6", "@types/jest": "^29.5.12", "@types/node": "^20.11.30", - "@typescript-eslint/eslint-plugin": "^7.3.1", - "@typescript-eslint/parser": "^7.3.1", "commitizen": "^4.3.0", "conventional-changelog-conventionalcommits": "^7.0.2", "cz-conventional-changelog": "^3.3.0", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.1.3", "husky": "^9.0.11", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "lint-staged": "^15.2.2", - "prettier": "^3.2.5", "rimraf": "^5.0.5", "rollup": "^4.13.0", "rollup-plugin-dts": "^6.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77b533e..5daf02e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,15 @@ importers: '@commitlint/config-conventional': specifier: ^19.1.0 version: 19.1.0 + '@fingerprintjs/eslint-config-dx-team': + specifier: ^0.1.0 + version: 0.1.0(prettier@3.2.5)(typescript@5.4.2) + '@fingerprintjs/prettier-config-dx-team': + specifier: ^0.1.0 + version: 0.1.0 + '@fingerprintjs/tsconfig-dx-team': + specifier: ^0.0.2 + version: 0.0.2 '@rollup/plugin-json': specifier: ^6.1.0 version: 6.1.0(rollup@4.13.0) @@ -33,12 +42,6 @@ importers: '@types/node': specifier: ^20.11.30 version: 20.11.30 - '@typescript-eslint/eslint-plugin': - specifier: ^7.3.1 - version: 7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/parser': - specifier: ^7.3.1 - version: 7.3.1(eslint@8.57.0)(typescript@5.4.2) commitizen: specifier: ^4.3.0 version: 4.3.0(@types/node@20.11.30)(typescript@5.4.2) @@ -48,15 +51,6 @@ importers: cz-conventional-changelog: specifier: ^3.3.0 version: 3.3.0(@types/node@20.11.30)(typescript@5.4.2) - eslint: - specifier: ^8.57.0 - version: 8.57.0 - eslint-config-prettier: - specifier: ^9.1.0 - version: 9.1.0(eslint@8.57.0) - eslint-plugin-prettier: - specifier: ^5.1.3 - version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) husky: specifier: ^9.0.11 version: 9.0.11 @@ -69,9 +63,6 @@ importers: lint-staged: specifier: ^15.2.2 version: 15.2.2 - prettier: - specifier: ^3.2.5 - version: 3.2.5 rimraf: specifier: ^5.0.5 version: 5.0.5 @@ -648,13 +639,13 @@ packages: engines: {node: '>=10.0.0'} dev: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.57.0 + eslint: 8.56.0 eslint-visitor-keys: 3.4.3 dev: true @@ -680,17 +671,44 @@ packages: - supports-color dev: true - /@eslint/js@8.57.0: - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + /@eslint/js@8.56.0: + resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@fingerprintjs/eslint-config-dx-team@0.1.0(prettier@3.2.5)(typescript@5.4.2): + resolution: {integrity: sha512-Yet9e0dDGmAhMsXnnRWbvTAWLlA2qWGvsOBnRscZtlJnv/Xm4xzurR4C4bqPBcX3rVZkedv9dBTLW3t/wRY0mA==} + peerDependencies: + prettier: '>=3' + dependencies: + '@typescript-eslint/eslint-plugin': 6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.4.2) + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.4.2) + eslint: 8.56.0 + eslint-config-prettier: 9.1.0(eslint@8.56.0) + eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.5) + prettier: 3.2.5 + transitivePeerDependencies: + - '@types/eslint' + - supports-color + - typescript + dev: true + /@fingerprintjs/fingerprintjs-pro@3.9.2: resolution: {integrity: sha512-H8CkfBp8LAfH8m7QU/BWvn+wBew6PWwN7SpChw7nTQfuDDzd7RtUGmF/O1b00Url6/MmGRsOM6bjZUrH8N49BA==} dependencies: tslib: 2.6.2 dev: false + /@fingerprintjs/prettier-config-dx-team@0.1.0: + resolution: {integrity: sha512-ZXoyr5yEIMyBHujVa841dz+aHs9vqzRIU2+IpTG7JTZvbwztVeRdNxBGavWC51TtrlC+Q8Gi6Ba/ynZ6/7EYMg==} + dependencies: + prettier: 3.2.4 + dev: true + + /@fingerprintjs/tsconfig-dx-team@0.0.2: + resolution: {integrity: sha512-UZceav58WeTru7yYlATCqw5fMGfvDLg/Y3FCmNucfu0ASuJ8WrFIJez+rAwrJ5ibUNpnJS2VW/ZIxCh9Ww9aIw==} + dev: true + /@humanwhocodes/config-array@0.11.14: resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -1451,25 +1469,25 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/eslint-plugin@6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.4.2): + resolution: {integrity: sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/scope-manager': 7.3.1 - '@typescript-eslint/type-utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/visitor-keys': 7.3.1 + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.4.2) + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/type-utils': 6.19.1(eslint@8.56.0)(typescript@5.4.2) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 6.19.1 debug: 4.3.4 - eslint: 8.57.0 + eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -1480,71 +1498,71 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@7.3.1(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.4.2): + resolution: {integrity: sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.3.1 - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) - '@typescript-eslint/visitor-keys': 7.3.1 + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 6.19.1 debug: 4.3.4 - eslint: 8.57.0 + eslint: 8.56.0 typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@7.3.1: - resolution: {integrity: sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/scope-manager@6.19.1: + resolution: {integrity: sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/visitor-keys': 7.3.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/visitor-keys': 6.19.1 dev: true - /@typescript-eslint/type-utils@7.3.1(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/type-utils@6.19.1(eslint@8.56.0)(typescript@5.4.2): + resolution: {integrity: sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) - '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.4.2) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.4.2) debug: 4.3.4 - eslint: 8.57.0 + eslint: 8.56.0 ts-api-utils: 1.3.0(typescript@5.4.2) typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types@7.3.1: - resolution: {integrity: sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/types@6.19.1: + resolution: {integrity: sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==} + engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@7.3.1(typescript@5.4.2): - resolution: {integrity: sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/typescript-estree@6.19.1(typescript@5.4.2): + resolution: {integrity: sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/visitor-keys': 7.3.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/visitor-keys': 6.19.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1556,30 +1574,30 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@7.3.1(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/utils@6.19.1(eslint@8.56.0)(typescript@5.4.2): + resolution: {integrity: sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.3.1 - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) - eslint: 8.57.0 + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.4.2) + eslint: 8.56.0 semver: 7.6.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@7.3.1: - resolution: {integrity: sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/visitor-keys@6.19.1: + resolution: {integrity: sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/types': 6.19.1 eslint-visitor-keys: 3.4.3 dev: true @@ -2999,16 +3017,16 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-prettier@9.1.0(eslint@8.57.0): + /eslint-config-prettier@9.1.0(eslint@8.56.0): resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.57.0 + eslint: 8.56.0 dev: true - /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5): + /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.5): resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3022,8 +3040,8 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.57.0 - eslint-config-prettier: 9.1.0(eslint@8.57.0) + eslint: 8.56.0 + eslint-config-prettier: 9.1.0(eslint@8.56.0) prettier: 3.2.5 prettier-linter-helpers: 1.0.0 synckit: 0.8.8 @@ -3050,15 +3068,15 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + /eslint@8.56.0: + resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 + '@eslint/js': 8.56.0 '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -5539,6 +5557,12 @@ packages: fast-diff: 1.3.0 dev: true + /prettier@3.2.4: + resolution: {integrity: sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==} + engines: {node: '>=14'} + hasBin: true + dev: true + /prettier@3.2.5: resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} engines: {node: '>=14'}