Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions .changeset/add-eslint-plugin-depend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saleor/eslint-config-apps": minor
---

Added eslint-plugin-depend with the `depend/ban-dependencies` rule. ESLint will now report an error when code imports redundant packages (e.g. lodash, moment, axios) that have native or better-maintained alternatives.
Comment thread
Copilot marked this conversation as resolved.
Outdated
14 changes: 14 additions & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import saleorPlugin from "@saleor/eslint-plugin-saleor-app";
import stylisticPlugin from "@stylistic/eslint-plugin";
import vitestPlugin from "@vitest/eslint-plugin";
import eslintConfigPrettier from "eslint-config-prettier/flat";
import dependPlugin from "eslint-plugin-depend";
import importPlugin from "eslint-plugin-import";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
Expand All @@ -28,6 +29,19 @@ export const config = [
name: "@saleor/eslint-config-apps/ignores",
ignores: [".next/**/*", "coverage/**/*", "**/generated/**/*", "next-env.d.ts"],
},
/**
* Dependencies - suggests better alternatives for redundant packages
*/
{
name: "@saleor/eslint-config-apps/depend",
files: ["**/*.{js,ts,tsx}"],
plugins: {
depend: dependPlugin,
},
rules: {
"depend/ban-dependencies": "error",
},
},
/**
* Graphql
*/
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@vitest/eslint-plugin": "1.1.38",
"eslint": "catalog:",
"eslint-config-prettier": "10.1.1",
"eslint-plugin-depend": "1.5.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-neverthrow-must-use": "0.1.2",
"eslint-plugin-react": "7.37.4",
Expand Down
26 changes: 26 additions & 0 deletions pnpm-lock.yaml

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

Loading