Skip to content

Commit

Permalink
fix: make import rules work again
Browse files Browse the repository at this point in the history
  • Loading branch information
atheck committed Nov 1, 2024
1 parent fd99e2e commit 5e7fa49
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 114 deletions.
1 change: 0 additions & 1 deletion complexity.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default [
"**/*.test.js",
"**/*.test.jsx",
],

rules: {
"max-statements": "off",
"max-params": "off",
Expand Down
2 changes: 0 additions & 2 deletions groupImports.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default [
ignoreDeclarationSort: true,
},
],

"import/order": [
"error",
{
Expand All @@ -23,7 +22,6 @@ export default [
"index",
"object",
],

alphabetize: {
order: "asc",
caseInsensitive: true,
Expand Down
4 changes: 3 additions & 1 deletion node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import testingLibrary from "eslint-plugin-testing-library";

// biome-ignore lint/style/noDefaultExport: Required for ESLint
export default [
importPlugin.flatConfigs.typescript,
{
plugins: {
"@stylistic": stylistic,
Expand Down Expand Up @@ -815,7 +816,8 @@ export default [
parser: tsParser,
sourceType: "module",
parserOptions: {
project: "tsconfig.json",
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
Expand Down
4 changes: 3 additions & 1 deletion nodeWithBiome.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import testingLibrary from "eslint-plugin-testing-library";

// biome-ignore lint/style/noDefaultExport: Required for ESLint
export default [
importPlugin.flatConfigs.typescript,
{
plugins: {
"@stylistic": stylistic,
Expand Down Expand Up @@ -730,7 +731,8 @@ export default [
parser: tsParser,
sourceType: "module",
parserOptions: {
project: "tsconfig.json",
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
Expand Down
98 changes: 1 addition & 97 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@typescript-eslint/eslint-plugin": "8.12.2",
"@typescript-eslint/parser": "8.12.2",
"eslint": "9.13.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jest": "28.8.3",
"eslint-plugin-react": "7.37.2",
Expand All @@ -56,4 +55,4 @@
"type": "git",
"url": "https://github.com/atheck/eslint-config-heck.git"
}
}
}
1 change: 0 additions & 1 deletion reactNative.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export default [
plugins: {
"react-native": fixupPluginRules(reactNative),
},

rules: {
"react-native/no-color-literals": "error",
"react-native/no-inline-styles": "error",
Expand Down
19 changes: 12 additions & 7 deletions test/ES6.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// no-duplicate-imports
import { AbstractKeyword } from "typescript";
import { AccessExpression } from "typescript";
// no-useless-rename
import { AmdDependency as AmdDependency } from "typescript";
import defaultExport1 from "./import";

// arrow-body-style
const lambda = () => {
return 0;
Expand Down Expand Up @@ -37,10 +44,6 @@ class DupeMembers {
foo() {}
}

// no-duplicate-imports
import { AbstractKeyword } from "typescript";
import { AccessExpression } from "typescript";

// no-new-symbol: off (handled by typescript)
const newSymbol = new Symbol("symbol");

Expand All @@ -66,9 +69,6 @@ class UselessConstructor {
}
}

// no-useless-rename
import { AmdDependency as AmdDependency } from "typescript";

// no-var
var aVar = null;

Expand Down Expand Up @@ -129,3 +129,8 @@ const noYield = function* () {

// symbol-description
const noDescription = Symbol();

// import/no-cycle
const export1 = defaultExport1;

export { export1 };
7 changes: 5 additions & 2 deletions test/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as unresolved from "not-installed";
const newline = 0;
// import/name: off - handled by Typescript
import { notExisting } from "./ES6";
import { export1, notExisting } from "./ES6";

// import/default: off - handled by Typescript
import Default from "./BestPractices";
Expand All @@ -29,4 +29,7 @@ import { AbstractKeyword } from "typescript";
import { AccessExpression } from "typescript";

// no-empty-named-blocks
import {} from "eslint";
import {} from "eslint";

// no-cycle
const export1a = export1;

0 comments on commit 5e7fa49

Please sign in to comment.