SeekingAlpha Tests ESLint Config

raw JSON →
4.60.0 verified Sat Apr 25 auth: no javascript

SeekingAlpha's shareable ESLint configuration for testing environments using ESLint 9.39.2, eslint-plugin-jest 29.15.2, and eslint-plugin-testing-library 7.16.2. This config is designed for ES6+ codebases and is distributed under MIT license. It requires Node.js >= 24 and uses the flat config format (eslint.config.js) introduced in ESLint 9. The package enforces Jest and Testing Library best practices for unit and integration tests. It is part of SeekingAlpha's JavaScript monorepo and follows their internal coding standards.

error Error: Cannot find module 'eslint-config-seekingalpha-tests'
cause Package not installed or not in node_modules.
fix
Run 'npm install eslint-config-seekingalpha-tests@latest --save-dev'
error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
cause Using CommonJS require() to load an ESM-only package.
fix
Use import statement in an ESM context (e.g., set 'type': 'module' in package.json or rename file to .mjs).
error Oops! Something went wrong! :( ESLint: 9.39.2. Configuration for rule 'jest/consistent-test-it' is invalid: Value "test" does not match any valid value.
cause Incompatible version of eslint-plugin-jest or missing peer dependency.
fix
Ensure eslint-plugin-jest@29.15.2 is installed exactly.
error ESLint couldn't find the config 'eslint-config-seekingalpha-tests' in extended configs. You can remove this config from the extends list.
cause Using the legacy 'extends' field in .eslintrc.* with a flat config package.
fix
Use flat config eslint.config.js and import the module as shown in quickstart.
breaking ESLint 9 flat config only; does not support .eslintrc.* formats. Using legacy config results in 'Configuration for rule "..." is invalid' or ESLint failing to load config.
fix Migrate to eslint.config.js flat config format. See ESLint documentation.
breaking Requires Node.js >= 24. Older Node versions cause 'ERR_REQUIRE_ESM' or syntax errors.
fix Upgrade Node.js to 24 or later.
gotcha The default export is an object with 'plugins' and 'rules' keys, not an array. Using it directly as a config array element may cause 'Config (element) is not an array' error.
fix Wrap in an array as shown in the quickstart example, or spread plugins and rules into a new config object.
gotcha Peer dependencies must be installed at exact versions specified ('eslint@9.39.2', 'eslint-plugin-jest@29.15.2', 'eslint-plugin-testing-library@7.16.2'). Mismatched versions may cause rule conflicts or missing plugins.
fix Install with exact versions: npm install eslint@9.39.2 eslint-plugin-jest@29.15.2 eslint-plugin-testing-library@7.16.2 --save-dev
deprecated Package is internal to SeekingAlpha; no longer maintained for public use. Issues and PRs may not be addressed.
fix Consider creating your own ESLint config or using community alternatives like eslint-config-jest.
npm install eslint-config-seekingalpha-tests
yarn add eslint-config-seekingalpha-tests
pnpm add eslint-config-seekingalpha-tests

Shows how to use the shareable config in eslint.config.js by importing the default export and spreading its plugins and rules.

import testsConfig from 'eslint-config-seekingalpha-tests';

export default [
  {
    plugins: {
      ...testsConfig.plugins,
    },
    rules: {
      ...testsConfig.rules,
    },
  },
];