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"
66
77` @ota-meshi/eslint-plugin-svelte ` is ESLint plugin for Svelte.
88It 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 ) .
1010
1111::: ** _ WORKS IN PROGRESS_ ** :::
1212
Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ hiddenMenu: true
77
88<ESLintPlayground >
99
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/ ) !!
1111
1212</ESLintPlayground >
Original file line number Diff line number Diff line change @@ -38,17 +38,24 @@ ${newReadme
3838 )
3939 . 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, "" )
4040 . 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" ) ) {
4653 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" )
4855 } else {
49- result += " .md"
56+ result += ` ${ file } .md`
5057 }
51- result += ")"
58+ result += ` ${ hash } )`
5259 return result
5360 } ,
5461 )
You can’t perform that action at this time.
0 commit comments