From c617d1853b44d4e5c4f44574df5b55f01962b793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 11 Nov 2023 11:10:53 +0100 Subject: [PATCH] chore(jslib): add eslint ava --- tools/upend_js/.eslintrc.json | 41 +++++---- tools/upend_js/package.json | 1 + tools/upend_js/pnpm-lock.yaml | 155 ++++++++++++++++++++++++++-------- 3 files changed, 138 insertions(+), 59 deletions(-) diff --git a/tools/upend_js/.eslintrc.json b/tools/upend_js/.eslintrc.json index 83cb17c..b381c13 100644 --- a/tools/upend_js/.eslintrc.json +++ b/tools/upend_js/.eslintrc.json @@ -1,24 +1,21 @@ { - "ignorePatterns": ["**/*.js"], - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module", - "project": "./tsconfig.json" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "@typescript-eslint/consistent-type-exports": "error", - "@typescript-eslint/consistent-type-imports": "error" - } + "ignorePatterns": ["**/*.js"], + "env": { + "browser": true, + "es2021": true + }, + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module", + "project": "./tsconfig.json" + }, + "plugins": ["@typescript-eslint", "ava"], + "rules": { + "@typescript-eslint/consistent-type-exports": "error", + "@typescript-eslint/consistent-type-imports": "error", + "ava/assertion-arguments": "error", + "ava/...": "error" + } } diff --git a/tools/upend_js/package.json b/tools/upend_js/package.json index 59f002b..d2cb3a7 100644 --- a/tools/upend_js/package.json +++ b/tools/upend_js/package.json @@ -20,6 +20,7 @@ "@typescript-eslint/parser": "latest", "ava": "^3.15.0", "eslint": "^8.7.0", + "eslint-plugin-ava": "^14.0.0", "typescript": "^4.4.4" }, "dependencies": { diff --git a/tools/upend_js/pnpm-lock.yaml b/tools/upend_js/pnpm-lock.yaml index 34bda71..5a9479f 100644 --- a/tools/upend_js/pnpm-lock.yaml +++ b/tools/upend_js/pnpm-lock.yaml @@ -24,16 +24,19 @@ devDependencies: version: 4.1.8 '@typescript-eslint/eslint-plugin': specifier: latest - version: 6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.7.0)(typescript@4.4.4) + version: 6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.7.0)(typescript@4.4.4) '@typescript-eslint/parser': specifier: latest - version: 6.4.1(eslint@8.7.0)(typescript@4.4.4) + version: 6.10.0(eslint@8.7.0)(typescript@4.4.4) ava: specifier: ^3.15.0 version: 3.15.0 eslint: specifier: ^8.7.0 version: 8.7.0 + eslint-plugin-ava: + specifier: ^14.0.0 + version: 14.0.0(eslint@8.7.0) typescript: specifier: ^4.4.4 version: 4.4.4 @@ -186,8 +189,8 @@ packages: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true - /@typescript-eslint/eslint-plugin@6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.7.0)(typescript@4.4.4): - resolution: {integrity: sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==} + /@typescript-eslint/eslint-plugin@6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.7.0)(typescript@4.4.4): + resolution: {integrity: sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -198,11 +201,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 6.4.1(eslint@8.7.0)(typescript@4.4.4) - '@typescript-eslint/scope-manager': 6.4.1 - '@typescript-eslint/type-utils': 6.4.1(eslint@8.7.0)(typescript@4.4.4) - '@typescript-eslint/utils': 6.4.1(eslint@8.7.0)(typescript@4.4.4) - '@typescript-eslint/visitor-keys': 6.4.1 + '@typescript-eslint/parser': 6.10.0(eslint@8.7.0)(typescript@4.4.4) + '@typescript-eslint/scope-manager': 6.10.0 + '@typescript-eslint/type-utils': 6.10.0(eslint@8.7.0)(typescript@4.4.4) + '@typescript-eslint/utils': 6.10.0(eslint@8.7.0)(typescript@4.4.4) + '@typescript-eslint/visitor-keys': 6.10.0 debug: 4.3.4 eslint: 8.7.0 graphemer: 1.4.0 @@ -215,8 +218,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.4.1(eslint@8.7.0)(typescript@4.4.4): - resolution: {integrity: sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==} + /@typescript-eslint/parser@6.10.0(eslint@8.7.0)(typescript@4.4.4): + resolution: {integrity: sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -225,10 +228,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.4.1 - '@typescript-eslint/types': 6.4.1 - '@typescript-eslint/typescript-estree': 6.4.1(typescript@4.4.4) - '@typescript-eslint/visitor-keys': 6.4.1 + '@typescript-eslint/scope-manager': 6.10.0 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/typescript-estree': 6.10.0(typescript@4.4.4) + '@typescript-eslint/visitor-keys': 6.10.0 debug: 4.3.4 eslint: 8.7.0 typescript: 4.4.4 @@ -236,16 +239,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.4.1: - resolution: {integrity: sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==} + /@typescript-eslint/scope-manager@6.10.0: + resolution: {integrity: sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.4.1 - '@typescript-eslint/visitor-keys': 6.4.1 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/visitor-keys': 6.10.0 dev: true - /@typescript-eslint/type-utils@6.4.1(eslint@8.7.0)(typescript@4.4.4): - resolution: {integrity: sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==} + /@typescript-eslint/type-utils@6.10.0(eslint@8.7.0)(typescript@4.4.4): + resolution: {integrity: sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -254,8 +257,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.4.1(typescript@4.4.4) - '@typescript-eslint/utils': 6.4.1(eslint@8.7.0)(typescript@4.4.4) + '@typescript-eslint/typescript-estree': 6.10.0(typescript@4.4.4) + '@typescript-eslint/utils': 6.10.0(eslint@8.7.0)(typescript@4.4.4) debug: 4.3.4 eslint: 8.7.0 ts-api-utils: 1.0.2(typescript@4.4.4) @@ -264,13 +267,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@6.4.1: - resolution: {integrity: sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==} + /@typescript-eslint/types@6.10.0: + resolution: {integrity: sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.4.1(typescript@4.4.4): - resolution: {integrity: sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==} + /@typescript-eslint/typescript-estree@6.10.0(typescript@4.4.4): + resolution: {integrity: sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -278,8 +281,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.4.1 - '@typescript-eslint/visitor-keys': 6.4.1 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/visitor-keys': 6.10.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -290,8 +293,8 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.4.1(eslint@8.7.0)(typescript@4.4.4): - resolution: {integrity: sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==} + /@typescript-eslint/utils@6.10.0(eslint@8.7.0)(typescript@4.4.4): + resolution: {integrity: sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -299,9 +302,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.7.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 6.4.1 - '@typescript-eslint/types': 6.4.1 - '@typescript-eslint/typescript-estree': 6.4.1(typescript@4.4.4) + '@typescript-eslint/scope-manager': 6.10.0 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/typescript-estree': 6.10.0(typescript@4.4.4) eslint: 8.7.0 semver: 7.5.4 transitivePeerDependencies: @@ -309,11 +312,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.4.1: - resolution: {integrity: sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==} + /@typescript-eslint/visitor-keys@6.10.0: + resolution: {integrity: sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.4.1 + '@typescript-eslint/types': 6.10.0 eslint-visitor-keys: 3.4.1 dev: true @@ -881,6 +884,13 @@ packages: once: 1.4.0 dev: true + /enhance-visitors@1.0.0: + resolution: {integrity: sha512-+29eJLiUixTEDRaZ35Vu8jP3gPLNcQQkQkOQjLp2X+6cZGGPDD/uasbFzvLsJKnGZnvmyZ0srxudwOtskHeIDA==} + engines: {node: '>=4.0.0'} + dependencies: + lodash: 4.17.21 + dev: true + /equal-length@1.0.1: resolution: {integrity: sha512-TK2m7MvWPt/v3dan0BCNp99pytIE5UGrUj7F0KZirNX8xz8fDFUAZfgm8uB5FuQq9u0sMeDocYBfEhsd1nwGoA==} engines: {node: '>=4'} @@ -917,6 +927,23 @@ packages: engines: {node: '>=10'} dev: true + /eslint-plugin-ava@14.0.0(eslint@8.7.0): + resolution: {integrity: sha512-XmKT6hppaipwwnLVwwvQliSU6AF1QMHiNoLD5JQfzhUhf0jY7CO0O624fQrE+Y/fTb9vbW8r77nKf7M/oHulxw==} + engines: {node: '>=14.17 <15 || >=16.4'} + peerDependencies: + eslint: '>=8.26.0' + dependencies: + enhance-visitors: 1.0.0 + eslint: 8.7.0 + eslint-utils: 3.0.0(eslint@8.7.0) + espree: 9.3.0 + espurify: 2.1.1 + import-modules: 2.1.0 + micro-spelling-correcter: 1.1.1 + pkg-dir: 5.0.0 + resolve-from: 5.0.0 + dev: true + /eslint-scope@7.1.0: resolution: {integrity: sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1009,6 +1036,10 @@ packages: hasBin: true dev: true + /espurify@2.1.1: + resolution: {integrity: sha512-zttWvnkhcDyGOhSH4vO2qCBILpdCMv/MX8lp4cqgRkQoDRGK2oZxi2GfWhlP2dIXmk7BaKeOTuzbHhyC68o8XQ==} + dev: true + /esquery@1.4.0: resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} engines: {node: '>=0.10'} @@ -1102,6 +1133,14 @@ packages: path-exists: 4.0.0 dev: true + /find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + /flat-cache@3.0.4: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -1307,6 +1346,11 @@ packages: resolve-cwd: 3.0.0 dev: true + /import-modules@2.1.0: + resolution: {integrity: sha512-8HEWcnkbGpovH9yInoisxaSoIg9Brbul+Ju3Kqe2UsYDUBJD/iQjSgEj0zPcTDPKfPp2fs5xlv1i+JSye/m1/A==} + engines: {node: '>=8'} + dev: true + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -1546,6 +1590,13 @@ packages: p-locate: 4.1.0 dev: true + /locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true @@ -1625,6 +1676,10 @@ packages: engines: {node: '>= 8'} dev: true + /micro-spelling-correcter@1.1.1: + resolution: {integrity: sha512-lkJ3Rj/mtjlRcHk6YyCbvZhyWTOzdBvTHsxMmZSk5jxN1YyVSQ+JETAom55mdzfcyDrY/49Z7UCW760BK30crg==} + dev: true + /micromatch@4.0.4: resolution: {integrity: sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==} engines: {node: '>=8.6'} @@ -1757,6 +1812,13 @@ packages: p-try: 2.2.0 dev: true + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + /p-locate@3.0.0: resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} engines: {node: '>=6'} @@ -1771,6 +1833,13 @@ packages: p-limit: 2.3.0 dev: true + /p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} @@ -1884,6 +1953,13 @@ packages: find-up: 4.1.0 dev: true + /pkg-dir@5.0.0: + resolution: {integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==} + engines: {node: '>=10'} + dependencies: + find-up: 5.0.0 + dev: true + /plur@4.0.0: resolution: {integrity: sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==} engines: {node: '>=10'} @@ -2450,3 +2526,8 @@ packages: y18n: 5.0.8 yargs-parser: 20.2.9 dev: true + + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true