Skip to content

Commit

Permalink
Ignore test files (Fixes #2) [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Dec 14, 2022
1 parent 1fa35f4 commit e0d3e28
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: xhyrom/setup-bun@v0.1.8
- run: bun install
- run: bun ci
- uses: ArnaudBarre/npm-publish@v1.1
- uses: ArnaudBarre/npm-publish@v1
with:
working-directory: dist
npm-token: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.3.2

Ignore test files (`*.test.*`, `*.spec.*`) (Fixes #2)

## 0.3.1

Allow numbers in component names (Fixes #1)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-refresh",
"version": "0.3.1",
"version": "0.3.2",
"license": "MIT",
"scripts": {
"build": "scripts/bundle.ts",
Expand Down
9 changes: 8 additions & 1 deletion src/only-export-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ export const onlyExportComponents: TSESLint.RuleModule<
},
defaultOptions: [],
create: (context) => {
if (!context.getFilename().endsWith("x")) return {};
const filename = context.getFilename();
if (
!filename.endsWith("x") ||
filename.includes(".test.") ||
filename.includes(".spec.")
) {
return {};
}

return {
Program(program) {
Expand Down

0 comments on commit e0d3e28

Please sign in to comment.