File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module.exports = {
11
11
12
12
rules : {
13
13
"@typescript-eslint/no-var-requires" : "off" ,
14
+ "@typescript-eslint/no-unsafe-assignment" : "off" ,
14
15
} ,
15
16
} ,
16
17
] ,
Original file line number Diff line number Diff line change
1
+ # Contributors
2
+
3
+ - ![ paleite] ( https://avatars.githubusercontent.com/u/4430528?v=4&s=50 ) [ paleite] ( https://github.com/paleite )
4
+ - ![ DaVarga] ( https://avatars.githubusercontent.com/u/3964986?v=4&s=50 ) [ DaVarga] ( https://github.com/DaVarga )
5
+ - ![ IsLand-x] ( https://avatars.githubusercontent.com/u/50228788?v=4&s=50 ) [ IsLand-x] ( https://github.com/IsLand-x )
6
+ - ![ ezequiel] ( https://avatars.githubusercontent.com/u/368069?v=4&s=50 ) [ ezequiel] ( https://github.com/ezequiel )
7
+ - ![ burtonator] ( https://avatars.githubusercontent.com/u/45447?v=4&s=50 ) [ burtonator] ( https://github.com/burtonator )
8
+ - ![ flupke] ( https://avatars.githubusercontent.com/u/188962?v=4&s=50 ) [ flupke] ( https://github.com/flupke )
9
+ - ![ mathieutu] ( https://avatars.githubusercontent.com/u/11351322?v=4&s=50 ) [ mathieutu] ( https://github.com/mathieutu )
10
+ - ![ JosephLing] ( https://avatars.githubusercontent.com/u/8035792?v=4&s=50 ) [ JosephLing] ( https://github.com/JosephLing )
Original file line number Diff line number Diff line change
1
+ const https = require ( "https" ) ;
2
+ const fs = require ( "fs" ) ;
3
+
4
+ const options = {
5
+ hostname : "api.github.com" ,
6
+ port : 443 ,
7
+ path : "/repos/paleite/eslint-plugin-diff/contributors" ,
8
+ method : "GET" ,
9
+ headers : {
10
+ "User-Agent" : "node.js" , // GitHub requires a user-agent header
11
+ } ,
12
+ } ;
13
+
14
+ let rawData = "" ;
15
+
16
+ const req = https . request ( options , ( res ) => {
17
+ res . setEncoding ( "utf8" ) ;
18
+ res . on ( "data" , ( chunk ) => {
19
+ rawData += chunk ;
20
+ } ) ;
21
+ res . on ( "end" , ( ) => {
22
+ try {
23
+ /** @type {{login: string, avatar_url: string, html_url: string}[] } */
24
+ const parsedData = JSON . parse ( rawData ) ;
25
+
26
+ const contributorsList = parsedData
27
+ . filter ( ( { login } ) => ! login . includes ( "[bot]" ) )
28
+ . map (
29
+ ( contributor ) =>
30
+ `-  [${ contributor . login } ](${ contributor . html_url } )`
31
+ ) ;
32
+
33
+ fs . writeFileSync (
34
+ "CONTRIBUTORS.md" ,
35
+ [ "# Contributors" , contributorsList . join ( "\n" ) ] . join ( "\n\n" )
36
+ ) ;
37
+ } catch ( e ) {
38
+ console . error ( e . message ) ;
39
+ }
40
+ } ) ;
41
+ } ) ;
42
+
43
+ req . on ( "error" , ( e ) => {
44
+ console . error ( `Problem with request: ${ e . message } ` ) ;
45
+ } ) ;
46
+
47
+ req . end ( ) ;
You can’t perform that action at this time.
0 commit comments