From 38c104492a229123bbbaf0dad943fee2122ece72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brandon=20der=20Bl=C3=A4tter?= Date: Tue, 12 Nov 2024 08:55:03 -0800 Subject: [PATCH] build: migrate eslint config to flat style (#913) ## Description Migrate .eslintrc to esling.config.mjs. Using .mjs so I can use `import` (.ts configs are still experimental). Fixed a few lint issues that were easy, changed one new lint rule to a warn since it wasn't caught before. ## Related Issue Fixes #899 ## Motivation and Context Using the new flat config for Eslint is required for upgrading to 9.0 ## How Has This Been Tested? Ran `npm run lint` and VS Code Eslint plugin many times ## Screenshots (if appropriate): ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. - [ ] If my change introduces a breaking change, I have added a `!` after the type/scope in the title (see the Conventional Commits standard). --- .eslintrc | 60 --------- eslint.config.mjs | 103 +++++++++++++++ package-lock.json | 286 ++++++++++++++++++++++++++++++++++++++++- package.json | 7 +- tests/cron.fuzz.ts | 13 +- tests/cron.test.ts | 4 +- tests/crontime.test.ts | 4 +- 7 files changed, 402 insertions(+), 75 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslint.config.mjs diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0e3ca183..00000000 --- a/.eslintrc +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": ["@typescript-eslint/eslint-plugin"], - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:@typescript-eslint/strict", - "plugin:prettier/recommended" - ], - "root": true, - "env": { - "node": true - }, - "rules": { - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "argsIgnorePattern": "^_" - } - ], - "@typescript-eslint/naming-convention": [ - "warn", - { - "selector": ["typeLike"], - "format": ["PascalCase"] - }, - { - "selector": ["variableLike", "function"], - "format": ["camelCase"], - "leadingUnderscore": "allow" - }, - { - "selector": ["variable"], - "format": ["camelCase", "UPPER_CASE"] - }, - { - "selector": "variable", - "types": ["boolean"], - "format": ["PascalCase"], - "prefix": ["is", "should", "has", "can", "did", "was", "will"] - } - ] - }, - "overrides": [ - { - "files": ["tests/**/*.ts"], - "plugins": ["jest"], - "extends": ["plugin:jest/recommended", "plugin:jest/style"], - "rules": { - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/unbound-method": "off", - "jest/no-done-callback": "off" - } - } - ] -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..49fe3b75 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,103 @@ +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import tseslint from 'typescript-eslint'; +import globals from 'globals'; +import tsParser from '@typescript-eslint/parser'; +import jest from 'eslint-plugin-jest'; +import js from '@eslint/js'; + +export default [ + // using .mjs for module support as TypeScript Eslint configs are still experimental + { + name: 'Eslint config file', + files: ['eslint.config.mjs'], + // ...tseslint.configs.disableTypeChecked, + // ...js.configs.recommended, + + languageOptions: { + sourceType: 'module', + parserOptions: { + // project: 'package.json' + } + } + }, + + { + name: 'general project rules', + files: ['**/*.ts'], + + plugins: { + '@typescript-eslint': tseslint.plugin + }, + + languageOptions: { + globals: { + ...globals.node + }, + + parser: tsParser, + ecmaVersion: 5, + sourceType: 'module', + + parserOptions: { + project: 'tsconfig.json' + } + }, + + rules: { + // contains all of recommended, recommended-type-checked, and strict + ...tseslint.configs.strictTypeChecked.rules, + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_' + } + ], + + '@typescript-eslint/naming-convention': [ + 'warn', + { + selector: ['typeLike'], + format: ['PascalCase'] + }, + { + selector: ['variableLike', 'function'], + format: ['camelCase'], + leadingUnderscore: 'allow' + }, + { + selector: ['variable'], + format: ['camelCase', 'UPPER_CASE'] + }, + { + selector: 'variable', + types: ['boolean'], + format: ['PascalCase'], + prefix: ['is', 'should', 'has', 'can', 'did', 'was', 'will'] + } + ], + // this is set to warn because it wasn't caught before the eslint migration in 11/2024 + '@typescript-eslint/restrict-template-expressions': 'warn' + } + }, + + { + name: 'test rules', + files: ['tests/**/*.ts'], + + ...jest.configs['flat/recommended'], + ...jest.configs['flat/style'], + + plugins: { + jest + }, + + rules: { + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/unbound-method': 'off', + 'jest/no-done-callback': 'off' + } + }, + + // Prettier plugin which should be last + eslintPluginPrettierRecommended +]; diff --git a/package-lock.json b/package-lock.json index 31b0b115..476fb86c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ }, "devDependencies": { "@commitlint/cli": "19.5.0", + "@eslint/js": "^9.14.0", "@fast-check/jest": "2.0.3", "@insurgent/commitlint-config": "20.0.0", "@insurgent/conventional-changelog-preset": "10.0.0", @@ -26,7 +27,6 @@ "@types/jest": "29.5.14", "@types/node": "20.17.6", "@types/sinon": "17.0.3", - "@typescript-eslint/eslint-plugin": "6.21.0", "chai": "4.5.0", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", @@ -38,7 +38,8 @@ "semantic-release": "24.2.0", "sinon": "17.0.2", "ts-jest": "29.2.5", - "typescript": "5.6.3" + "typescript": "5.6.3", + "typescript-eslint": "^7.2.0" } }, "node_modules/@ampproject/remapping": { @@ -927,13 +928,13 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "version": "9.14.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz", + "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==", "dev": true, "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@fast-check/jest": { @@ -2808,6 +2809,8 @@ "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", "@typescript-eslint/scope-manager": "6.21.0", @@ -2844,6 +2847,7 @@ "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, "license": "BSD-2-Clause", + "optional": true, "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", @@ -2874,6 +2878,8 @@ "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0" @@ -2892,6 +2898,8 @@ "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@typescript-eslint/typescript-estree": "6.21.0", "@typescript-eslint/utils": "6.21.0", @@ -2920,6 +2928,8 @@ "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -2934,6 +2944,8 @@ "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, "license": "BSD-2-Clause", + "optional": true, + "peer": true, "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", @@ -2963,6 +2975,8 @@ "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -2984,6 +2998,8 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=8" } @@ -2994,6 +3010,8 @@ "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", @@ -3020,6 +3038,8 @@ "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" @@ -4851,6 +4871,16 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -13430,6 +13460,250 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.2.0.tgz", + "integrity": "sha512-VqXEBqzPxJlR8Lfg2Dywe4XpIk637kwp2sfMQ+vudNHo48TUvnlHzAyFMQknv0AdhvZFXQN0a0t9SPI3rsAYew==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "7.2.0", + "@typescript-eslint/parser": "7.2.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz", + "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/type-utils": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", + "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", + "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/type-utils": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz", + "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", + "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", + "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz", + "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", + "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript-eslint/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/uglify-js": { "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", diff --git a/package.json b/package.json index fb8e161b..1fd2d116 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "types": "dist/index.d.ts", "scripts": { "build": "tsc -b tsconfig.build.json", - "lint:eslint": "eslint src/ tests/ --ext .ts", + "lint:eslint": "eslint src/ tests/", "lint:prettier": "prettier ./**/*.{json,md,yml} --check", "lint": "npm run lint:eslint && npm run lint:prettier", "lint:fix": "npm run lint:eslint -- --fix && npm run lint:prettier -- --write", @@ -29,6 +29,7 @@ }, "devDependencies": { "@commitlint/cli": "19.5.0", + "@eslint/js": "^9.14.0", "@fast-check/jest": "2.0.3", "@insurgent/commitlint-config": "20.0.0", "@insurgent/conventional-changelog-preset": "10.0.0", @@ -41,7 +42,6 @@ "@types/jest": "29.5.14", "@types/node": "20.17.6", "@types/sinon": "17.0.3", - "@typescript-eslint/eslint-plugin": "6.21.0", "chai": "4.5.0", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", @@ -53,7 +53,8 @@ "semantic-release": "24.2.0", "sinon": "17.0.2", "ts-jest": "29.2.5", - "typescript": "5.6.3" + "typescript": "5.6.3", + "typescript-eslint": "^7.2.0" }, "keywords": [ "cron", diff --git a/tests/cron.fuzz.ts b/tests/cron.fuzz.ts index e23f3f7a..6dad222c 100644 --- a/tests/cron.fuzz.ts +++ b/tests/cron.fuzz.ts @@ -80,7 +80,9 @@ test.prop( { numRuns: 100_000 } )( 'CronJob should behave as expected and not error unexpectedly (with matching inputs)', - params => testCronJob(params, err => err instanceof CronError) + params => { + testCronJob(params, err => err instanceof CronError); + } ); test.prop( @@ -96,7 +98,9 @@ test.prop( { numRuns: 100_000 } )( 'CronJob should behave as expected and not error unexpectedly (with random inputs)', - params => testCronJob(params, err => err instanceof CronError) + params => { + testCronJob(params, err => err instanceof CronError); + } ); test.prop( @@ -112,10 +116,11 @@ test.prop( { numRuns: 100_000 } )( 'CronJob should behave as expected and not error unexpectedly (with anything inputs)', - params => + params => { testCronJob( // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument params as any, err => err instanceof CronError || err instanceof TypeError - ) + ); + } ); diff --git a/tests/cron.test.ts b/tests/cron.test.ts index 5f14edbc..0aef3ba4 100644 --- a/tests/cron.test.ts +++ b/tests/cron.test.ts @@ -4,7 +4,9 @@ import { CronJob, CronTime } from '../src'; describe('cron', () => { // eslint-disable-next-line jest/no-standalone-expect - afterEach(() => expect.hasAssertions()); + afterEach(() => { + expect.hasAssertions(); + }); describe('with seconds', () => { it('should run every second (* * * * * *)', () => { diff --git a/tests/crontime.test.ts b/tests/crontime.test.ts index 3827268b..8d9d2426 100644 --- a/tests/crontime.test.ts +++ b/tests/crontime.test.ts @@ -4,7 +4,9 @@ import { CronTime } from '../src'; describe('crontime', () => { // eslint-disable-next-line jest/no-standalone-expect - afterEach(() => expect.hasAssertions()); + afterEach(() => { + expect.hasAssertions(); + }); it('should test stars (* * * * * *)', () => { expect(() => {