{"id":13137,"library":"eslint-config-signavio-test","title":"ESLint Config Signavio Test","description":"eslint-config-signavio-test is a shareable ESLint configuration package designed to extend `eslint-config-signavio`. Its primary purpose is to provide specific rule adjustments tailored for JavaScript and TypeScript test environments, optimizing linting within testing setups. This typically involves relaxing certain rules that might be overly strict for test files (e.g., `no-unused-expressions` for assertion libraries) or enforcing best practices relevant to testing frameworks. As an extension, it relies on and builds upon the rules defined in its base configuration. Version 2.0.0 is the current stable release, indicating active maintenance likely aligned with Signavio's internal development cycles and updates to ESLint or the base config. Its key differentiator is its specialization for test code, which helps reduce noise and false positives often encountered when applying general linting rules universally.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/signavio/eslint-config-signavio-test","tags":["javascript","eslint","eslintconfig","config","signavio","styleguide"],"install":[{"cmd":"npm install eslint-config-signavio-test","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-signavio-test","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-signavio-test","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for any ESLint configuration package to function. Ensures compatibility with the host ESLint version.","package":"eslint","optional":false},{"reason":"This package extends `eslint-config-signavio`, making it a mandatory peer dependency for its rules to be inherited and overridden.","package":"eslint-config-signavio","optional":false}],"imports":[{"note":"ESLint configurations are not imported as JavaScript modules; they are referenced by name in the `extends` array of an ESLint configuration file (e.g., `.eslintrc.json`, `eslint.config.js`). The 'eslint-config-' prefix is automatically resolved by ESLint.","wrong":"import config from 'eslint-config-signavio-test';","symbol":"extends configuration in .eslintrc","correct":"{ \"extends\": [\"signavio-test\"] }"},{"note":"For ESLint's new flat configuration format (ESLint v9+), the configuration package is imported as a module. If the package exports an array of configurations, it can be directly included. CommonJS-style `module.exports` or string `extends` are for legacy `.eslintrc` files.","wrong":"module.exports = { extends: ['signavio-test'] }; // For flat config, use ESM import or CommonJS require of the config module directly","symbol":"extends configuration with flat config (ESLint v9+)","correct":"// eslint.config.js\nimport signavioTestConfig from 'eslint-config-signavio-test';\n\nexport default [\n  signavioTestConfig,\n  // other configs\n];"},{"note":"To apply test-specific rules only to test files and avoid conflicts with the base config on non-test files, use ESLint's `overrides` feature. This ensures `eslint-config-signavio-test` is active only for matching file patterns.","wrong":"{ \"extends\": [\"signavio\", \"signavio-test\"] }","symbol":"Specific rules for test files via `overrides`","correct":"{\n  \"extends\": [\"signavio\"],\n  \"overrides\": [\n    {\n      \"files\": [\"**/*.test.js\", \"**/*.spec.js\"],\n      \"extends\": [\"signavio-test\"]\n    }\n  ]\n}"}],"quickstart":{"code":"// .eslintrc.cjs (for CommonJS projects, or .eslintrc.js for ESM projects if 'type: module' in package.json)\n// This example assumes you have 'eslint-config-signavio' also installed and configured.\n// For ESLint v9+ flat config, the syntax would differ (see imports).\n\nmodule.exports = {\n  // Extend the base Signavio configuration for general project files\n  extends: [\n    'signavio'\n  ],\n  // Apply specific rules for test files\n  overrides: [\n    {\n      files: [\n        '**/*.test.js',\n        '**/*.spec.js',\n        '**/__tests__/**/*',\n        '**/*.test.ts',\n        '**/*.spec.ts',\n        '**/__tests__/**/*.ts',\n        '**/*.test.tsx',\n        '**/*.spec.tsx',\n        '**/__tests__/**/*.tsx'\n      ],\n      extends: [\n        'signavio-test'\n      ],\n      // Optional: Add specific parser or plugins if your tests use unique syntaxes (e.g., Jest, Cypress)\n      // parserOptions: {\n      //   ecmaVersion: 2020,\n      //   sourceType: 'module',\n      // },\n      // env: {\n      //   jest: true,\n      //   node: true,\n      //   browser: true,\n      // },\n      // rules: {\n      //   // Example: Relax 'no-unused-expressions' for Chai/expect assertions\n      //   'no-unused-expressions': 'off',\n      // },\n    }\n  ],\n  // Other global configurations can go here\n  parserOptions: {\n    ecmaVersion: 2020,\n    sourceType: 'module',\n  },\n  env: {\n    browser: true,\n    node: true,\n  },\n};\n","lang":"javascript","description":"Illustrates how to integrate `eslint-config-signavio-test` into an `.eslintrc.cjs` (or `.js`) file using the `overrides` property to apply test-specific rules only to relevant files, extending a base `signavio` configuration."},"warnings":[{"fix":"For ESLint v9+, migrate your project to use `eslint.config.js` and import the configuration directly as an ESM module, potentially using `@eslint/eslintrc` for compatibility with older configs. Consult ESLint's migration guide and the package's documentation for specific guidance.","message":"Major version updates of ESLint (e.g., ESLint v8 to v9) introduce breaking changes, notably the shift from `.eslintrc.*` to flat configuration files (`eslint.config.js`). This package's usage pattern will change significantly with ESLint v9+.","severity":"breaking","affected_versions":">=2.0.0 (if used with ESLint <9)"},{"fix":"Ensure `eslint` and `eslint-config-signavio` are installed at versions compatible with `eslint-config-signavio-test`. Use `npm install --legacy-peer-deps` (as a last resort) or explicitly install the correct versions: `npm install eslint@<version> eslint-config-signavio@<version>`.","message":"Peer dependency conflicts can occur if the installed `eslint` or `eslint-config-signavio` versions do not match the ranges specified by `eslint-config-signavio-test`. This often leads to `UNMET PEER DEPENDENCY` warnings or runtime errors.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Regularly review the changelogs of `eslint-config-signavio` and `eslint-config-signavio-test` when updating. Use ESLint's `--print-config` command to inspect the resolved configuration for test files and identify any unintended rule conflicts.","message":"Updates to `eslint-config-signavio` (the base configuration) can introduce new rules or modify existing ones that might conflict with or override the test-specific tweaks in `eslint-config-signavio-test`. These changes might require adjustments in your project's configuration.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always use the `overrides` property in your `.eslintrc.*` file (or `files` in flat config) to target `eslint-config-signavio-test` specifically at your test file patterns (e.g., `**/*.test.js`, `**/__tests__/**/*`).","message":"Incorrectly applying `eslint-config-signavio-test` globally instead of using `overrides` for test files can lead to overly strict linting errors in non-test code or prevent desired rules from applying in test files.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Install `eslint-config-signavio` as a peer dependency: `npm install --save-dev eslint-config-signavio`.","cause":"The `eslint-config-signavio` package is either not installed or ESLint cannot resolve its path.","error":"ESLint: Cannot find module 'eslint-config-signavio'"},{"fix":"Ensure all necessary ESLint plugins (e.g., `@typescript-eslint/eslint-plugin`, `eslint-plugin-jest`) are installed and listed in the `plugins` array of your `.eslintrc.*`.","cause":"This error typically means a plugin providing the rule (e.g., `@typescript-eslint/eslint-plugin`) is missing or not correctly configured in your `.eslintrc.*` file. Shared configs often rely on specific plugins.","error":"ESLint: Definition for rule '@typescript-eslint/no-unused-expressions' was not found"},{"fix":"Carefully examine the `ERESOLVE` output for the conflicting packages and their required versions. Try installing specific compatible versions (e.g., `npm install eslint@<version>`). `npm install --force` or `npm install --legacy-peer-deps` can bypass this but might lead to runtime issues.","cause":"This often indicates a peer dependency conflict, where a package (like this config) requires a specific range of `eslint` or its base config, but your project has a conflicting version installed.","error":"npm ERR! ERESOLVE unable to resolve dependency tree"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}