Skip to content

Commit c36d404

Browse files
committed
Fix linting errors in config validator
1 parent d7f66f3 commit c36d404

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

src/config-validator.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,37 @@ class ConfigValidator {
2424
errors.push('Password is required');
2525
} else {
2626
const password = config.password;
27-
27+
2828
// Length: 8-16 characters
2929
if (password.length < 8 || password.length > 16) {
3030
errors.push('Password must be 8-16 characters (Mopar requirement)');
3131
}
32-
32+
3333
// Must have uppercase
3434
if (!/[A-Z]/.test(password)) {
3535
errors.push('Password must contain at least 1 uppercase letter (A-Z)');
3636
}
37-
37+
3838
// Must have lowercase
3939
if (!/[a-z]/.test(password)) {
4040
errors.push('Password must contain at least 1 lowercase letter (a-z)');
4141
}
42-
42+
4343
// Must have number
4444
if (!/[0-9]/.test(password)) {
4545
errors.push('Password must contain at least 1 number (0-9)');
4646
}
47-
47+
4848
// Must have special character from allowed set
4949
if (!/[@$!%*?&_-]/.test(password)) {
5050
errors.push('Password must contain at least 1 special character (@$!%*?&_-)');
5151
}
52-
52+
5353
// No character repeated more than twice
5454
if (/(.)\1{2,}/.test(password)) {
5555
errors.push('Password cannot have any character repeated more than twice (e.g. aaa, 111)');
5656
}
57-
57+
5858
// No more than two sequential characters
5959
if (this.hasSequentialCharacters(password)) {
6060
errors.push('Password cannot have more than two sequential characters (e.g. ABC, xyz, 123)');

src/config-validator.test.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ describe('ConfigValidator', () => {
170170
const result = ConfigValidator.validate(config);
171171

172172
expect(result.valid).toBe(false);
173-
expect(result.errors).toContain(
174-
'Password cannot have any character repeated more than twice (e.g. aaa, 111)'
175-
);
173+
expect(result.errors).toContain('Password cannot have any character repeated more than twice (e.g. aaa, 111)');
176174
});
177175

178176
test('should fail when password has sequential ascending characters', () => {
@@ -184,9 +182,7 @@ describe('ConfigValidator', () => {
184182
const result = ConfigValidator.validate(config);
185183

186184
expect(result.valid).toBe(false);
187-
expect(result.errors).toContain(
188-
'Password cannot have more than two sequential characters (e.g. ABC, xyz, 123)'
189-
);
185+
expect(result.errors).toContain('Password cannot have more than two sequential characters (e.g. ABC, xyz, 123)');
190186
});
191187

192188
test('should fail when password has sequential numbers', () => {
@@ -198,9 +194,7 @@ describe('ConfigValidator', () => {
198194
const result = ConfigValidator.validate(config);
199195

200196
expect(result.valid).toBe(false);
201-
expect(result.errors).toContain(
202-
'Password cannot have more than two sequential characters (e.g. ABC, xyz, 123)'
203-
);
197+
expect(result.errors).toContain('Password cannot have more than two sequential characters (e.g. ABC, xyz, 123)');
204198
});
205199

206200
test('should pass with valid Mopar-compliant password', () => {
@@ -330,7 +324,7 @@ describe('ConfigValidator', () => {
330324
// 1. Email invalid
331325
// 2. Length (< 8)
332326
// 3. No uppercase
333-
// 4. No number
327+
// 4. No number
334328
// 5. No special char
335329
// 6. PIN invalid
336330
// 7. Debug not boolean

0 commit comments

Comments
 (0)