diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index effa6bf..85e4e79 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,7 @@ jobs: if: ${{ contains(github.event.head_commit.message, '[publish]') }} steps: - uses: actions/checkout@v3 - - uses: oven-sh/setup-bun@v0.1.8 + - uses: oven-sh/setup-bun@v1 - run: bun install - run: bun ci - uses: ArnaudBarre/npm-publish@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index ee59de3..38e19a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.3.5 + +Ignore stories files (`*.stories.*`) (Fixes #10) + ## 0.3.4 Report default CallExpression exports (#7) (Fixes #6) diff --git a/package.json b/package.json index 4fff364..bd35075 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "eslint-plugin-react-refresh", - "version": "0.3.4", + "version": "0.3.5", "license": "MIT", "scripts": { "build": "scripts/bundle.ts", "prettier": "bun prettier-ci --write", "prettier-ci": "prettier --ignore-path=.gitignore --check '**/*.{ts,json,md,yml}'", "test": "src/tests.ts", - "ci": "tsc && bun prettier-ci && bun test && bun run build" + "ci": "tsc && bun prettier-ci && bun run test && bun run build" }, "prettier": { "trailingComma": "all" diff --git a/src/only-export-components.ts b/src/only-export-components.ts index fbeaa26..fc4fd82 100644 --- a/src/only-export-components.ts +++ b/src/only-export-components.ts @@ -43,8 +43,14 @@ export const onlyExportComponents: TSESLint.RuleModule< create: (context) => { const { checkJS } = context.options[0] || { checkJS: false }; const filename = context.getFilename(); - // Skip tests files - if (filename.includes(".test.") || filename.includes(".spec.")) return {}; + // Skip tests & stories files + if ( + filename.includes(".test.") || + filename.includes(".spec.") || + filename.includes(".stories.") + ) { + return {}; + } const shouldScan = filename.endsWith(".jsx") || filename.endsWith(".tsx") ||