feat: Create new rule - validate-sheriff-config#179
Conversation
…-for-sheriff.config.ts-only
…ding validate-sheriff-config
|
Hey Tom, I see this PR is in draft mode and you had some commits lately. Let me know once it is ready for a review. |
…-for-sheriff.config.ts-only
| "url": "http://localhost:9378/sse" | ||
| } | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
You might like to consider this change separately from the pr; it's just for the Cursor.
| "@angular-eslint/schematics" | ||
| ] | ||
| "schematicCollections": ["@angular-eslint/schematics"], | ||
| "analytics": false |
There was a problem hiding this comment.
This file has been formatted because I wanted to add "analytics": false
| "@angular-eslint/schematics" | ||
| ] | ||
| "schematicCollections": ["@angular-eslint/schematics"], | ||
| "analytics": false |
There was a problem hiding this comment.
This file has been formatted because I wanted to add "analytics": false
| "@angular-eslint/schematics" | ||
| ] | ||
| "schematicCollections": ["@angular-eslint/schematics"], | ||
| "analytics": false |
There was a problem hiding this comment.
This file has been formatted because I wanted to add "analytics": false
| "@angular-eslint/schematics" | ||
| ] | ||
| "schematicCollections": ["@angular-eslint/schematics"], | ||
| "analytics": false |
There was a problem hiding this comment.
This file has been formatted because I wanted to add "analytics": false
| export const config: SheriffConfig = { | ||
| version: 1, | ||
| tagging: { | ||
| modules: { |
There was a problem hiding this comment.
Discuss: Are you happy with this change to the test scenario?
Now that this pr is fully backward compatible
|
This one's now ready for review @rainerhahnekamp |
| }; | ||
|
|
||
| const getProjectRoot = (filename: string): string => | ||
| filename.slice(0, filename.indexOf(SHERIFF_CONFIG_FILENAME)); |
There was a problem hiding this comment.
My bad. During manual testing today, I discovered this line is not compatible with Windows file systems.
I'm flipping this PR back to draft while I fix it.
|
|
I've fixed the Windows-projectRoot path issue, and I'm marking this PR ready for review again. I have been looking at creating a Windows version for |



This PR introduces a new eslint rule,
validate-sheriff-config. This new rule has its owncreateSheriffConfigRulefunction, similar to thecreateRulefunction used to generate the other rules. If you wish, I could look at merging the two. I didn’t do this before because I didn’t want to make many changes increateRulein this PR.I’ve taken care not to change the way the user configures Sheriff in the
eslint.config.jsfile.To remain backwards compatible and not require significant extra eslint config from the user, I’ve introduced programmatic filename filters with a function,
isExcluded.I’ve added lots of tests to cover all changes.