{"id":10815,"library":"eslint-config-cheminfo-typescript","title":"Cheminfo ESLint TypeScript Configuration","description":"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.","status":"active","version":"22.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/cheminfo/eslint-config-cheminfo-typescript","tags":["javascript"],"install":[{"cmd":"npm install eslint-config-cheminfo-typescript","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-cheminfo-typescript","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-cheminfo-typescript","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core ESLint engine, required to run the configuration.","package":"eslint","optional":false},{"reason":"TypeScript compiler, essential for TypeScript-specific ESLint rules.","package":"typescript","optional":false}],"imports":[{"note":"This config is designed for ESM and ESLint's flat config. `require` is generally not supported for direct import.","wrong":"const cheminfo = require('eslint-config-cheminfo-typescript');","symbol":"cheminfo","correct":"import cheminfo from 'eslint-config-cheminfo-typescript';"},{"note":"Specific sub-configurations are imported via direct path, not as named exports from the main package.","wrong":"import { base } from 'eslint-config-cheminfo-typescript';","symbol":"cheminfo.base","correct":"import cheminfoBase from 'eslint-config-cheminfo-typescript/base';"},{"note":"ESLint's `defineConfig` utility is a named export from `eslint/config` and is crucial for proper flat config setup.","wrong":"import defineConfig from 'eslint/config';","symbol":"defineConfig","correct":"import { defineConfig } from 'eslint/config';"}],"quickstart":{"code":"import { defineConfig } from 'eslint/config';\nimport cheminfo from 'eslint-config-cheminfo-typescript';\n\nexport default defineConfig(\n  // Apply the base Cheminfo TypeScript config\n  cheminfo,\n  {\n    // Example: Override or add project-specific rules\n    rules: {\n      'no-console': 'warn',\n      'prefer-const': 'error'\n    },\n    // Example: Target specific files\n    files: ['src/**/*.ts', 'test/**/*.ts'],\n    // Example: Configure parser options for specific environments\n    languageOptions: {\n      parserOptions: {\n        project: './tsconfig.json'\n      }\n    }\n  }\n);","lang":"typescript","description":"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."},"warnings":[{"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.","message":"All configurations now strictly require the ESLint Flat Config format. Traditional `.eslintrc.*` files are no longer supported.","severity":"breaking","affected_versions":">=17.0.0"},{"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`).","message":"The package frequently updates its peer dependency for `eslint`. Ensure your `eslint` version meets the minimum requirement specified in `peerDependencies` to avoid compatibility issues.","severity":"breaking","affected_versions":">=21.0.0"},{"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.","message":"Major 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.","severity":"breaking","affected_versions":">=17.0.0"},{"fix":"Ensure `typescript` is installed (`npm i -D typescript`) and your `eslint.config.mjs`'s `languageOptions.parserOptions.project` points to your `tsconfig.json`.","message":"The configuration relies on `typescript` being installed and correctly configured in your project's `tsconfig.json` for type-aware linting rules to function.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Examine the `eslint-config-cheminfo` v18 release notes for specific changes. Address any newly reported linting issues in your codebase.","message":"Version 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.","severity":"breaking","affected_versions":">=22.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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';`.","cause":"ESLint cannot find the configuration package because it's either not installed or the import path is incorrect.","error":"Error: Failed to load config \"cheminfo-typescript\" to extend from. Referenced from: ..."},{"fix":"Verify `typescript` is installed and that your `eslint.config.mjs` includes `languageOptions: { parserOptions: { project: './tsconfig.json' } }` correctly configured for your project.","cause":"This error often occurs when `eslint-plugin-typescript` (or related plugins) cannot find the TypeScript parser or `tsconfig.json`.","error":"ESLint: Cannot read properties of undefined (reading 'eslint') TypeError: Cannot read properties of undefined (reading 'eslint')"},{"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.","cause":"ESLint is unable to parse or find the configuration file, possibly due to incorrect file extension, syntax errors, or module type issues.","error":"ESLint: Cannot read config file: ...eslint.config.mjs"},{"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.","cause":"A common conflict or deprecation when using TypeScript ESLint plugins, where the base ESLint rule is replaced by a type-aware version.","error":"ESLint: Rule 'no-redeclare' was removed and replaced by 'no-redeclare' in @typescript-eslint/eslint-plugin."}],"ecosystem":"npm"}