-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
fix(eslint): setup eslint to run on every package - N8N-4553 #4050
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I would expect the npm package name to be
eslint-config-n8n
like others in npm, e.g.eslint-config-airbnb
. Why the@n8n-io/
namespace? Do we want to start publishing under this in future? -
I would simplify the workspace/dir name to
eslint-config
because it is clear from context that it is for n8n and to remain consistent with other workspaces. For example, we usenodes-base
for workspace name andn8n-nodes-base
for npm package name. -
Getting this on
npm run lint
at root:
n8n-design-system:lint: Tried to lint /Users/ivov/Development/n8n/packages/design-system/src/locale/lang/en.js but found no valid, enabled rules for this file type and file path in the resolved configuration.
- Getting also this on
npm run lint
at root:
n8n-nodes-base:lint:
n8n-nodes-base:lint: Oops! Something went wrong! :(
n8n-nodes-base:lint:
n8n-nodes-base:lint: ESLint: 8.23.0
n8n-nodes-base:lint:
n8n-nodes-base:lint: Error: Failed to load plugin 'eslint-plugin-n8n-nodes-base' declared in '.eslintrc.js#overrides[1]': Cannot find module '/Users/ivov/Development/n8n/packages/nodes-base/node_modules/eslint'
n8n-nodes-base:lint: Require stack:
n8n-nodes-base:lint: - /Users/ivov/Development/n8n/node_modules/eslint-docgen/src/rule-tester.js
n8n-nodes-base:lint: - /Users/ivov/Development/n8n/node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/rule.js
n8n-nodes-base:lint: - /Users/ivov/Development/n8n/node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/index.js
n8n-nodes-base:lint: - /Users/ivov/Development/n8n/node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-email-still-default.js
n8n-nodes-base:lint: - /Users/ivov/Development/n8n/node_modules/eslint-plugin-n8n-nodes-base/dist/index.js
n8n-nodes-base:lint: - /Users/ivov/Development/n8n/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
- Getting this when opening TS files:
-
Ticket number in PR description should be 4553.
-
Would it be reasonable to pin the ESLint version so we can very deliberate when upgrading it both here and in the linter? Changes in the ESLint AST have caused linter checks to fail in the past: https://linear.app/n8n/issue/N8N-3968
-
Do you know of a way to detect lint exceptions i.e.
eslint-disable-next-line
that no longer have effect?
We already have the
The current setup with many of our package folder names not being the same as the package name, is an anti-pattern. I'd like us to become more consistent with how other monorepos do this, to reduce confusion for the contributors.
This is coming from tslint. Unrelated to the changes in this PR.
Yeah. this is why the CI is failing. I'm trying to fix it. but in vain so far. It's caused by this weird hack in eslint-docgen.
This is fixed by #4049
👍
👍
not aware of a way. but I can investigate. My plan was to get rid of the most of the |
Does it help if I remove The linter uses If removing it helps, I can do it now and later look into why this is being flagged, maybe related to the issue you linked to. |
I think removing |
8f0dbb8
to
5fdf04c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds fine, runs fine, lints fine. Only minor comments.
1/2. This package name and workspace/dir name moves away from the antipattern but is inconsistent with the convention, so if you can please clear this with Ben or Omar, etc. Unless done already.
-
@vue/eslint-config-standard
is here and inmaster
but not directly specified in.eslintrc.js
. Are we using this plugin somehow? I need to double check this. -
Maybe we should account for
.mjs
files.
Great work!
Good catch. removed. |
Also, unify eslint config and dependencies into a private package in the workspace.
d344110
to
738f641
Compare
Got released with |
…4050) * fix(eslint): setup eslint to run on every package Also, unify eslint config and dependencies into a private package in the workspace.
Also, unify eslint config and dependencies into a private package in the workspace.
I'll separate PRs to remove all the exceptions I had to add to make the linter pass.
Ticket: N8N-4553