Skip to content

Commit 2465664

Browse files
authored
Merge pull request #10 from dev-five-git/allow-class
Allow class
2 parents 036c849 + 0127685 commit 2465664

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.changeset/tasty-carpets-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-devup": patch
3+
---
4+
5+
Allow export default

src/rules/component/__tests__/index.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ describe('component rule', () => {
2323
code: 'export default function IndexPage(){return <Row><Col></Col></Row>}',
2424
filename: 'src/app/page.tsx',
2525
},
26+
{
27+
code: 'export default function Hello(){return <Row><Col></Col></Row>}',
28+
filename: 'src/components/Hello.tsx',
29+
},
2630
{
2731
code: 'export default function IndexPage(){return <Row><Col></Col></Row>}',
2832
filename: 'src/app/aaa/bb/cc/page.tsx',

src/rules/component/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export const component = createRule({
8282
const isTargetComponent = (name: string) => name === targetComponentName
8383

8484
return {
85+
ExportDefaultDeclaration() {
86+
ok = true
87+
},
8588
ExportNamedDeclaration(namedExport) {
8689
if (ok) return
8790

0 commit comments

Comments
 (0)