diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aeecd0c..0096012 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2919d93..856ffa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package.json b/package.json index 87fd362..772d12c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-refresh", - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "scripts": { "build": "scripts/bundle.ts", diff --git a/src/only-export-components.ts b/src/only-export-components.ts index 6511ba3..cb5f09a 100644 --- a/src/only-export-components.ts +++ b/src/only-export-components.ts @@ -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) {