Skip to content

Commit

Permalink
Ignore stories files (fixes #10) [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Apr 27, 2023
1 parent ac7ecec commit ddb0dd2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions 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)
Expand Down
4 changes: 2 additions & 2 deletions 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"
Expand Down
10 changes: 8 additions & 2 deletions src/only-export-components.ts
Expand Up @@ -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") ||
Expand Down

0 comments on commit ddb0dd2

Please sign in to comment.