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

fix: 🐛 remove imports patch from previous plugin #73

Merged
merged 2 commits into from
Nov 8, 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
23 changes: 0 additions & 23 deletions src/configs/imports.spec.ts

This file was deleted.

21 changes: 3 additions & 18 deletions src/configs/imports.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { ESLint, Linter } from "eslint";

import importX from "eslint-plugin-import-x";
import nodePlugin from "eslint-plugin-n";

import type { TypescriptOptions } from "../types";
import type { TypedConfigItem, TypescriptOptions } from "../types";

import { importsRules } from "../rules/imports";

Expand All @@ -28,26 +26,13 @@ export const importsConfig = ({
}: ImportsConfigOptions = {}) => {
return [
{
languageOptions: {
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
name: "jimmy.codes/imports",
plugins: {
// TODO: remove unknown conversion
"import-x": importX as unknown as ESLint.Plugin,
"import-x": importX,
"n": nodePlugin,
},
rules: importsRules,
// https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561
settings: {
"import-x/parsers": {
espree: [".js", ".cjs", ".mjs", ".jsx"],
},
},
},
...(typescript ? [typescriptImports] : []),
] satisfies Linter.Config[];
] satisfies TypedConfigItem[];
};
4 changes: 2 additions & 2 deletions src/configs/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Linter } from "eslint";
import type { TypedConfigItem } from "../types";

import { javascriptRules } from "../rules/javascript";

Expand All @@ -11,5 +11,5 @@ export const javascriptConfig = () => {
name: "jimmy.codes/javascript",
rules: javascriptRules,
},
] satisfies Linter.Config[];
] satisfies TypedConfigItem[];
};
6 changes: 3 additions & 3 deletions src/configs/node.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Linter } from "eslint";

import nodePlugin from "eslint-plugin-n";

import type { TypedConfigItem } from "../types";

import { nodeRules } from "../rules/node";

export const nodeConfig = () => {
Expand All @@ -13,5 +13,5 @@ export const nodeConfig = () => {
},
rules: nodeRules,
},
] satisfies Linter.Config[];
] satisfies TypedConfigItem[];
};