diff --git a/eslint-configs/eslint-config-seekingalpha-tests/CHANGELOG.md b/eslint-configs/eslint-config-seekingalpha-tests/CHANGELOG.md index e6d177ac..790864cd 100644 --- a/eslint-configs/eslint-config-seekingalpha-tests/CHANGELOG.md +++ b/eslint-configs/eslint-config-seekingalpha-tests/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 4.47.0 - 2026-01-28 + +- [new] add sharable oxlint config with eslint-plugin-jest rules + ## 4.46.0 - 2026-01-04 - [deps] upgrade `eslint-plugin-jest` to version `29.12.1` diff --git a/eslint-configs/eslint-config-seekingalpha-tests/oxc.js b/eslint-configs/eslint-config-seekingalpha-tests/oxc.js new file mode 100644 index 00000000..096cf626 --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-tests/oxc.js @@ -0,0 +1,13 @@ +import { ESLintPluginJestDisabled } from './rules/eslint-plugin-jest/oxlint-disabled.js'; + +import config from './index.js'; + +const oxcConfig = { + ...config, + rules: { + ...config.rules, + ...ESLintPluginJestDisabled, + }, +}; + +export default oxcConfig; diff --git a/eslint-configs/eslint-config-seekingalpha-tests/oxlint-config.json b/eslint-configs/eslint-config-seekingalpha-tests/oxlint-config.json new file mode 100644 index 00000000..6e339d35 --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-tests/oxlint-config.json @@ -0,0 +1,4 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "extends": ["./rules/eslint-plugin-jest/oxlint-config.json"] +} diff --git a/eslint-configs/eslint-config-seekingalpha-tests/package.json b/eslint-configs/eslint-config-seekingalpha-tests/package.json index 16f459d0..03948b2b 100644 --- a/eslint-configs/eslint-config-seekingalpha-tests/package.json +++ b/eslint-configs/eslint-config-seekingalpha-tests/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-seekingalpha-tests", - "version": "4.46.0", + "version": "4.47.0", "description": "SeekingAlpha's sharable testing ESLint config", "main": "index.js", "type": "module", diff --git a/eslint-configs/eslint-config-seekingalpha-tests/rules/eslint-plugin-jest/oxlint-config.json b/eslint-configs/eslint-config-seekingalpha-tests/rules/eslint-plugin-jest/oxlint-config.json new file mode 100644 index 00000000..1ca61d72 --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-tests/rules/eslint-plugin-jest/oxlint-config.json @@ -0,0 +1,73 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["jest"], + "rules": { + "jest/consistent-test-it": "error", + "jest/expect-expect": "error", + "jest/max-expects": "off", + "jest/prefer-each": "error", + "jest/prefer-lowercase-title": "off", + "jest/prefer-mock-promise-shorthand": "error", + "jest/max-nested-describe": [ + "error", + { + "max": 2 + } + ], + "jest/no-alias-methods": "error", + "jest/no-commented-out-tests": "error", + "jest/no-conditional-expect": "error", + "jest/no-conditional-in-test": "error", + "jest/no-confusing-set-timeout": "error", + "jest/no-deprecated-functions": "error", + "jest/no-disabled-tests": "error", + "jest/no-duplicate-hooks": "error", + "jest/no-export": "error", + "jest/no-focused-tests": "error", + "jest/no-hooks": "off", + "jest/no-identical-title": "error", + "jest/no-interpolation-in-snapshots": "error", + "jest/no-jasmine-globals": "error", + "jest/no-large-snapshots": [ + "error", + { + "maxSize": 50 + } + ], + "jest/no-mocks-import": "off", + "jest/no-restricted-matchers": [ + "error", + { + "toBeFalsy": "Use `toBe(false)` instead.", + "toBeTruthy": "Use `toBe(true)` instead." + } + ], + "jest/no-standalone-expect": "error", + "jest/no-done-callback": "error", + "jest/no-restricted-jest-methods": "off", + "jest/no-test-prefixes": "error", + "jest/no-test-return-statement": "error", + "jest/no-untyped-mock-factory": "off", + "jest/prefer-called-with": "error", + "jest/prefer-comparison-matcher": "error", + "jest/prefer-equality-matcher": "error", + "jest/prefer-expect-resolves": "error", + "jest/prefer-hooks-in-order": "error", + "jest/prefer-hooks-on-top": "error", + "jest/prefer-jest-mocked": "error", + "jest/prefer-spy-on": "error", + "jest/prefer-strict-equal": "error", + "jest/prefer-to-be": "error", + "jest/prefer-to-contain": "error", + "jest/prefer-to-have-been-called": "error", + "jest/prefer-to-have-been-called-times": "error", + "jest/prefer-to-have-length": "error", + "jest/prefer-todo": "error", + "jest/require-hook": "off", + "jest/require-to-throw-message": "error", + "jest/require-top-level-describe": "error", + "jest/valid-describe-callback": "error", + "jest/valid-expect": "error", + "jest/valid-title": "error" + } +} diff --git a/eslint-configs/eslint-config-seekingalpha-tests/rules/eslint-plugin-jest/oxlint-disabled.js b/eslint-configs/eslint-config-seekingalpha-tests/rules/eslint-plugin-jest/oxlint-disabled.js new file mode 100644 index 00000000..dabe649d --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-tests/rules/eslint-plugin-jest/oxlint-disabled.js @@ -0,0 +1,53 @@ +export const ESLintPluginJestDisabled = { + 'jest/consistent-test-it': 'off', + 'jest/expect-expect': 'off', + 'jest/max-expects': 'off', + 'jest/prefer-each': 'off', + 'jest/prefer-lowercase-title': 'off', + 'jest/prefer-mock-promise-shorthand': 'off', + 'jest/max-nested-describe': 'off', + 'jest/no-alias-methods': 'off', + 'jest/no-commented-out-tests': 'off', + 'jest/no-conditional-expect': 'off', + 'jest/no-conditional-in-test': 'off', + 'jest/no-confusing-set-timeout': 'off', + 'jest/no-deprecated-functions': 'off', + 'jest/no-disabled-tests': 'off', + 'jest/no-duplicate-hooks': 'off', + 'jest/no-export': 'off', + 'jest/no-focused-tests': 'off', + 'jest/no-hooks': 'off', + 'jest/no-identical-title': 'off', + 'jest/no-interpolation-in-snapshots': 'off', + 'jest/no-jasmine-globals': 'off', + 'jest/no-large-snapshots': 'off', + 'jest/no-mocks-import': 'off', + 'jest/no-restricted-matchers': 'off', + 'jest/no-standalone-expect': 'off', + 'jest/no-done-callback': 'off', + 'jest/no-restricted-jest-methods': 'off', + 'jest/no-test-prefixes': 'off', + 'jest/no-test-return-statement': 'off', + 'jest/no-untyped-mock-factory': 'off', + 'jest/prefer-called-with': 'off', + 'jest/prefer-comparison-matcher': 'off', + 'jest/prefer-equality-matcher': 'off', + 'jest/prefer-expect-resolves': 'off', + 'jest/prefer-hooks-in-order': 'off', + 'jest/prefer-hooks-on-top': 'off', + 'jest/prefer-jest-mocked': 'off', + 'jest/prefer-spy-on': 'off', + 'jest/prefer-strict-equal': 'off', + 'jest/prefer-to-be': 'off', + 'jest/prefer-to-contain': 'off', + 'jest/prefer-to-have-been-called': 'off', + 'jest/prefer-to-have-been-called-times': 'off', + 'jest/prefer-to-have-length': 'off', + 'jest/prefer-todo': 'off', + 'jest/require-hook': 'off', + 'jest/require-to-throw-message': 'off', + 'jest/require-top-level-describe': 'off', + 'jest/valid-describe-callback': 'off', + 'jest/valid-expect': 'off', + 'jest/valid-title': 'off', +}; diff --git a/package.json b/package.json index 55b14351..a98631fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seekingalpha-javascript-style", - "version": "9.85.1", + "version": "9.86.0", "description": "Set of linting rules, guides and best practices for best Javascript code", "main": "index.js", "type": "module",