Skip to content

Commit

Permalink
add eslint-plugin-depend checking
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsounet committed Jan 10, 2025
1 parent d51acc9 commit f9cd2bd
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
11 changes: 8 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import globals from "globals";
import eslintPluginStylistic from "@stylistic/eslint-plugin";
import eslintPluginDepend from "eslint-plugin-depend";
import eslintPluginImport from "eslint-plugin-import";
import eslintPluginJs from "@eslint/js";
import eslintPluginPackageJson from "eslint-plugin-package-json/configs/recommended";

const config = [
eslintPluginDepend.configs["flat/recommended"],
eslintPluginImport.flatConfigs.recommended,
eslintPluginJs.configs.recommended,
{
Expand Down Expand Up @@ -83,7 +85,8 @@ const config = [
"one-var": "off",
"prefer-destructuring": "off",
"prefer-template": "error",
"sort-keys": "off"
"sort-keys": "off",
"depend/ban-dependencies": ["error", {"allowed": ["moment"]}]
}
},
{
Expand All @@ -103,15 +106,17 @@ const config = [
"@stylistic/indent": ["error", 2],
"@stylistic/array-element-newline": "off",
"@stylistic/function-call-argument-newline": "off",
"import/no-unresolved": "off"
"import/no-unresolved": "off",
"depend/ban-dependencies": ["error", {"allowed": ["eslint-plugin-import"]}]
}
},
{
"files": ["package.json"],
...eslintPluginPackageJson,
"rules": {
...eslintPluginPackageJson.rules,
"package-json/valid-name": "off"
"package-json/valid-name": "off",
"depend/ban-dependencies": ["error", {"allowed": ["eslint-plugin-import"]}]
}
},
{
Expand Down
58 changes: 41 additions & 17 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"devDependencies": {
"@stylistic/eslint-plugin": "^2.12.1",
"eslint": "^9.17.0",
"eslint-plugin-depend": "^0.12.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-package-json": "^0.19.0",
"markdownlint-cli2": "^0.17.1",
Expand Down

0 comments on commit f9cd2bd

Please sign in to comment.