You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Root Configuration**: `.solhint.json` - Base Solidity linting rules extending `solhint:recommended`
209
-
-**Direct Command**: `npx solhint 'contracts/**/*.sol'` (add `--fix` for auto-fixing)
210
-
-**List Applied Rules**: `npx solhint list-rules`
211
-
-**TODO Comment Checking**: `scripts/check-todos.sh` - Blocks commits and linting if TODO/FIXME/XXX/HACK comments are found in changed Solidity files
212
-
-**Package Inheritance**: Packages can extend the root config with package-specific rules
213
-
-**Configuration Inheritance Limitation**: Solhint has a limitation where nested `extends` don't work properly. When a local config extends a parent config that itself extends `solhint:recommended`, the built-in ruleset is ignored.
-**Custom Script**: `scripts/lint-staged-run.sh` filters out generated files that shouldn't be linted
270
-
-**File Type Handling**:
271
-
-`.{js,ts,cjs,mjs,jsx,tsx}`: ESLint + Prettier
272
-
-`.sol`: TODO check + Solhint + Prettier
273
-
-`.md`: Markdownlint + Prettier
274
-
-`.json`: Prettier only
275
-
-`.{yml,yaml}`: YAML lint + Prettier
276
-
277
-
**Usage**: `pnpm lint:staged` is particularly useful when you want to check what linting changes will be applied to your staged files before actually committing.
278
-
279
-
### TODO Comment Enforcement
280
-
281
-
The repository enforces TODO comment resolution to maintain code quality:
282
-
283
-
-**Scope**: Applies only to Solidity (`.sol`) files
284
-
-**Detection**: Finds TODO, FIXME, XXX, and HACK comments (case-insensitive)
285
-
-**Triggers**:
286
-
-**Pre-commit**: Blocks commits if TODO comments exist in files being committed
287
-
-**Regular linting**: Flags TODO comments in locally changed, staged, or untracked Solidity files
288
-
-**Script**: `scripts/check-todos.sh` (must be run from repository root)
289
-
-**Bypass**: Use `git commit --no-verify` to bypass (not recommended for production)
290
-
291
-
### Key Design Principles
292
-
293
-
1.**Hierarchical Configuration**: Root configurations provide base rules, packages can extend as needed
294
-
2.**Tool-Specific Inheritance**: ESLint searches up automatically, Prettier requires explicit inheritance
295
-
3.**Generated File Exclusion**: Multiple layers of exclusion for autogenerated content
296
-
4.**Consistent Formatting**: Prettier ensures consistent code formatting across all file types
297
-
5.**Fail-Fast Linting**: Pre-commit hooks catch issues before they enter the repository
-**ESLint not finding config**: ESLint searches up parent directories automatically - no local config needed
312
-
-**Prettier not working**: Packages need a `prettier.config.cjs` that inherits from root config
313
-
-**Solhint missing rules**: If extending a parent config, use array format: `["solhint:recommended", "./../../.solhint.json"]` to ensure all rules are loaded
314
-
-**Solhint inheritance not working**: Nested extends don't work - parent config's `solhint:recommended` won't be inherited with simple string extends
315
-
-**Solhint rule reference**: Use `npx solhint list-rules` to see all available rules and their descriptions
316
-
-**Generated files being linted**: Check ignore patterns in `.prettierignore`, `.markdownlintignore`, and ESLint config
317
-
-**Preview lint changes before commit**: Use `pnpm lint:staged` to see what changes will be applied to staged files
318
-
-**Commit blocked by linting**: Fix the linting issues or use `git commit --no-verify` to bypass (not recommended)
177
+
See [docs/Linting.md](docs/Linting.md) for detailed configuration, inline suppression syntax, and troubleshooting.
0 commit comments