Skip to content

Commit e028898

Browse files
committed
Add curly lint rule
1 parent a472cb6 commit e028898

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

.oxlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"settings": {},
1010
"rules": {
11+
"curly": "error",
1112
"no-control-regex": "off",
1213
"no-extend-native": "off",
1314
"no-new": "off",

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ module.exports = [
118118
}
119119
],
120120
'n/prefer-node-protocol': 'error',
121+
curly: 'error',
121122
'no-await-in-loop': 'error',
122123
'no-control-regex': 'error',
123124
'no-empty': ['error', { allowEmptyCatch: true }],

src/normalize.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ function subpathFilter(segment) {
9999
// - must not be any of '.' or '..'
100100
// - must not be empty
101101
const { length } = segment
102-
if (length === 1 && segment.charCodeAt(0) === 46 /*'.'*/) return false
102+
if (length === 1 && segment.charCodeAt(0) === 46 /*'.'*/) {
103+
return false
104+
}
103105
if (
104106
length === 2 &&
105107
segment.charCodeAt(0) === 46 &&

0 commit comments

Comments
 (0)