Skip to content

Commit ca6a908

Browse files
committed
fix(#14): correcting glob expression for camel case
1 parent 3b09031 commit ca6a908

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/constants/naming-convention.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @example hello, helloWorld
99
*/
10-
const CAMEL_CASE = '+([a-z])*([A-Z]*([a-z0-9]))';
10+
const CAMEL_CASE = '+([a-z])*([a-z0-9])*([A-Z]*([a-z0-9]))';
1111

1212
/**
1313
* @example Hello, HelloWorld

tests/lib/rules/filename-naming-convention.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ ruleTester.run(
2424
filename: 'src/utils/calculatePrice.js',
2525
options: [{ '*.js': 'CAMEL_CASE', '*.jsx': 'CAMEL_CASE' }],
2626
},
27+
{
28+
code: "var foo = 'bar';",
29+
filename: 'src/classes/g2tClass.js',
30+
options: [{ '*.js': 'CAMEL_CASE', '*.jsx': 'CAMEL_CASE' }],
31+
},
2732
],
2833

2934
invalid: [
@@ -79,6 +84,19 @@ ruleTester.run(
7984
},
8085
],
8186
},
87+
{
88+
code: "var foo = 'bar';",
89+
filename: 'src/classes/2gtClass.js',
90+
options: [{ '*.js': 'CAMEL_CASE', '*.jsx': 'CAMEL_CASE' }],
91+
errors: [
92+
{
93+
message:
94+
'The filename "2gtClass.js" does not match the "CAMEL_CASE" style',
95+
column: 1,
96+
line: 1,
97+
},
98+
],
99+
},
82100
],
83101
}
84102
);

0 commit comments

Comments
 (0)