-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feature(eslint-plugin): add new file-header rule
Signed-off-by: Pauline <[email protected]>
- Loading branch information
1 parent
8d62f1b
commit 72b194e
Showing
8 changed files
with
272 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# file-header | ||
|
||
Simple file header that adds a copyright/license/message to the top of files. | ||
|
||
Adapted from [`eslint-plugin-simple-header`](https://codeberg.org/rini/eslint-plugin-simple-header) | ||
|
||
## Rule Details | ||
|
||
```ts | ||
type PetalFileHeader = [] | [(({ | ||
syntax?: string; | ||
decor?: string; | ||
[k: string]: unknown | undefined; | ||
} | { | ||
|
||
syntax?: [string, string]; | ||
|
||
decor?: [string, string, string]; | ||
[k: string]: unknown | undefined; | ||
}) & ({ | ||
|
||
files: [string, ...string[]]; | ||
[k: string]: unknown | undefined; | ||
} | { | ||
text: (string | string[]); | ||
[k: string]: unknown | undefined; | ||
}))]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { run } from './_test'; | ||
import rule, { RULE_NAME } from './file-header'; | ||
|
||
run({ | ||
name: RULE_NAME, | ||
rule, | ||
}); |
Oops, something went wrong.