Skip to content

Commit

Permalink
eslint plugin paths
Browse files Browse the repository at this point in the history
  • Loading branch information
nirtamir2 committed Sep 24, 2024
1 parent 5b3c14a commit 5b51aac
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-no-use-extend-native": "0.7.2",
"eslint-plugin-optimize-regex": "^1.2.1",
"eslint-plugin-paths": "^1.0.8",
"eslint-plugin-perfectionist": "^3.7.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-sonarjs": "^2.0.2",
Expand Down
51 changes: 51 additions & 0 deletions pnpm-lock.yaml

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

14 changes: 13 additions & 1 deletion src/configs/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import expectType from "eslint-plugin-expect-type/configs/recommended";
import process from "node:process";
import tseslint from "typescript-eslint";
import { GLOB_ASTRO_TS, GLOB_MARKDOWN, GLOB_TS, GLOB_TSX } from "../globs";
import { pluginAntfu, pluginSortDestructureKeysTypescript } from "../plugins";
import {
eslintPluginPaths,
pluginAntfu,
pluginSortDestructureKeysTypescript,
} from "../plugins";
import type {
OptionsComponentExts,
OptionsFiles,
Expand Down Expand Up @@ -102,6 +106,7 @@ export async function typescript(
// Install the plugins without globs, so they can be configured separately.
name: "antfu/typescript/setup",
plugins: {
paths: eslintPluginPaths,
antfu: pluginAntfu,
"sort-destructure-keys-typescript": pluginSortDestructureKeysTypescript,
// "@typescript-eslint": pluginTs as any,
Expand Down Expand Up @@ -486,6 +491,13 @@ export async function typescript(
"array-callback-return": "off", // https://github.com/typescript-eslint/typescript-eslint/issues/2841 - false positive with TypeScript
},
},
{
name: "nirtamir2/typescript/paths",
files,
rules: {
"paths/alias": "error",
},
},
isTypeAware ? [] : tseslint.configs.disableTypeChecked,
{
name: "nirtamir2/typescript/overrides",
Expand Down
1 change: 1 addition & 0 deletions src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export { default as js } from "@eslint/js";
export { default as confusingBrowserGlobals } from "confusing-browser-globals";
export { default as arrayFunc } from "eslint-plugin-array-func";
export { default as eslintPluginNoUseExtendNative } from "eslint-plugin-no-use-extend-native";
export { default as eslintPluginPaths } from "eslint-plugin-paths";
export { default as eslintConfigPrettier } from "eslint-config-prettier";

0 comments on commit 5b51aac

Please sign in to comment.