ESLint with plugin unicorn brakes in a NX monorepo when having packages on a deeper folder level.
It works fine in packages like /libs/first-level
(path @nx-monorepo/first-level
) but throws this error when used in packages like /libs/first-level/second-level
(path @nx-monorepo/first-level/second-level
):
Error: Failed to load plugin 'unicorn' declared in '.eslintrc.json » ../../../.eslintrc.json': Invalid name: "@nx-monorepo/first-level/second-level"
Error: Failed to load plugin 'unicorn' declared in '.eslintrc.json » ../../../.eslintrc.json': Invalid name: "@nx-monorepo/first-level/second-level"
at ensureValidName (/home/xxx/nx-monorepo/node_modules/normalize-package-data/lib/fixer.js:336:15)
at Object.fixNameField (/home/xxx/nx-monorepo/node_modules/normalize-package-data/lib/fixer.js:215:5)
at /home/xxx/nx-monorepo/node_modules/normalize-package-data/lib/normalize.js:32:38
at Array.forEach (<anonymous>)
at normalize (/home/xxx/nx-monorepo/node_modules/normalize-package-data/lib/normalize.js:31:15)
at module.exports.sync (/home/xxx/nx-monorepo/node_modules/read-pkg/index.js:37:36)
at module.exports.sync (/home/xxx/nx-monorepo/node_modules/read-pkg-up/index.js:27:24)
at Object.<anonymous> (/home/xxx/nx-monorepo/node_modules/eslint-plugin-unicorn/rules/expiring-todo-comments.js:50:33)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
I seems to be related to the expiring-todo-comments
rule.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too