SeekingAlpha TypeScript ESLint Config
eslint-config-seekingalpha-typescript provides a sharable ESLint configuration tailored for TypeScript projects, reflecting the code quality standards and conventions used internally by SeekingAlpha. Currently at version 8.73.0, this configuration package is actively maintained and updated to align with the latest versions of ESLint and `typescript-eslint`. Its primary function is to enforce a consistent and opinionated set of rules, including those specific to TypeScript, to enhance code quality and maintainability across projects. Key differentiators include its tight integration with `typescript-eslint` for robust TypeScript linting and its proven application in a large-scale production environment. Users should anticipate updates as major versions of its peer dependencies (ESLint and `typescript-eslint`) are released, ensuring compatibility and leveraging new features and rule enhancements.
Common errors
-
Error: Cannot find module 'eslint-config-seekingalpha-typescript'
cause The package has not been installed or there's a typo in the import path.fixRun `npm install eslint-config-seekingalpha-typescript --save-dev` to install the package. -
Error: Failed to load plugin '@typescript-eslint' declared in 'eslint-config-seekingalpha-typescript/index.js': Cannot find module '@typescript-eslint/eslint-plugin'
cause The `typescript-eslint` peer dependency is either missing or an incompatible version is installed.fixInstall the correct version: `npm install typescript-eslint@8.58.2 --save-dev`. -
Error: The current Node.js version (vX.Y.Z) does not satisfy the required version '>= 24'.
cause Your Node.js environment does not meet the minimum version requirement specified in the package's `engines` field.fixUpgrade your Node.js version to 24 or higher. Use `nvm install 24` and `nvm use 24` or similar version management tools.
Warnings
- breaking This package is designed for ESLint v9+ and uses the new flat configuration format (`eslint.config.js`). It is incompatible with legacy ESLint v8 and older `eslintrc` configurations.
- breaking Strict Node.js engine requirement: This package, and its peer dependencies, require Node.js version 24 or newer.
- breaking This package has strict peer dependency versions for `eslint` (9.39.2) and `typescript-eslint` (8.58.2). Mismatched versions will likely lead to errors or unexpected behavior.
- gotcha The configuration is opinionated based on SeekingAlpha's internal standards. Users may need to override specific rules to fit their project's unique requirements.
Install
-
npm install eslint-config-seekingalpha-typescript -
yarn add eslint-config-seekingalpha-typescript -
pnpm add eslint-config-seekingalpha-typescript
Imports
- tsConfig
const tsConfig = require('eslint-config-seekingalpha-typescript');import tsConfig from 'eslint-config-seekingalpha-typescript';
Quickstart
import tsConfig from 'eslint-config-seekingalpha-typescript';
export default [
{
plugins: {
...tsConfig.plugins,
},
rules: {
...tsConfig.rules,
},
settings: {
...tsConfig.settings,
},
},
];