Open kosiakMD opened 8 months ago
I struggled too, but if you define a full path for src in the local folder, it works fine. I manage our monorepo libs folder with a script to update everything everywhere https://gist.github.com/roderik/c83efef5412b7bbd7d76329c02a28338 (specific to us, do not just copy it, but the logic to get the path and update the files is usable
i don't use NX sorry. I imagine it does all sorts of things with caching and file locations. If you get a chance to investigate and fix with a PR, it would help all nx users.
otherwise you should able to turn off this rule with '@darraghor/nestjs-typed/injectable-should-be-provided': "off"
Big thanks to @roderik, so as i understand we can add next:
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["**/*.ts"],
"extends": ["plugin:@darraghor/nestjs-typed/recommended"],
"plugins": ["@darraghor/nestjs-typed"],
"rules": {
"@darraghor/nestjs-typed/injectable-should-be-provided": [
"error",
{
"src": ["apps/server/src/**/*.ts"],
"filterFromPaths": ["node_modules"]
}
]
},
"parserOptions": {
"project": ["apps/server/tsconfig.*?.json"]
}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
Where apps/server
path to your module.
Also i think it could be added to basic docs, because it is not obvious.
Big thanks to @roderik, so as i understand we can add next:
{ "extends": ["../../.eslintrc.json"], "ignorePatterns": ["!**/*"], "overrides": [ { "files": ["**/*.ts"], "extends": ["plugin:@darraghor/nestjs-typed/recommended"], "plugins": ["@darraghor/nestjs-typed"], "rules": { "@darraghor/nestjs-typed/injectable-should-be-provided": [ "error", { "src": ["apps/server/src/**/*.ts"], "filterFromPaths": ["node_modules"] } ] }, "parserOptions": { "project": ["apps/server/tsconfig.*?.json"] } }, { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": {} }, { "files": ["*.ts", "*.tsx"], "rules": {} }, { "files": ["*.js", "*.jsx"], "rules": {} } ] }
Where
apps/server
path to your module.Also i think it could be added to basic docs, because it is not obvious.
Do you use this in a commercial settings? If so can you get some of your paid time to submit a PR to update docs? š
"@darraghor/eslint-plugin-nestjs-typed": "^4.4.0",
either files not found or are ignored - blocks other rules to go forward even with warn
ALSO:
I have next rule:
and got next error
--verbose add stacktrace, here is first lines: