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
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
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:import/typescript",
"prettier"
],
"plugins": [
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion 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 @@ -27,6 +27,7 @@
"install": "node-gyp-build",
"prebuild": "prebuildify --napi --strip --target=16.14.2",
"build": "rimraf ./dist && tsc -p ./tsconfig.build.json",
"postversion": "npm install --package-lock-only --ignore-scripts --silent",
"ts-node": "ts-node -r tsconfig-paths/register",
"test": "jest",
"lint": "eslint '{src,tests}/**/*.{js,ts}'",
Expand Down
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();
}
}

Expand Down
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();
}
}

Expand Down