chore(lint): enforce domain prefix folders project-wide
- Generalize sibling domain prefix linting beyond tests - Move create icon tools under the existing create domain folder - Keep create.ts exporting the icon tools through the domain folder
This commit is contained in:
parent
aad26b535e
commit
dfa9505805
|
|
@ -1167,10 +1167,10 @@ const noTopLevelPrefixedTestFiles = createProgramFilenameRule({
|
|||
}
|
||||
})
|
||||
|
||||
const noSiblingDomainPrefixedTestFiles = createProgramFilenameRule({
|
||||
description: 'Disallow test files that repeat an existing sibling domain folder as a filename prefix',
|
||||
const noSiblingDomainPrefixedFiles = createProgramFilenameRule({
|
||||
description: 'Disallow files that repeat an existing sibling domain folder as a filename prefix',
|
||||
check(file) {
|
||||
const match = file.match(/^(.*\/tests\/(?:engine|e2e)\/.+\/)([^/]+)-[^/]+\.(?:test|spec)\.ts$/)
|
||||
const match = file.match(/^(.*\/)([^/]+)-[^/]+\.(?:test\.)?(?:spec\.)?(?:ts|tsx|vue)$/)
|
||||
if (!match) return false
|
||||
|
||||
const [, dir, prefix] = match
|
||||
|
|
@ -1243,7 +1243,7 @@ const plugin = {
|
|||
'no-function-alias-imports': noFunctionAliasImports,
|
||||
'no-flat-kiwi-modules': noFlatKiwiModules,
|
||||
'no-top-level-prefixed-test-files': noTopLevelPrefixedTestFiles,
|
||||
'no-sibling-domain-prefixed-test-files': noSiblingDomainPrefixedTestFiles
|
||||
'no-sibling-domain-prefixed-files': noSiblingDomainPrefixedFiles
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@
|
|||
"open-pencil/no-component-root-sibling-folder": "error",
|
||||
"open-pencil/no-flat-kiwi-modules": "error",
|
||||
"open-pencil/no-top-level-prefixed-test-files": "error",
|
||||
"open-pencil/no-sibling-domain-prefixed-test-files": "error"
|
||||
"open-pencil/no-sibling-domain-prefixed-files": "error"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export { createPage, createShape, createSlice } from './create/basic'
|
||||
export { createComponent, createInstance } from './create/components'
|
||||
export { fetchIconsTool, insertIcon, searchIconsTool } from './create-icons'
|
||||
export { fetchIconsTool, insertIcon, searchIconsTool } from './create/icons'
|
||||
export { render } from './create/render'
|
||||
export { importSvg } from './create/svg'
|
||||
export { createVector } from './create/vector'
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import { parseColor } from '#core/color'
|
||||
import { fetchIcons, searchIconsBatch } from '#core/icons'
|
||||
import { createIconFromPaths } from '#core/icons/render'
|
||||
|
||||
import { defineTool } from './schema'
|
||||
import { defineTool } from '#core/tools/schema'
|
||||
|
||||
export const fetchIconsTool = defineTool({
|
||||
name: 'fetch_icons',
|
||||
Loading…
Reference in a new issue