Skip to content

Commit 305b112

Browse files
committed
feat(naming-convention): allow specifying parameter exceptions
1 parent d7aa176 commit 305b112

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blitz/eslint-plugin",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"license": "MIT",
55
"description": "An ESLint config to enforce a consistent code styles across StackBlitz projects",
66
"keywords": [

src/configs/typescript.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export interface TSRuleExtensions {
66
variable?: {
77
exceptions?: string[];
88
};
9+
parameter?: {
10+
exceptions?: string[];
11+
};
912
};
1013
}
1114

@@ -32,6 +35,12 @@ export function getNamingConventionRule(
3235
selector: 'parameter',
3336
format: ['camelCase'],
3437
leadingUnderscore: 'allow',
38+
...(extensions?.parameter?.exceptions?.length && {
39+
filter: {
40+
regex: generateNamingConventionRegex([], extensions?.parameter?.exceptions),
41+
match: false,
42+
},
43+
}),
3544
},
3645
{
3746
selector: 'typeLike',

0 commit comments

Comments
 (0)