Skip to content

Commit 2306e34

Browse files
authored
feat: permissive-start + progressive ratchet scaffolding (#211)
feat: permissive-start preset and init flag - Add --permissive/--permissive-start to init to generate warn-only ESLint config - Export configs['permissive-start'] shareable preset - Include Jest/browser overrides in generator Refs: #210
1 parent 762b67c commit 2306e34

File tree

13 files changed

+75
-14
lines changed

13 files changed

+75
-14
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,20 @@ See [docs/learn.md](docs/learn.md) for methodology details.
242242

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

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

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

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

docs/rules/enforce-domain-terms.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Encourage domain-specific naming using declared project terms (`ai-code-snifftest/enforce-domain-terms`)
22

3+
⚠️ This rule _warns_ in the `permissive-start` config.
4+
35
💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
46

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

docs/rules/no-equivalent-branches.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Detect if/else branches that do the same thing (`ai-code-snifftest/no-equivalent-branches`)
22

3+
⚠️ This rule _warns_ in the `permissive-start` config.
4+
35
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
46

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

docs/rules/no-generic-names.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Flag generic names; enforce domain-specific naming (`ai-code-snifftest/no-generic-names`)
22

3+
⚠️ This rule _warns_ in the `permissive-start` config.
4+
35
<!-- end auto-generated rule header -->
46

57
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.

docs/rules/no-redundant-calculations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Detect redundant calculations that should be computed at compile time (`ai-code-snifftest/no-redundant-calculations`)
22

3+
⚠️ This rule _warns_ in the `permissive-start` config.
4+
35
🔧💡 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).
46

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

docs/rules/no-redundant-conditionals.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Simplify redundant conditional expressions (`ai-code-snifftest/no-redundant-conditionals`)
22

3+
⚠️ This rule _warns_ in the `permissive-start` config.
4+
35
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
46

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

docs/rules/no-unnecessary-abstraction.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Suggest inlining trivial single-use wrapper functions that add no value (`ai-code-snifftest/no-unnecessary-abstraction`)
22

3+
⚠️ This rule _warns_ in the `permissive-start` config.
4+
35
💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
46

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

docs/rules/prefer-simpler-logic.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Simplify boolean expressions and remove redundant logic (`ai-code-snifftest/prefer-simpler-logic`)
22

3+
⚠️ This rule _warns_ in the `permissive-start` config.
4+
35
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
46

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

lib/commands/init/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ const external = shouldEnableExternalConstants(args);
6969
}
7070
// Merge fingerprint signals into config (domains + constantResolution)
7171
applyFingerprintToConfig(cwd, cfg);
72+
73+
// Optional: start with permissive ESLint (progressive ratcheting)
74+
if (args && (args.permissive || String(args['permissive-start']).toLowerCase() === 'true')) {
75+
cfg.eslintMode = 'permissive';
76+
}
77+
7278
if (external && (!allowlist || allowlist.length === 0)) {
7379
console.warn('Warning: --external used without allowlist; consider adding --allowlist to limit npm scope.');
7480
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
// Permissive start preset: measure-only rules for progressive ratcheting
4+
module.exports = {
5+
rules: {
6+
// Baseline – measure only
7+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
8+
'no-undef': 'warn',
9+
'no-empty': ['warn', { allowEmptyCatch: true }],
10+
'eqeqeq': ['warn', 'always'],
11+
'camelcase': ['warn', { properties: 'never', ignoreDestructuring: true, ignoreImports: true }],
12+
13+
// Architecture – measure only
14+
'complexity': ['warn', 10],
15+
'max-lines': ['warn', 250],
16+
'max-lines-per-function': ['warn', 50],
17+
'max-depth': ['warn', 4],
18+
'max-params': ['warn', 4],
19+
'max-statements': ['warn', 30],
20+
21+
// Plugin – measure only (domain/structure)
22+
'ai-code-snifftest/no-redundant-calculations': 'warn',
23+
'ai-code-snifftest/no-equivalent-branches': 'warn',
24+
'ai-code-snifftest/prefer-simpler-logic': 'warn',
25+
'ai-code-snifftest/no-redundant-conditionals': 'warn',
26+
'ai-code-snifftest/no-unnecessary-abstraction': 'warn',
27+
'ai-code-snifftest/no-generic-names': 'warn',
28+
'ai-code-snifftest/enforce-domain-terms': 'warn'
29+
}
30+
};

0 commit comments

Comments
 (0)