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

WIP: Attempt to bring in import/no-cycle rule to detect import cycles #30

Draft
wants to merge 2 commits into
base: staging
Choose a base branch
from
Draft
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
Prev Previous commit
WIP: attempt to bring in import/no-cycle rule
CMCDragonkai committed May 26, 2022

Verified

This commit was signed with the committer’s verified signature.
commit 83341b9640cab5bcc16e43d62a34f7187a67f80b
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:import/typescript",
"prettier"
],
"plugins": [
@@ -78,6 +79,12 @@
]
}
],
"import/no-cycle": [
"error",
{
"ignoreExternal": true
}
],
"@typescript-eslint/no-namespace": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
4 changes: 4 additions & 0 deletions src/lib/Library.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import NumPair from './NumPair';

class Library {
someParam: string;
num: NumPair;

constructor(someParam = 'Parameter') {
this.someParam = someParam;
this.num = new NumPair();
}
}

4 changes: 4 additions & 0 deletions src/lib/NumPair.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import Library from './Library';

class NumPair {
num1: number;
num2: number;
lib: Library;

constructor(firstNum = 0, secondNum = 0) {
this.num1 = firstNum;
this.num2 = secondNum;
this.lib = new Library();
}
}