Some errors happen when set exclude value to function: Range out of order in character class In regex.
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 173
- PR merge metrics
- No merged PRs in 30d
Description
I am using version "postcss-pxtorem": "^6.0.0" and I'm having the same issue. This is part of my config in postcss.config.js.
```js
'postcss-pxtorem': {
rootValue: 37.5,
propList: ['*'],
unitPrecision: 5,
exclude: (file) => {
const BLACK_LIST = [
// cause error
'pages/patient-report/fang'
]
return BLACK_LIST.some(item => file.indexOf(item) !== -1)
}
}
```
When I execute the plugin, I will get the following errors,I think the error occurs when call the function `filePath.match(exclude)`.

Contributor guide
No contributing guide indexed for this repository
Research direction
The report provides postcss.config.js and points to filePath.match(exclude) as the suspected entry point. Reproduce the failure with the shown exclude function and inspect how that value is handled. Done means the reported regex error no longer occurs while the exclusion behavior still works; no target test or patch location is named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100