eslint-config-agent 1.0.5

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.
@@ -0,0 +1,24 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(pnpm init:*)",
5
+ "Bash(pnpm add:*)",
6
+ "Bash(pnpm validate:*)",
7
+ "Bash(pnpm lint:*)",
8
+ "Bash(pnpm eslint:*)",
9
+ "Bash(cat:*)",
10
+ "WebSearch",
11
+ "Bash(pnpm test:*)",
12
+ "Bash(npm config get:*)",
13
+ "Bash(pnpm release:patch:*)",
14
+ "Bash(git add:*)",
15
+ "Bash(git commit:*)",
16
+ "Bash(pnpm remove:*)",
17
+ "Bash(node:*)",
18
+ "Bash(npx eslint:*)",
19
+ "Bash(npx @typescript-eslint/parser:*)"
20
+ ],
21
+ "deny": [],
22
+ "ask": []
23
+ }
24
+ }
package/.env.example ADDED
@@ -0,0 +1,5 @@
1
+ # Environment variables for ESLint Config package
2
+
3
+ # NPM Token for publishing packages
4
+ # Get this from https://www.npmjs.com/settings/tokens
5
+ NPM_TOKEN=your_npm_token_here
@@ -0,0 +1,39 @@
1
+ {
2
+ "git": {
3
+ "commit": true,
4
+ "commitMessage": "Release v${version}",
5
+ "tag": true,
6
+ "tagName": "v${version}",
7
+ "push": true,
8
+ "requireCleanWorkingDir": true,
9
+ "requireUpstream": false
10
+ },
11
+ "npm": {
12
+ "publish": true,
13
+ "publishPath": ".",
14
+ "access": "public",
15
+ "token": "${NPM_TOKEN}",
16
+ "otp": false
17
+ },
18
+ "github": {
19
+ "release": true
20
+ },
21
+ "hooks": {
22
+ "before:init": ["pnpm validate", "pnpm test:ci"],
23
+ "before:npm:publish": "echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc && npm config set access public",
24
+ "after:npm:publish": "rm -f .npmrc",
25
+ "after:bump": "echo 'Version bumped to ${version}'"
26
+ },
27
+ "plugins": {
28
+ "@release-it/conventional-changelog": {
29
+ "preset": "conventionalcommits",
30
+ "infile": "CHANGELOG.md",
31
+ "header": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n"
32
+ }
33
+ },
34
+ "prompt": {
35
+ "ghRelease": false,
36
+ "glRelease": false,
37
+ "publish": true
38
+ }
39
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,45 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
+
5
+
6
+
7
+ ## [1.0.5](https://github.com/tupe12334/eslint-config/compare/v1.0.4...v1.0.5) (2025-08-29)
8
+
9
+ ### Features
10
+
11
+ * enhance documentation with additional commands for release management and testing guidelines ([4cc298d](https://github.com/tupe12334/eslint-config/commit/4cc298d195edfee31dfd3ec2dc2e5343707dae35))
12
+ * update ESLint rules for type assertions and enhance test coverage for invalid usage ([f53b9d6](https://github.com/tupe12334/eslint-config/commit/f53b9d6ca40f949e073d6eb08e70ec6ad0117518))
13
+ * update ESLint rules to disallow optional chaining syntax in member and call expressions ([6b9ab7b](https://github.com/tupe12334/eslint-config/commit/6b9ab7bdae7b8608a19e2f888c72af18382f66da))
14
+
15
+ ## [1.0.4](https://github.com/tupe12334/eslint-config/compare/v1.0.3...v1.0.4) (2025-08-29)
16
+
17
+ ### Features
18
+
19
+ * add ESLint rules to disallow Record with string literal keys and create corresponding test cases ([98189f2](https://github.com/tupe12334/eslint-config/commit/98189f26ef78a1cf0fc89bcf47848d8761b8a5e9))
20
+ * add tests for new union type rule to validate correct usage and trigger errors ([7936470](https://github.com/tupe12334/eslint-config/commit/7936470d10003dab6353650038e5b02e9e79b657))
21
+
22
+ ## [1.0.3](https://github.com/tupe12334/eslint-config/compare/v1.0.2...v1.0.3) (2025-08-29)
23
+
24
+ ### Features
25
+
26
+ * add initial ESLint configuration with permissions for various commands ([d7613aa](https://github.com/tupe12334/eslint-config/commit/d7613aa115b04e3aa45e6707dea350f9ec8b1678))
27
+ * add permission for npx @typescript-eslint/parser command in settings ([1b87420](https://github.com/tupe12334/eslint-config/commit/1b87420bddd5fd3894fe34b38a41059b03eb2f5b))
28
+ * add permission for npx eslint command in settings ([77ae39a](https://github.com/tupe12334/eslint-config/commit/77ae39ae84c5d0a186a88acef2cd5aa1e68153bc))
29
+ * enhance TypeScript rules by enforcing no-explicit-any and consistent type assertions ([d2677c6](https://github.com/tupe12334/eslint-config/commit/d2677c6359ea956d36d9e02abcf173131c49f437))
30
+ * remove settings.local.json and add it to .gitignore ([553a861](https://github.com/tupe12334/eslint-config/commit/553a861644ce81689400920892ea7eb64822703d))
31
+
32
+ ## [1.0.2](https://github.com/tupe12334/eslint-config/compare/v1.0.1...v1.0.2) (2025-08-25)
33
+
34
+ ### Features
35
+
36
+ * enhance ESLint configuration with optional preact plugin and update peer dependencies ([09f63d5](https://github.com/tupe12334/eslint-config/commit/09f63d5249c8c6f6832668b926b5c1b81d6d8144))
37
+
38
+ ## 1.0.1 (2025-08-25)
39
+
40
+ ### Features
41
+
42
+ * **settings:** add permission for pnpm release command in settings ([3c14b7a](https://github.com/tupe12334/eslint-config/commit/3c14b7a8b2da8461bcee7ba7eeb0811cb9f995d5))
43
+ * **setup:** add environment setup instructions and example file for publishing ([a1342f1](https://github.com/tupe12334/eslint-config/commit/a1342f19849b91b9d2579e0e657e9fe624dac156))
44
+ * **setup:** update NPM token instructions and add hooks for .npmrc management ([e78e9bb](https://github.com/tupe12334/eslint-config/commit/e78e9bb5a6ab5d9e21edd852b33ea6f077623387))
45
+ * **tests:** add comprehensive ESLint configuration test runner ([86ee8d4](https://github.com/tupe12334/eslint-config/commit/86ee8d4a83c7b620bf3909c368ba8f8926726c15))
package/CLAUDE.md ADDED
@@ -0,0 +1,93 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ This is an ESLint configuration package (`eslint-config-agent`) that provides TypeScript and JavaScript linting rules. The package exports a reusable ESLint configuration that can be consumed by other projects.
8
+
9
+ ## Development Setup
10
+
11
+ The project uses pnpm as the package manager. Dependencies are already installed.
12
+
13
+ ## Common Commands
14
+
15
+ ### Development & Testing
16
+ - `pnpm lint` - Run ESLint on the entire project
17
+ - `pnpm test` - Run comprehensive test suite with categorized validation
18
+ - `pnpm test:valid` - Test valid code samples
19
+ - `pnpm test:invalid` - Test invalid code samples that should trigger errors
20
+ - `pnpm test:hooks` - Test React hooks rules
21
+ - `pnpm test:imports` - Test import/export patterns
22
+ - `pnpm test:edge` - Test edge cases and boundary conditions
23
+ - `pnpm test:performance` - Test large files and complex scenarios
24
+ - `pnpm test:ci` - Run ESLint with zero warnings allowed (used for CI)
25
+ - `pnpm validate` - Run legacy configuration validation
26
+
27
+ ### Release Management
28
+ - `pnpm release` - Interactive release process (recommended)
29
+ - `pnpm release:patch` - Patch version release (1.0.0 → 1.0.1)
30
+ - `pnpm release:minor` - Minor version release (1.0.0 → 1.1.0)
31
+ - `pnpm release:major` - Major version release (1.0.0 → 2.0.0)
32
+ - `pnpm release:dry` - Test release process without publishing
33
+
34
+ ## Architecture
35
+
36
+ The project follows the modern ESLint flat configuration format:
37
+
38
+ - `index.js` - Main configuration export that other projects will consume
39
+ - `eslint.config.js` - Local ESLint configuration for this project itself
40
+ - `test/` - Test files that validate the ESLint rules are working correctly
41
+ - `scripts/validate-config.js` - Validation script that tests the configuration
42
+
43
+ The main export provides separate configurations for:
44
+ - TypeScript/TSX files with React/Preact support
45
+ - JavaScript/JSX files with React/Preact support
46
+ - Node.js scripts with appropriate globals
47
+
48
+ Key features:
49
+ - Disallows optional chaining (`?.`) and nullish coalescing (`??`)
50
+ - Enforces JSX only in `.tsx`/`.jsx` files
51
+ - Limits function length to 100 lines
52
+ - Warns about trailing spaces
53
+ - Supports both React and Preact
54
+
55
+ ## Testing
56
+
57
+ The package includes extensive testing infrastructure with 12+ test files covering different scenarios:
58
+
59
+ **Test Categories:**
60
+ - **Valid Code**: Files that should pass with minimal warnings
61
+ - **Invalid Code**: Files that intentionally trigger specific errors
62
+ - **React Hooks**: Tests for hooks rules (exhaustive-deps, rules-of-hooks)
63
+ - **Import/Export**: Tests for module patterns and import rules
64
+ - **Edge Cases**: Boundary conditions and complex JSX structures
65
+ - **Performance**: Large files and complex components for performance testing
66
+
67
+ **Test Tools:**
68
+ - `scripts/test-runner.js` - Main test runner with categorized validation and statistics
69
+ - `scripts/validate-config.js` - Legacy validator for basic functionality checks
70
+
71
+ **Key Rules Tested:**
72
+ - Nullish coalescing operator (`??`) restriction
73
+ - Optional chaining (`?.`) restriction
74
+ - JSX filename extension enforcement
75
+ - Function length limits
76
+ - Trailing spaces detection
77
+ - React hooks dependency validation
78
+ - Conditional hook usage detection
79
+ - TypeScript type assertion rules (`no-explicit-any`, consistent type assertions)
80
+ - Record type restrictions with string literal keys
81
+ - Union type validation
82
+
83
+ Run `pnpm test` for comprehensive testing or `pnpm validate` for basic validation.
84
+
85
+ ## Release Process
86
+
87
+ This package uses `release-it` with automated version management and changelog generation. Before any release:
88
+
89
+ 1. Ensure all tests pass: `pnpm test:ci` and `pnpm validate`
90
+ 2. Working directory must be clean (all changes committed)
91
+ 3. Use conventional commit messages for better changelog generation
92
+
93
+ The release process automatically handles version bumping, changelog generation, git tagging, and npm publishing. See RELEASING.md for detailed instructions.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # eslint-config-agent
2
+
3
+ A comprehensive ESLint configuration package that provides TypeScript, React, and Preact linting rules with strict coding standards.
4
+
5
+ ## Features
6
+
7
+ - **TypeScript Support**: Full TypeScript ESLint integration
8
+ - **React & Preact**: Complete support for both React and Preact projects
9
+ - **Strict Standards**: Enforces explicit null/undefined checks, disallows optional chaining and nullish coalescing
10
+ - **Code Quality**: Function length limits, trailing space detection, and more
11
+ - **Modern ESLint**: Uses the new flat configuration format
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install --save-dev eslint-config-agent
17
+ # or
18
+ pnpm add -D eslint-config-agent
19
+ # or
20
+ yarn add -D eslint-config-agent
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ Create an `eslint.config.js` file in your project root:
26
+
27
+ ```javascript
28
+ import config from 'eslint-config-agent';
29
+
30
+ export default config;
31
+ ```
32
+
33
+ Or extend it with your own rules:
34
+
35
+ ```javascript
36
+ import baseConfig from 'eslint-config-agent';
37
+
38
+ export default [
39
+ ...baseConfig,
40
+ {
41
+ rules: {
42
+ // Your custom rules here
43
+ },
44
+ },
45
+ ];
46
+ ```
47
+
48
+ ## Rules Overview
49
+
50
+ ### Key Restrictions
51
+ - **No Optional Chaining** (`?.`): Use explicit null/undefined checks instead
52
+ - **No Nullish Coalescing** (`??`): Use explicit null/undefined checks instead
53
+ - **JSX File Extensions**: JSX is only allowed in `.tsx` and `.jsx` files
54
+ - **Function Length**: Functions are limited to 100 lines (warnings)
55
+ - **Trailing Spaces**: Not allowed (warnings)
56
+
57
+ ### Disabled Rules
58
+ This configuration disables many common ESLint and React rules to provide a more flexible development experience while maintaining code quality through specific restrictions.
59
+
60
+ ## Development
61
+
62
+ ### Testing
63
+
64
+ The package includes comprehensive testing to validate the configuration works correctly across various scenarios:
65
+
66
+ ```bash
67
+ # Run comprehensive test suite
68
+ pnpm test
69
+
70
+ # Run specific test categories
71
+ pnpm test:valid # Valid code samples
72
+ pnpm test:invalid # Invalid code samples
73
+ pnpm test:hooks # React hooks rules
74
+ pnpm test:imports # Import/export patterns
75
+ pnpm test:edge # Edge cases
76
+ pnpm test:performance # Large files and complex code
77
+
78
+ # Legacy validation script
79
+ pnpm validate
80
+
81
+ # Lint the entire project
82
+ pnpm lint
83
+
84
+ # CI-ready linting (zero warnings allowed)
85
+ pnpm test:ci
86
+ ```
87
+
88
+ ### Test Coverage
89
+
90
+ The test suite covers 8+ categories with detailed validation:
91
+
92
+ **Core Rules Testing:**
93
+ - `test/valid.tsx` - Valid TypeScript React code
94
+ - `test/invalid.tsx` - Code that should trigger specific errors
95
+ - `test/jsx-extension-test.js` - JSX in JS file testing (should error)
96
+ - `test/long-function.tsx` - Function length limit testing
97
+
98
+ **Framework-Specific Testing:**
99
+ - `test/preact-test.tsx` - Preact component validation
100
+ - `test/react-hooks-rules.tsx` - React hooks rules validation
101
+ - `test/typescript-rules.ts` - TypeScript-specific features
102
+
103
+ **Advanced Testing:**
104
+ - `test/import-export-rules.ts` - Import/export patterns
105
+ - `test/edge-cases.tsx` - Edge cases and boundary conditions
106
+ - `test/performance-test.tsx` - Large files and complex scenarios
107
+
108
+ **Automated Validation:**
109
+ - `scripts/test-runner.js` - Comprehensive test runner with categorized validation
110
+ - `scripts/validate-config.js` - Legacy configuration validator
111
+
112
+ ## Supported File Types
113
+
114
+ - **TypeScript**: `.ts`, `.tsx`
115
+ - **JavaScript**: `.js`, `.jsx`
116
+ - **Frameworks**: React, Preact
117
+ - **Module Systems**: ES Modules
118
+
119
+ ## Dependencies
120
+
121
+ - ESLint 9.x
122
+ - TypeScript ESLint
123
+ - React ESLint plugins
124
+ - Preact ESLint plugin
125
+
126
+ ## License
127
+
128
+ ISC
package/RELEASING.md ADDED
@@ -0,0 +1,124 @@
1
+ # Release Guide
2
+
3
+ This document describes how to release new versions of `@tupe12334/eslint-config`.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. **NPM Access**: Ensure you have publish access to the `@tupe12334/eslint-config` package on npm
8
+ 2. **Authentication**: Configure your npm authentication token in `.npmrc`:
9
+ ```
10
+ //registry.npmjs.org/:_authToken=your-token-here
11
+ ```
12
+ 3. **Clean Working Directory**: Ensure all changes are committed and your working directory is clean
13
+
14
+ ## Release Process
15
+
16
+ The project uses `release-it` for automated releases with manual control at each step.
17
+
18
+ ### Interactive Release (Recommended)
19
+
20
+ ```bash
21
+ pnpm release
22
+ ```
23
+
24
+ This will:
25
+ 1. Run validation tests (`pnpm validate` and `pnpm test:ci`)
26
+ 2. Prompt you to select the version bump (patch, minor, major, or custom)
27
+ 3. Generate a changelog based on conventional commits
28
+ 4. Create a git tag
29
+ 5. Commit the version bump
30
+ 6. Push changes to the remote repository
31
+ 7. Publish to npm
32
+
33
+ ### Specific Version Releases
34
+
35
+ For specific version types:
36
+
37
+ ```bash
38
+ # Patch release (1.0.0 → 1.0.1)
39
+ pnpm release:patch
40
+
41
+ # Minor release (1.0.0 → 1.1.0)
42
+ pnpm release:minor
43
+
44
+ # Major release (1.0.0 → 2.0.0)
45
+ pnpm release:major
46
+ ```
47
+
48
+ ### Dry Run
49
+
50
+ To test the release process without actually publishing:
51
+
52
+ ```bash
53
+ pnpm release:dry
54
+ ```
55
+
56
+ ## Pre-Release Checklist
57
+
58
+ Before running a release, ensure:
59
+
60
+ - [ ] All tests pass (`pnpm test:ci`)
61
+ - [ ] Configuration validation passes (`pnpm validate`)
62
+ - [ ] CHANGELOG.md is up to date (will be auto-generated)
63
+ - [ ] Working directory is clean
64
+ - [ ] You're on the correct branch (usually `main`)
65
+ - [ ] All intended changes are committed
66
+
67
+ ## Version Strategy
68
+
69
+ This package follows [Semantic Versioning (SemVer)](https://semver.org/):
70
+
71
+ - **Patch** (1.0.x): Bug fixes and backwards-compatible changes
72
+ - **Minor** (1.x.0): New features that are backwards-compatible
73
+ - **Major** (x.0.0): Breaking changes
74
+
75
+ ## Commit Message Format
76
+
77
+ For better changelog generation, use conventional commit messages:
78
+
79
+ ```
80
+ type(scope): description
81
+
82
+ Types:
83
+ - feat: New feature
84
+ - fix: Bug fix
85
+ - docs: Documentation changes
86
+ - style: Code style changes
87
+ - refactor: Code refactoring
88
+ - test: Test changes
89
+ - chore: Maintenance tasks
90
+ ```
91
+
92
+ Examples:
93
+ - `feat: add support for new ESLint rule`
94
+ - `fix: resolve TypeScript configuration conflict`
95
+ - `docs: update installation instructions`
96
+
97
+ ## Troubleshooting
98
+
99
+ ### Authentication Issues
100
+ - Ensure your `.npmrc` file contains a valid authentication token
101
+ - Verify you have publish access to the package
102
+
103
+ ### Test Failures
104
+ - All tests must pass before release
105
+ - Run `pnpm validate` and `pnpm test:ci` to identify issues
106
+
107
+ ### Git Issues
108
+ - Ensure your working directory is clean
109
+ - Make sure you're on the correct branch
110
+ - Verify remote repository access
111
+
112
+ ### Publishing Issues
113
+ - Check network connectivity
114
+ - Verify npm registry access
115
+ - Ensure package name is not already taken (for major versions)
116
+
117
+ ## Post-Release
118
+
119
+ After a successful release:
120
+
121
+ 1. Verify the package is available on [npmjs.com](https://npmjs.com/package/@tupe12334/eslint-config)
122
+ 2. Test installation in a separate project
123
+ 3. Update any dependent projects that use this configuration
124
+ 4. Announce the release if significant changes were made
package/SETUP.md ADDED
@@ -0,0 +1,48 @@
1
+ # Setup Instructions
2
+
3
+ ## Environment Setup for Publishing
4
+
5
+ To publish this package, you need to set up environment variables for authentication:
6
+
7
+ 1. Copy the example environment file:
8
+ ```bash
9
+ cp .env.example .env
10
+ ```
11
+
12
+ 2. Get your NPM authentication token:
13
+ - Go to https://www.npmjs.com/settings/tokens
14
+ - Create a new "Automation" token (this bypasses OTP requirements)
15
+ - Make sure to select "Automation" type, not "Publish"
16
+ - Copy the token value
17
+
18
+ 3. Edit the `.env` file and replace `your_npm_token_here` with your actual NPM token:
19
+ ```bash
20
+ NPM_TOKEN=npm_xxxxxxxxxxxxxxxxxxxxxxxxxx
21
+ ```
22
+
23
+ ## Publishing
24
+
25
+ Once the `.env` file is set up, you can publish using:
26
+
27
+ ```bash
28
+ # Patch release (1.0.0 -> 1.0.1)
29
+ pnpm release:patch
30
+
31
+ # Minor release (1.0.0 -> 1.1.0)
32
+ pnpm release:minor
33
+
34
+ # Major release (1.0.0 -> 2.0.0)
35
+ pnpm release:major
36
+
37
+ # Dry run to test without publishing
38
+ pnpm release:dry
39
+ ```
40
+
41
+ The release process will:
42
+ 1. Run validation tests
43
+ 2. Run lint checks with zero warnings
44
+ 3. Bump the version number
45
+ 4. Generate a changelog
46
+ 5. Create a git tag
47
+ 6. Publish to NPM
48
+ 7. Create a GitHub release
@@ -0,0 +1,3 @@
1
+ import config from './index.js';
2
+
3
+ export default config;