Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 11, 2024
1 parent 1c72d1a commit e129b9d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

5 changes: 0 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@ export default antfu(
'test/fixtures*',
],
},
{
rules: {
// overrides
},
},
)
7 changes: 4 additions & 3 deletions src/core/ctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ ${dts}`.trim()}\n`
? resolve(root, 'auto-imports.d.ts')
: resolve(root, preferDTS)

const multilineCommentsRE = /\/\*.*?\*\//gms
const multilineCommentsRE = /\/\*.*?\*\//gs
const singlelineCommentsRE = /\/\/.*$/gm
const dtsReg = /declare\s+global\s*{(.*?)[\n\r]}/s
const componentCustomPropertiesReg = /interface\s+ComponentCustomProperties\s*{(.*?)[\n\r]}/gs
const dtsReg = /declare\s+global\s*\{(.*?)[\n\r]\}/s
const componentCustomPropertiesReg = /interface\s+ComponentCustomProperties\s*\{(.*?)[\n\r]\}/gs
function parseDTS(dts: string) {
dts = dts
.replace(multilineCommentsRE, '')
Expand All @@ -129,6 +129,7 @@ ${dts}`.trim()}\n`
if (!code)
return

// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/no-misleading-capturing-group
return Object.fromEntries(Array.from(code.matchAll(/['"]?(const\s*[^\s'"]+)['"]?\s*:\s*(.+?)[,;\r\n]/g)).map(i => [i[1], i[2]]))
}

Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ export interface Options {
*/
eslintrc?: ESLintrc

/**
* Generate corresponding .biomelintrc.json file.
*/
biomelintrc?: BiomeLintrc

/**
* Include auto-imported packages in Vite's `optimizeDeps` option
*
Expand Down

0 comments on commit e129b9d

Please sign in to comment.