eslint-config-agent 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. See [Conven
4
4
 
5
5
 
6
6
 
7
+ ## [1.7.3](https://github.com/tupe12334/eslint-config/compare/v1.7.2...v1.7.3) (2025-11-11)
8
+
9
+ ### Features
10
+
11
+ * **ddd:** enable spec file requirement by default for all source files ([f06b965](https://github.com/tupe12334/eslint-config/commit/f06b96563da10ed2d5aaaae2fe35e1ce87f1aae5))
12
+
7
13
  ## [1.7.2](https://github.com/tupe12334/eslint-config/compare/v1.7.1...v1.7.2) (2025-11-10)
8
14
 
9
15
  ### Features
package/README.md CHANGED
@@ -48,6 +48,7 @@ This configuration enforces patterns that:
48
48
  - **⚛️ React & Preact**: Complete support for both React and Preact projects
49
49
  - **🔐 Strict Standards**: Enforces explicit null/undefined checks, disallows optional chaining and nullish coalescing for better code clarity
50
50
  - **📏 Code Quality**: Function length limits (100 lines), trailing space detection, and consistent formatting
51
+ - **🧪 DDD by Default**: Requires spec files for all source files to ensure comprehensive test coverage
51
52
  - **🚀 Modern ESLint**: Uses the latest flat configuration format (ESLint 9+)
52
53
  - **📋 Comprehensive Testing**: 12+ test categories with automated validation
53
54
  - **🔄 CI/CD Ready**: Zero-warning configuration for production builds
@@ -223,6 +224,51 @@ This ESLint configuration prioritizes **explicit code** over convenient shortcut
223
224
  - Compatible with Preact-specific patterns and optimizations
224
225
  - Shared configuration with React rules where applicable
225
226
 
227
+ ### Spec File Requirements (DDD)
228
+
229
+ **By default, this configuration requires that every source file has a corresponding spec file.** This ensures comprehensive test coverage and encourages test-driven development.
230
+
231
+ **What files require specs:**
232
+ - All TypeScript/JavaScript source files (`.ts`, `.js`, `.tsx`, `.jsx`)
233
+ - Implementation files that contain business logic
234
+
235
+ **What files are excluded:**
236
+ - Test files themselves (`.spec.ts`, `.test.js`, etc.)
237
+ - Configuration files (`.config.js`, `eslint.config.js`, etc.)
238
+ - Index/barrel files (`index.ts`, `index.js`)
239
+ - Type definition files (`.d.ts`)
240
+ - Storybook files (`.stories.tsx`)
241
+ - Example files in `examples/` directories
242
+
243
+ **Example structure:**
244
+ ```
245
+ src/
246
+ ├── utils.ts # Requires: utils.spec.ts
247
+ ├── utils.spec.ts # ✅ Spec file present
248
+ ├── components/
249
+ │ ├── Button.tsx # Requires: Button.spec.tsx
250
+ │ ├── Button.spec.tsx # ✅ Spec file present
251
+ │ └── index.ts # ⚠️ Excluded (index file)
252
+ └── config.ts # ⚠️ Excluded (config file)
253
+ ```
254
+
255
+ **Disabling for specific files:**
256
+ If you need to disable this requirement for specific files, you can add an override in your `eslint.config.js`:
257
+
258
+ ```javascript
259
+ import baseConfig from "eslint-config-agent";
260
+
261
+ export default [
262
+ ...baseConfig,
263
+ {
264
+ files: ["src/legacy/**/*.ts"],
265
+ rules: {
266
+ "ddd/require-spec-file": "off",
267
+ },
268
+ },
269
+ ];
270
+ ```
271
+
226
272
  ### Configuration Philosophy
227
273
 
228
274
  This configuration focuses on enforcing patterns that improve long-term maintainability while reducing noise from less impactful rules. The ruleset is carefully curated to balance developer productivity with code quality.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Base Plugin Configurations
3
3
  *
4
- * Applies strict configs from error and default plugins.
4
+ * Applies strict configs from error, default, and ddd plugins.
5
5
  * These apply globally to all file types.
6
6
  */
7
7
 
@@ -16,4 +16,40 @@ export const basePluginsConfig = [
16
16
  },
17
17
  // Default plugin strict config
18
18
  plugins.default.configs.strict,
19
+ // DDD plugin - require spec files for all source files
20
+ {
21
+ rules: {
22
+ "ddd/require-spec-file": ["error", {
23
+ excludePatterns: [
24
+ "**/*.spec.js",
25
+ "**/*.spec.ts",
26
+ "**/*.test.js",
27
+ "**/*.test.ts",
28
+ "**/index.js",
29
+ "**/index.ts",
30
+ "**/*.d.ts",
31
+ "**/*.config.js",
32
+ "**/*.config.ts",
33
+ "**/eslint.config.js",
34
+ "**/*.stories.{js,jsx,ts,tsx}",
35
+ ],
36
+ }],
37
+ },
38
+ },
39
+ // Disable DDD for config infrastructure files
40
+ {
41
+ files: [
42
+ "configs/**/*.js",
43
+ "plugins/**/*.js",
44
+ "exports/**/*.js",
45
+ "scripts/**/*.js",
46
+ "rules/**/examples/**/*",
47
+ "rules/**/*.spec.js",
48
+ "rules/**/*.spec.ts",
49
+ "test/**/*",
50
+ ],
51
+ rules: {
52
+ "ddd/require-spec-file": "off",
53
+ },
54
+ },
19
55
  ];
package/exports/ddd.js CHANGED
@@ -1,29 +1,15 @@
1
- import config from "../index.js";
2
- import { plugins } from "../plugins/index.js";
1
+ /**
2
+ * DDD Configuration Export
3
+ *
4
+ * NOTE: As of the latest version, DDD rules (require-spec-file) are now
5
+ * included in the base configuration by default. This export is maintained
6
+ * for backward compatibility and is currently equivalent to the base config.
7
+ *
8
+ * You can use either:
9
+ * - import config from "eslint-config-agent" (includes DDD rules)
10
+ * - import config from "eslint-config-agent/ddd" (same as above)
11
+ */
3
12
 
4
- const dddConfig = [
5
- {
6
- plugins: {
7
- ddd: plugins.ddd,
8
- },
9
- rules: {
10
- "ddd/require-spec-file": ["error", {
11
- excludePatterns: [
12
- "**/*.spec.js",
13
- "**/*.spec.ts",
14
- "**/*.test.js",
15
- "**/*.test.ts",
16
- "**/index.js",
17
- "**/index.ts",
18
- "**/*.d.ts",
19
- "**/*.config.js",
20
- "**/*.config.ts",
21
- "**/eslint.config.js",
22
- "**/*.stories.{js,jsx,ts,tsx}",
23
- ],
24
- }],
25
- },
26
- },
27
- ];
13
+ import config from "../index.js";
28
14
 
29
- export default [...config, ...dddConfig];
15
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-agent",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "ESLint configuration package with TypeScript support",
5
5
  "main": "index.js",
6
6
  "type": "module",