Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use-storybook-expect: remove auto fix suggestion #165

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
- name: Prepare repository
run: git fetch --unshallow --tags

- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
run_install: true

- name: Create Release
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
- uses: actions/checkout@v2


- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
run_install: true

- name: Run tests
Expand Down
21 changes: 2 additions & 19 deletions lib/rules/use-storybook-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export = createStorybookRule<TDefaultOptions, string>({
hasSuggestions: true,
schema: [],
docs: {
description: 'Use expect from `@storybook/jest`',
description: 'Use expect from `@storybook/test` or `@storybook/jest`',
categories: [CategoryId.ADDON_INTERACTIONS, CategoryId.RECOMMENDED],
recommended: 'error',
},
messages: {
updateImports: 'Update imports',
useExpectFromStorybook:
'Do not use expect from jest directly in the story. You should use from `@storybook/jest` instead.',
'Do not use global expect directly in the story. You should import it from `@storybook/test` or `@storybook/jest` instead.',
},
},

Expand Down Expand Up @@ -82,23 +82,6 @@ export = createStorybookRule<TDefaultOptions, string>({
context.report({
node,
messageId: 'useExpectFromStorybook',
fix: function (fixer) {
return fixer.insertTextAfterRange(
[0, 0],
"import { expect } from '@storybook/jest';\n"
)
},
suggest: [
{
messageId: 'updateImports',
fix: function (fixer) {
return fixer.insertTextAfterRange(
[0, 0],
"import { expect } from '@storybook/jest';\n"
)
},
},
],
})
})
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
"ts-dedent": "^2.2.0"
},
"devDependencies": {
"@auto-it/released": "^11.0.4",
"@auto-it/released": "^11.2.1",
"@types/eslint": "^8.56.2",
"@types/jest": "^29.5.12",
"@types/node": "^18.19.17",
"@types/requireindex": "^1.2.4",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"auto": "^11.0.4",
"auto": "^11.2.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-plugin": "^5.3.0",
Expand Down
Loading
Loading