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.
npm install eslint-config-txo-typescriptVerified import paths — ran on the pinned version, not inferred.
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.
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.
Upgrade your Node.js environment to version 18 or newer using a tool like nvm (Node Version Manager): `nvm install 18 && nvm use 18`.
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.
Verify that `parserOptions.project` in your `.eslintrc` correctly points to your `tsconfig.json` and that `parserOptions.tsconfigRootDir` is set to `__dirname`.
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.
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.