-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
.eslintignore or .eslintrc file breaks javascript linting with wp-scripts #43236
Comments
@TJBriggs
|
@t-hamano - I appreciate the help! The .eslintignore ignores the assets directory that has a different set of build tools and a dist folder, but each block that we add will have its own build folder associated with it. For example we group blocks in two different folders, blocks and child-blocks. From there each block we create goes in one of those two folders. I'm still new to the syntax for ignoring files. Is it possible to ignore all build files within these directories without listing every block that we add? Something like this:
When I add the extends statement you suggested and run
|
I think you need to use a double asterisk:
The latter error requires a separate investigation, but if all you want to do is exclude files, |
@t-hamano I will give this a try, but I do think it would be useful to get the .eslintrc file working if possible. We may need to adjust some linting rules, etc. Any thoughts on the error I'm receiving? |
This will be personal advice, but I will provide a sample of Also, I don't think this issue is a Gutenberg bug, so please allow me to close this issue 🙂 |
Description
I have created a plugin that houses several blocks generated from @wordpress/create-block. The plugin packages are consolidated into a monorepo with Lerna. The wp-scripts commands run fine and I don't have any issues there. However, I would like to ignore a few directories when I run
wp-scripts lint-js
. Here are the things I have tried so far, but have been unsuccessful:.eslintignore
file to the root of my plugin with the following code:When I run
wp-scripts lint-js
again, it just hangs and the linting never completes. Is the syntax incorrect in the.eslintignore
file? Is there a way to get this working properly?.eslintrc
file with the following code:When I run
wp-scripts lint-js
after this update, I get the following error for each of my edit.js and save.js files:Is the .eslintrc file not configured correctly? I've tried adding @babel/eslint-parser as suggested on Stackoverflow, but that just leads to the following error:
error Parsing error: No Babel config file detected
Since I'm using wp-scripts, I didn't think I would need any additional config files to get this going, but maybe I'm wrong.
Any help would be appreciated.
Step-by-step reproduction instructions
Test A
wp-scripts lint-js
.eslintignore
file to the root and ignore the directory created in step-2wp-scripts lint-js
.eslintignore
file has been addedTest B
wp-scripts lint-js
.eslintrc
file to the root and add an ignorePattern for the directory created in step-2wp-scripts lint-js
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: