Skip to content

Commit

Permalink
fix(init): makes initial regular expressions more specific (#872)
Browse files Browse the repository at this point in the history
## Description

- makes initial regular expressions more specific

## Motivation and Context

fixes #871 

The regexes generated previously matched more than they should have. 

## How Has This Been Tested?

- [x] green ci


## Types of changes

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation only change
- [ ] Refactor (non-breaking change which fixes an issue without
changing functionality)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
  • Loading branch information
sverweij committed Nov 22, 2023
1 parent a6d562b commit 3445a3b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cli/init-config/config-template.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ module.exports = {
from: {
orphan: true,
pathNot: [
'(^|/)\\.[^/]+\\.(js|cjs|mjs|ts|json)$', // dot files
'\\.d\\.ts$', // TypeScript declaration files
'(^|/)tsconfig\\.json$', // TypeScript config
'(^|/)(babel|webpack)\\.config\\.(js|cjs|mjs|ts|json)$' // other configs
'(^|/)[.][^/]+[.](js|cjs|mjs|ts|json)$', // dot files
'[.]d[.]ts$', // TypeScript declaration files
'(^|/)tsconfig[.]json$', // TypeScript config
'(^|/)(babel|webpack)[.]config[.](js|cjs|mjs|ts|json)$' // other configs
]
},
to: {},
Expand Down Expand Up @@ -136,7 +136,7 @@ module.exports = {
severity: 'error',
from: {},
to: {
path: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
path: '[.](spec|test)[.](js|mjs|cjs|ts|ls|coffee|litcoffee|coffee[.]md)$'
}
},
{
Expand All @@ -150,7 +150,7 @@ module.exports = {
'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration',
from: {
path: '{{sourceLocationRE}}',
pathNot: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
pathNot: '[.](spec|test)[.](js|mjs|cjs|ts|ls|coffee|litcoffee|coffee[.]md)$'
},
to: {
dependencyTypes: [
Expand Down

0 comments on commit 3445a3b

Please sign in to comment.