Skip to content

Commit

Permalink
instsall vitest eslint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
lkostrowski committed Nov 29, 2024
1 parent 8960682 commit 4a1d082
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apps/avatax/src/modules/avatax/address-factory.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it, Mock, vi } from "vitest";

import { avataxAddressFactory } from "./address-factory";

Expand Down
21 changes: 19 additions & 2 deletions packages/eslint-config-saleor/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
module.exports = {
extends: ["next", "turbo", "prettier", "plugin:@saleor/saleor-app/recommended"],
extends: [
"next",
"turbo",
"prettier",
"plugin:@saleor/saleor-app/recommended",
/*
* After upgrade to eslint 9 config should be updated
* https://github.com/vitest-dev/eslint-plugin-vitest/tree/main?tab=readme-ov-file#usage
*
* This is disabled, because it seems not to work, despite being set up just like in docs
* Some rules are applied manually in "rules" section - they work.
*
* TODO: Once we upgrade Vitest and ESLint, try to set up everything again with non-legacy approach
*/
// "plugin:@vitest/legacy-recommended",
],
parser: "@typescript-eslint/parser",
plugins: ["simple-import-sort"],
plugins: ["simple-import-sort", "@vitest"],
rules: {
"import/order": "off", // to avoid conflicts with simple-import-sort
"import/first": "warn",
Expand All @@ -13,6 +28,8 @@ module.exports = {
"@next/next/no-html-link-for-pages": "off",
"react/jsx-key": "off",
"newline-after-var": "warn",
"@vitest/prefer-strict-equal": "warn",
"@vitest/prefer-vi-mocked": "warn",
"multiline-comment-style": ["warn", "starred-block"],
"no-restricted-imports": [
"error",
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config-saleor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"eslint-plugin-react": "7.34.3",
"eslint-plugin-simple-import-sort": "12.1.1",
"next": "14.2.3",
"typescript": "5.5.4"
"typescript": "5.5.4",
"@vitest/eslint-plugin": "1.1.12"
},
"license": "MIT",
"main": "index.js",
Expand Down
69 changes: 52 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4a1d082

Please sign in to comment.