Registry / testing / eslint-config-txo-typescript

eslint-config-txo-typescript

JSON →
library7.4.114jsnpmunverified

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-typescript
INSTALL
IMPORT
SIG · ESLINT-CONFIG-TXO-
E
eslint-config-txo-typescript
testingjavascriptv7.4.114
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESLint Configuration
{ "extends": "eslint-config-txo-typescript" }
import config from 'eslint-config-txo-typescript'
ESLint configurations are extended in `.eslintrc` files, not imported directly into JavaScript/TypeScript code. Ensure `eslint` and relevant `typescript-eslint` packages are also installed.
Specific Rules
{ "extends": ["eslint-config-txo-typescript", "./custom-rules.js"] }
import { ruleName } from 'eslint-config-txo-typescript/rules'
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.
TypeScript Project Settings
{ "extends": "eslint-config-txo-typescript", "parserOptions": { "project": "./tsconfig.json", "tsconfigRootDir": __dirname } }
{ "parserOptions": { "project": true } }
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.

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.

{ "root": true, "env": { "node": true }, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "./tsconfig.json", "tsconfigRootDir": __dirname, "ecmaVersion": 2022, "sourceType": "module" }, "extends": "eslint-config-txo-typescript", "rules": { // Override or add custom rules here if needed "no-console": "warn", "@typescript-eslint/explicit-function-return-type": "off" } }
Debug
Known issues
breakingThis 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.
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.
affects: >=7.0.0
gotchaThis package requires Node.js version 18 or higher. Using an older Node.js version will result in installation failures or runtime errors.
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`.
affects: >=7.0.0
gotchaFor 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.
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.
affects: >=7.0.0
Errors
Common errors & fixes
ESLint: Configuration for rule "@typescript-eslint/no-floating-promises" is invalid:
This error typically occurs when type-aware rules are enabled, but ESLint cannot find or correctly parse your TypeScript project configuration (`tsconfig.json`).
fix
Verify that `parserOptions.project` in your `.eslintrc` correctly points to your `tsconfig.json` and that `parserOptions.tsconfigRootDir` is set to `__dirname`.
Parsing error: Cannot find module '@typescript-eslint/parser' or its corresponding type declarations.
The `@typescript-eslint/parser` package is either not installed or ESLint cannot resolve its path.
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.
ESLint: '...' is not defined. (no-undef)
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.
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.
Upgrade
Version history
7.4.114latest on npm
Audit
Dependencies
eslintrequiredCore ESLint functionality; required for any ESLint configuration.
typescriptrequiredRequired for TypeScript specific linting rules and parsing.
@typescript-eslint/eslint-pluginrequiredProvides TypeScript-specific ESLint rules.
@typescript-eslint/parserrequiredRequired to parse TypeScript code for ESLint.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-config-txo-typescript — npm install eslint-config-txo-typescript · libregistry