{"id":15607,"library":"eslint-config-txo-typescript","title":"TXO TypeScript ESLint Configuration","description":"eslint-config-txo-typescript provides a comprehensive, opinionated ESLint configuration specifically designed for TypeScript projects. It is maintained by Technology Studio and is currently at a stable version, `7.4.114`. The package maintains a frequent release cadence, often updating to reflect changes and improvements in its underlying dependencies, particularly `typescript-eslint`. A key differentiator of this configuration is its focus on \"separation of concerns,\" allowing for incremental migration and tailored settings based on project patterns. This approach aims to reduce friction when integrating or updating linting rules across diverse TypeScript codebases, ensuring consistency and adherence to modern best practices in a modular fashion. It leverages established ESLint plugins to enforce robust code quality and style standards.","status":"active","version":"7.4.114","language":"javascript","source_language":"en","source_url":"https://github.com/technology-studio/eslint-config-txo-typescript","tags":["javascript","typescript"],"install":[{"cmd":"npm install eslint-config-txo-typescript","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-txo-typescript","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-txo-typescript","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core ESLint functionality; required for any ESLint configuration.","package":"eslint","optional":false},{"reason":"Required for TypeScript specific linting rules and parsing.","package":"typescript","optional":false},{"reason":"Provides TypeScript-specific ESLint rules.","package":"@typescript-eslint/eslint-plugin","optional":false},{"reason":"Required to parse TypeScript code for ESLint.","package":"@typescript-eslint/parser","optional":false}],"imports":[{"note":"ESLint configurations are extended in `.eslintrc` files, not imported directly into JavaScript/TypeScript code. Ensure `eslint` and relevant `typescript-eslint` packages are also installed.","wrong":"import config from 'eslint-config-txo-typescript'","symbol":"ESLint Configuration","correct":"{ \"extends\": \"eslint-config-txo-typescript\" }"},{"note":"While this configuration bundles many rules, individual rules are not exposed for direct import from the package. Customize or override rules within your `.eslintrc` file using the `rules` property or by extending other configurations.","wrong":"import { ruleName } from 'eslint-config-txo-typescript/rules'","symbol":"Specific Rules","correct":"{ \"extends\": [\"eslint-config-txo-typescript\", \"./custom-rules.js\"] }"},{"note":"For rules that require type information, `parserOptions.project` must point to your `tsconfig.json` file. `tsconfigRootDir` is crucial for ESLint to correctly resolve the `tsconfig.json` path, especially in monorepos or complex project structures.","wrong":"{ \"parserOptions\": { \"project\": true } }","symbol":"TypeScript Project Settings","correct":"{\n  \"extends\": \"eslint-config-txo-typescript\",\n  \"parserOptions\": {\n    \"project\": \"./tsconfig.json\",\n    \"tsconfigRootDir\": __dirname\n  }\n}"}],"quickstart":{"code":"{\n  \"root\": true,\n  \"env\": {\n    \"node\": true\n  },\n  \"parser\": \"@typescript-eslint/parser\",\n  \"parserOptions\": {\n    \"project\": \"./tsconfig.json\",\n    \"tsconfigRootDir\": __dirname,\n    \"ecmaVersion\": 2022,\n    \"sourceType\": \"module\"\n  },\n  \"extends\": \"eslint-config-txo-typescript\",\n  \"rules\": {\n    // Override or add custom rules here if needed\n    \"no-console\": \"warn\",\n    \"@typescript-eslint/explicit-function-return-type\": \"off\"\n  }\n}\n","lang":"json","description":"This quickstart demonstrates a basic `.eslintrc.json` file to extend the `eslint-config-txo-typescript` configuration. It sets up the TypeScript parser and explicitly defines `parserOptions` for project-wide type-aware linting, which is crucial for many advanced TypeScript rules. It also includes an example of how to override or add specific rules."},"warnings":[{"fix":"Consult the changelog for `eslint-config-txo-typescript` and `typescript-eslint` before upgrading. Test linting extensively after updates. Adjust rule configurations in your `.eslintrc` if warnings or errors appear.","message":"This configuration frequently updates its dependency on `typescript-eslint`. New major versions of `typescript-eslint` often introduce breaking changes to rules or require updated configuration settings. Always review the `typescript-eslint` changelog when upgrading `eslint-config-txo-typescript` across minor or major versions.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Upgrade your Node.js environment to version 18 or newer using a tool like nvm (Node Version Manager): `nvm install 18 && nvm use 18`.","message":"This package requires Node.js version 18 or higher. Using an older Node.js version will result in installation failures or runtime errors.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Ensure `parserOptions.project` points to your project's `tsconfig.json` (e.g., `./tsconfig.json`) and `parserOptions.tsconfigRootDir` is set to `__dirname` or the root directory of your project.","message":"For TypeScript-aware rules to function correctly, `parserOptions.project` and `parserOptions.tsconfigRootDir` must be correctly configured in your `.eslintrc` file. Incorrect paths can lead to rules not being applied or parsing errors.","severity":"gotcha","affected_versions":">=7.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Verify that `parserOptions.project` in your `.eslintrc` correctly points to your `tsconfig.json` and that `parserOptions.tsconfigRootDir` is set to `__dirname`.","cause":"This error typically occurs when type-aware rules are enabled, but ESLint cannot find or correctly parse your TypeScript project configuration (`tsconfig.json`).","error":"ESLint: Configuration for rule \"@typescript-eslint/no-floating-promises\" is invalid:"},{"fix":"Ensure `@typescript-eslint/parser` is installed as a `devDependency`: `npm install --save-dev @typescript-eslint/parser` or `yarn add --dev @typescript-eslint/parser`. Check your ESLint configuration for correct parser path if it's explicitly set.","cause":"The `@typescript-eslint/parser` package is either not installed or ESLint cannot resolve its path.","error":"Parsing error: Cannot find module '@typescript-eslint/parser' or its corresponding type declarations."},{"fix":"Add appropriate environments to your `.eslintrc` (e.g., `\"env\": { \"node\": true, \"jest\": true }`) or ensure the variable is imported from a module. If using custom globals, declare them in the `globals` section.","cause":"This error often indicates that global variables or environments (like Node.js, browser, Jest) are not properly declared in your ESLint configuration, or the variable is not imported.","error":"ESLint: '...' is not defined. (no-undef)"}],"ecosystem":"npm"}