Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,20 @@ See [docs/learn.md](docs/learn.md) for methodology details.

<!-- begin auto-generated rules list -->

⚠️ Configurations set to warn in.\
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

| Name                       | Description | 🔧 | 💡 |
| :--------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- | :- | :- |
| [enforce-domain-terms](docs/rules/enforce-domain-terms.md) | Encourage domain-specific naming using declared project terms | | 💡 |
| [enforce-naming-conventions](docs/rules/enforce-naming-conventions.md) | Enforce naming conventions from project config (style, boolean/async prefixes, plural collections) | | 💡 |
| [no-equivalent-branches](docs/rules/no-equivalent-branches.md) | Detect if/else branches that do the same thing | 🔧 | |
| [no-generic-names](docs/rules/no-generic-names.md) | Flag generic names; enforce domain-specific naming | | |
| [no-redundant-calculations](docs/rules/no-redundant-calculations.md) | Detect redundant calculations that should be computed at compile time | 🔧 | 💡 |
| [no-redundant-conditionals](docs/rules/no-redundant-conditionals.md) | Simplify redundant conditional expressions | 🔧 | |
| [no-unnecessary-abstraction](docs/rules/no-unnecessary-abstraction.md) | Suggest inlining trivial single-use wrapper functions that add no value | | 💡 |
| [prefer-simpler-logic](docs/rules/prefer-simpler-logic.md) | Simplify boolean expressions and remove redundant logic | 🔧 | |
| Name                       | Description | ⚠️ | 🔧 | 💡 |
| :--------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- | :-------------------------- | :- | :- |
| [enforce-domain-terms](docs/rules/enforce-domain-terms.md) | Encourage domain-specific naming using declared project terms | ![badge-permissive-start][] | | 💡 |
| [enforce-naming-conventions](docs/rules/enforce-naming-conventions.md) | Enforce naming conventions from project config (style, boolean/async prefixes, plural collections) | | | 💡 |
| [no-equivalent-branches](docs/rules/no-equivalent-branches.md) | Detect if/else branches that do the same thing | ![badge-permissive-start][] | 🔧 | |
| [no-generic-names](docs/rules/no-generic-names.md) | Flag generic names; enforce domain-specific naming | ![badge-permissive-start][] | | |
| [no-redundant-calculations](docs/rules/no-redundant-calculations.md) | Detect redundant calculations that should be computed at compile time | ![badge-permissive-start][] | 🔧 | 💡 |
| [no-redundant-conditionals](docs/rules/no-redundant-conditionals.md) | Simplify redundant conditional expressions | ![badge-permissive-start][] | 🔧 | |
| [no-unnecessary-abstraction](docs/rules/no-unnecessary-abstraction.md) | Suggest inlining trivial single-use wrapper functions that add no value | ![badge-permissive-start][] | | 💡 |
| [prefer-simpler-logic](docs/rules/prefer-simpler-logic.md) | Simplify boolean expressions and remove redundant logic | ![badge-permissive-start][] | 🔧 | |

<!-- end auto-generated rules list -->

Expand Down
2 changes: 2 additions & 0 deletions docs/rules/enforce-domain-terms.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Encourage domain-specific naming using declared project terms (`ai-code-snifftest/enforce-domain-terms`)

⚠️ This rule _warns_ in the `permissive-start` config.

💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-equivalent-branches.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Detect if/else branches that do the same thing (`ai-code-snifftest/no-equivalent-branches`)

⚠️ This rule _warns_ in the `permissive-start` config.

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-generic-names.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Flag generic names; enforce domain-specific naming (`ai-code-snifftest/no-generic-names`)

⚠️ This rule _warns_ in the `permissive-start` config.

<!-- end auto-generated rule header -->

Flags generic identifiers like `data`, `result`, `temp`, or those containing forbidden domain terms (e.g., `song`) based on your project’s `.ai-coding-guide.json` or rule options.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-redundant-calculations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Detect redundant calculations that should be computed at compile time (`ai-code-snifftest/no-redundant-calculations`)

⚠️ This rule _warns_ in the `permissive-start` config.

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-redundant-conditionals.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Simplify redundant conditional expressions (`ai-code-snifftest/no-redundant-conditionals`)

⚠️ This rule _warns_ in the `permissive-start` config.

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-unnecessary-abstraction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Suggest inlining trivial single-use wrapper functions that add no value (`ai-code-snifftest/no-unnecessary-abstraction`)

⚠️ This rule _warns_ in the `permissive-start` config.

💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/prefer-simpler-logic.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Simplify boolean expressions and remove redundant logic (`ai-code-snifftest/prefer-simpler-logic`)

⚠️ This rule _warns_ in the `permissive-start` config.

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->
Expand Down
6 changes: 6 additions & 0 deletions lib/commands/init/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ const external = shouldEnableExternalConstants(args);
}
// Merge fingerprint signals into config (domains + constantResolution)
applyFingerprintToConfig(cwd, cfg);

// Optional: start with permissive ESLint (progressive ratcheting)
if (args && (args.permissive || String(args['permissive-start']).toLowerCase() === 'true')) {
cfg.eslintMode = 'permissive';
}

if (external && (!allowlist || allowlist.length === 0)) {
console.warn('Warning: --external used without allowlist; consider adding --allowlist to limit npm scope.');
}
Expand Down
30 changes: 30 additions & 0 deletions lib/eslint-presets/permissive-start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

// Permissive start preset: measure-only rules for progressive ratcheting
module.exports = {
rules: {
// Baseline – measure only
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-undef': 'warn',
'no-empty': ['warn', { allowEmptyCatch: true }],
'eqeqeq': ['warn', 'always'],
'camelcase': ['warn', { properties: 'never', ignoreDestructuring: true, ignoreImports: true }],

// Architecture – measure only
'complexity': ['warn', 10],
'max-lines': ['warn', 250],
'max-lines-per-function': ['warn', 50],
'max-depth': ['warn', 4],
'max-params': ['warn', 4],
'max-statements': ['warn', 30],

// Plugin – measure only (domain/structure)
'ai-code-snifftest/no-redundant-calculations': 'warn',
'ai-code-snifftest/no-equivalent-branches': 'warn',
'ai-code-snifftest/prefer-simpler-logic': 'warn',
'ai-code-snifftest/no-redundant-conditionals': 'warn',
'ai-code-snifftest/no-unnecessary-abstraction': 'warn',
'ai-code-snifftest/no-generic-names': 'warn',
'ai-code-snifftest/enforce-domain-terms': 'warn'
}
};
8 changes: 7 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ module.exports = {
},
rules: requireIndex(__dirname + '/rules'),
// Lightweight, additive presets intended for wizard composition
presets: requireIndex(__dirname + '/eslint-presets')
presets: requireIndex(__dirname + '/eslint-presets'),
// Provide shareable configs for flat config users
configs: {
'permissive-start': require(__dirname + '/eslint-presets/permissive-start'),
'baseline': require(__dirname + '/eslint-presets/baseline'),
'ai-friendly': require(__dirname + '/eslint-presets/ai-friendly')
}
};

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
"main": "./lib/index.js",
"exports": "./lib/index.js",
"files": [
"lib",
"bin"
"bin/",
"lib/",
"scripts/ratchet.js",
"README.md",
"LICENSE"
],
"bin": {
"eslint-plugin-ai-code-snifftest": "./bin/cli.js"
"eslint-plugin-ai-code-snifftest": "./bin/cli.js",
"eslint-plugin-ai-code-snifftest-ratchet": "./scripts/ratchet.js"
},
"scripts": {
"lint": "npm-run-all \"lint:*\"",
Expand Down
Empty file modified scripts/ratchet.js
100644 → 100755
Empty file.
Loading