File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ title: "@ota-meshi/eslint-plugin-svelte"
6
6
7
7
` @ota-meshi/eslint-plugin-svelte ` is ESLint plugin for Svelte.
8
8
It provides many unique check rules by using the template AST.
9
- You can check on the [ Online DEMO] ( ./playground/ .md ) .
9
+ You can check on the [ Online DEMO] ( ./playground.md ) .
10
10
11
11
::: ** _ WORKS IN PROGRESS_ ** :::
12
12
Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ hiddenMenu: true
7
7
8
8
<ESLintPlayground >
9
9
10
- The playground is [ here] ( https://ota-meshi.github.io/eslint-plugin-svelte/README ) !!
10
+ The playground is [ here] ( https://ota-meshi.github.io/eslint-plugin-svelte/playground/ ) !!
11
11
12
12
</ESLintPlayground >
Original file line number Diff line number Diff line change @@ -38,17 +38,24 @@ ${newReadme
38
38
)
39
39
. replace ( / < ! - - D O C S _ I G N O R E _ S T A R T - - > [ \s \S ] * ?< ! - - D O C S _ I G N O R E _ E N D - - > / gu, "" )
40
40
. replace (
41
- // eslint-disable-next-line regexp/no-super-linear-backtracking -- ignore
42
- / \( h t t p s : \/ \/ o t a - m e s h i .g i t h u b .i o \/ e s l i n t - p l u g i n - s v e l t e ( .* ?) ( [ ^ / ] * \. h t m l ) ? \) / gu,
43
- ( _ptn , c1 : string , c2 : string ) => {
44
- let result = `(.${ c1 } `
45
- if ( c2 ) {
41
+ / \( h t t p s : \/ \/ o t a - m e s h i .g i t h u b .i o \/ e s l i n t - p l u g i n - s v e l t e ( .* ?) \) / gu,
42
+ ( _ptn , path : string ) => {
43
+ const [ hash ] = / (?: # .* ) ? $ / u. exec ( path ) !
44
+ const pathWithoutHash = hash ? path . slice ( 0 , - hash . length ) : path
45
+ const normalizePathWithoutHash = pathWithoutHash . replace ( / \/ $ / u, "" )
46
+ const [ file ] = / [ ^ / ] + $ / u. exec ( normalizePathWithoutHash ) !
47
+ const pathWithoutFile = file
48
+ ? normalizePathWithoutHash . slice ( 0 , - file . length )
49
+ : normalizePathWithoutHash
50
+
51
+ let result = `(.${ pathWithoutFile } `
52
+ if ( file . endsWith ( ".html" ) ) {
46
53
result +=
47
- c2 === "index.html" ? "README.md" : c2 . replace ( / \. h t m l $ / , ".md" )
54
+ file === "index.html" ? "README.md" : file . replace ( / \. h t m l $ / , ".md" )
48
55
} else {
49
- result += " .md"
56
+ result += ` ${ file } .md`
50
57
}
51
- result += ")"
58
+ result += ` ${ hash } )`
52
59
return result
53
60
} ,
54
61
)
You can’t perform that action at this time.
0 commit comments