Registry / testing / eslint-config-cheminfo-typescript

eslint-config-cheminfo-typescript

JSON →
library22.0.0jsnpmunverified

This package provides a shared ESLint configuration specifically tailored for TypeScript projects within the Cheminfo ecosystem. It aims to enforce consistent coding styles and best practices across various repositories. Currently at version 22.0.0, the configuration is actively maintained with a relatively frequent release cadence, often aligning with updates to its base JavaScript configuration (`eslint-config-cheminfo`), ESLint itself, and various ESLint plugins. A key differentiator is its strict adherence to the ESLint Flat Config format, moving away from legacy configurations and embracing modern ESLint practices. It builds upon a robust base JS config and integrates plugins for JSDoc, Unicorn, and Vitest, offering a comprehensive and opinionated linting solution for TypeScript development.

npm install eslint-config-cheminfo-typescript
INSTALL
IMPORT
SIG · ESLINT-CONFIG-CHEM
E
eslint-config-cheminfo-typescript
testingjavascriptv22.0.0
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.

cheminfo
import cheminfo from 'eslint-config-cheminfo-typescript';
const cheminfo = require('eslint-config-cheminfo-typescript');
This config is designed for ESM and ESLint's flat config. `require` is generally not supported for direct import.
cheminfo.base
import cheminfoBase from 'eslint-config-cheminfo-typescript/base';
import { base } from 'eslint-config-cheminfo-typescript';
Specific sub-configurations are imported via direct path, not as named exports from the main package.
defineConfig
import { defineConfig } from 'eslint/config';
import defineConfig from 'eslint/config';
ESLint's `defineConfig` utility is a named export from `eslint/config` and is crucial for proper flat config setup.

This quickstart demonstrates how to set up `eslint-config-cheminfo-typescript` in an `eslint.config.mjs` file, importing the default configuration and showing how to extend or override rules for a specific project.

import { defineConfig } from 'eslint/config'; import cheminfo from 'eslint-config-cheminfo-typescript'; export default defineConfig( // Apply the base Cheminfo TypeScript config cheminfo, { // Example: Override or add project-specific rules rules: { 'no-console': 'warn', 'prefer-const': 'error' }, // Example: Target specific files files: ['src/**/*.ts', 'test/**/*.ts'], // Example: Configure parser options for specific environments languageOptions: { parserOptions: { project: './tsconfig.json' } } } );
Debug
Known issues
breakingAll configurations now strictly require the ESLint Flat Config format. Traditional `.eslintrc.*` files are no longer supported.
fix
Migrate your ESLint setup to use `eslint.config.mjs` (or `.js` with `type: 'module'`) and follow the flat config migration guide linked in the package README.
affects: >=17.0.0
breakingThe package frequently updates its peer dependency for `eslint`. Ensure your `eslint` version meets the minimum requirement specified in `peerDependencies` to avoid compatibility issues.
fix
Update your `eslint` package to the version specified in the `peerDependencies` of `eslint-config-cheminfo-typescript` (e.g., `npm i -D eslint@^9.39.1`).
affects: >=21.0.0
breakingMajor versions often introduce breaking changes by updating the base JavaScript config, underlying ESLint plugins, or ESLint itself, leading to new rules or changes in existing ones.
fix
Review the release notes for each major version update. Run ESLint after updating and address any new errors or warnings. Consider using an ESLint `--fix` dry run first.
affects: >=17.0.0
gotchaThe configuration relies on `typescript` being installed and correctly configured in your project's `tsconfig.json` for type-aware linting rules to function.
fix
Ensure `typescript` is installed (`npm i -D typescript`) and your `eslint.config.mjs`'s `languageOptions.parserOptions.project` points to your `tsconfig.json`.
affects: >=1.0.0
breakingVersion 22.0.0 specifically updates the base config to v18, which may introduce new linting rules or modify existing rule severities inherited from the JavaScript base configuration.
fix
Examine the `eslint-config-cheminfo` v18 release notes for specific changes. Address any newly reported linting issues in your codebase.
affects: >=22.0.0
Errors
Common errors & fixes
Error: Failed to load config "cheminfo-typescript" to extend from. Referenced from: ...
ESLint cannot find the configuration package because it's either not installed or the import path is incorrect.
fix
Ensure `eslint-config-cheminfo-typescript` is installed (`npm i -D eslint-config-cheminfo-typescript`) and the import path in `eslint.config.mjs` is `import cheminfo from 'eslint-config-cheminfo-typescript';`.
ESLint: Cannot read properties of undefined (reading 'eslint') TypeError: Cannot read properties of undefined (reading 'eslint')
This error often occurs when `eslint-plugin-typescript` (or related plugins) cannot find the TypeScript parser or `tsconfig.json`.
fix
Verify `typescript` is installed and that your `eslint.config.mjs` includes `languageOptions: { parserOptions: { project: './tsconfig.json' } }` correctly configured for your project.
ESLint: Cannot read config file: ...eslint.config.mjs
ESLint is unable to parse or find the configuration file, possibly due to incorrect file extension, syntax errors, or module type issues.
fix
Ensure your config file is named `eslint.config.mjs` (or `.js` with `"type": "module"` in `package.json`), contains valid JavaScript/ESM syntax, and is accessible to ESLint.
ESLint: Rule 'no-redeclare' was removed and replaced by 'no-redeclare' in @typescript-eslint/eslint-plugin.
A common conflict or deprecation when using TypeScript ESLint plugins, where the base ESLint rule is replaced by a type-aware version.
fix
This specific rule was fixed in v21.0.1. If on an older version, update the package. Otherwise, ensure no custom rules conflict by re-enabling `@typescript-eslint/no-redeclare` if needed, or remove the rule entirely if it's implicitly handled.
Upgrade
Version history
22.0.0latest on npm
Audit
Dependencies
eslintrequiredCore ESLint engine, required to run the configuration.
typescriptrequiredTypeScript compiler, essential for TypeScript-specific ESLint rules.
Agent activity
2 hits · last 30 days
node
2
Resources