Skip to content

Commit 7cda7c5

Browse files
jjlonemanclaude
andcommitted
chore(types): 🔧 inline eslint-disable for LangVariant bit flags
Per review on #136, prefer an in-file disable over editing the shared eslint config: - add a scoped `@typescript-eslint/no-magic-numbers` disable block (with a `--` reason) around `LangVariant` - revert the `src/types.ts` override in eslint.config.js Co-Authored-By: Claude Opus 4.8 <[email protected]>
1 parent 7245bfd commit 7cda7c5

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

‎eslint.config.js‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,4 @@ export default [
2020
'sonarjs/no-empty-test-file': 'off',
2121
},
2222
},
23-
{
24-
/*
25-
* `LangVariant` mirrors mvdan/sh's `1 << iota` bit flags, so its values are
26-
* intentional rather than magic numbers.
27-
*/
28-
files: ['src/types.ts'],
29-
rules: {
30-
'@typescript-eslint/no-magic-numbers': 'off',
31-
},
32-
},
3323
]

‎src/types.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
export type ValueOf<T> = T[keyof T]
22

3+
/* eslint-disable @typescript-eslint/no-magic-numbers -- `LangVariant` mirrors
4+
* `mvdan/sh`s `1 << iota` bit flags, so its values are intentional, not magic
5+
* numbers.
6+
*/
37
export const LangVariant = {
48
/**
59
* LangBash corresponds to the GNU Bash language, as described in its manual
@@ -58,6 +62,7 @@ export const LangVariant = {
5862
*/
5963
LangAuto: 1 << 5,
6064
} as const
65+
/* eslint-enable @typescript-eslint/no-magic-numbers */
6166

6267
export type LangVariant = ValueOf<typeof LangVariant>
6368

0 commit comments

Comments
 (0)