Problem/Motivation
In 2017 in #2865971: Use stylelint as opposed to csslint in core we introduced stylelint as the successor to csslint. We are still scaffolding a csslint config file into end user sites, 8 years on from this - and I just can't imagine that anyone is still using it.
Similarly we are shipping .eslintrc.json and .eslintignore into end user sites. When we upgrade to ESLint v9 in #3440225: Update to ESLint v9 with standard rules then these files will have to change as the ESLint config format has changed. But I also can't see that any real sites are actually using this, given they would have to manually install ESLint and the correct set of plugins - any sites I have worked on have their own linting config in the theme or the root of the repo.
If users want to continue to extend the ESLint config from core they are free to do so, but we shouldn't scaffold these files into the root of every install just in case.
Proposed resolution
Remove these files from the scaffold in Drupal 12.
Remaining tasks
Get signoff on this change.
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Issue fork drupal-2876298
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2876298-remove-scaffolded-csslint
changes, plain diff MR !13895
Comments
Comment #2
xjmComment #3
mile23Drupal core has a few different places to look for .[something]rc files.
In
DRUPAL_ROOTwe have:In
DRUPAL_ROOT/corewe have:Do we have related issues to deal with eslint config?
.stylelintrc.jsonseems to be setting a pattern that this sort of config file will be incore/.From a drupalci standpoint, it makes the most sense to have these dotfiles (and, for instance, package.json) in
core/. That's fewer use-cases per tool.Also, if core doesn't support the csslint tool, it's hard to make a case for supporting it in the testbot.
Comment #5
andypostI faced few days ago with issue in CI when theme (zen based) failed to build because it was not inside of Drupal.
That caused by http://eslint.org/docs/user-guide/configuring#configuration-cascading-an...
So removal of config files from root can cause a storm of failures
Comment #6
joelpittet@andypost could we remove it in a minor version with a change record for people to add it back in?
Comment #8
andypost@joelpittet sure it just needs change record
Comment #13
lauriiiI opened an issue to disable CSSLint in the Drupal core DrupalCI builds: #3166360: Disable csslint testing in core. After that, next step is to decide how to remove the file.
Comment #14
andypostAs related commited the removal is straight
Comment #21
longwaveReviving this after rediscovering these config files in #3440225: Update to ESLint v9 with standard rules
Given that there has been no activity here for 5 years and CSSLint is obsolete I think we should definitely drop the csslintrc file.
I also think we should do the same for the ESLint config files. Sites can still choose to extend core's configuration if they want to, but I suspect that almost all sites have their own package.json and lint config, be it across an entire project or at the theme or module level. We don't need to be opinionated here on their behalf.
Comment #22
jonathan1055 commentedJust wondering if
core/.eslintrc.passing.jsonandcore/.eslintrc.jquery.jsonthe files you are refering to? These are used in Contrib testing via Gitlab TemplatesComment #23
longwaveNo, but those are going to have to change when we upgrade to ESLint 9, as the config file format has changed. Discussion of that is welcome over in #3440225: Update to ESLint v9 with standard rules as we will need to coordinate with the contrib CI templates over there.
I am referring to the files in
assets/scaffold/files, which are scaffolded to the root of all Drupal installs via the scaffold plugin in composer.json.Comment #24
longwaveLet's repurpose this issue a bit and get the ball rolling.
Comment #26
longwaveComment #27
longwaveLet's try to get some signoffs on this.
Personally I think that if you are using ESLint it is up to you to configure it; we don't provide a scaffolded package.json so you would need to manually install the correct set of plugins anyway to make the configuration work if you are using this - I just can't see that anyone is actually using these files in a real site.
Comment #28
longwaveRewrote the IS with the latest proposal.
Comment #29
fjgarlin commentedCreated #3559584: Move some scaffolding files for linting jobs from core to the assets folder for Contrib CI.
Comment #30
smustgrave commentedComment #31
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #33
longwaveComment #34
smustgrave commentedThis one would need a rebase but it would be really nice to get this into main so we can work in it for a few months before 12.x is cut.
Comment #35
smustgrave commentedComment #36
andypostIS needs update as tags, csslint is obsolete but jslint is not clear, needs CR and release notes as #5
Comment #37
quietone commentedAdded this to the 'other' section of #3449808: [12.x] [meta] Requirements for tagging 12.0.0-beta1
Comment #38
xjm@quietone, @godotislate, and I all agreed on making this change, and since @longwave made the MR his support is implicit as well.
What a happy MR with happy red lines everywhere!
Comment #39
quietone commentedComment #40
longwaveThis is probably a bug report now, because since #3440225: Update to ESLint v9 with standard rules the scaffolded ESLint config doesn't work; bumping to major because of this. The csslint config is also dead, so I think this should just all be removed.
Added a CR: https://www.drupal.org/node/3621537
Comment #41
nod_That's ok with me, always been a pain to make use of core rules on projects, and folks usually set that at the theme level anyway. Not quite sure on all the scaffold changes so won't RTBC.
Comment #42
godotislatelgtm
Comment #43
alexpott#3559584: Move some scaffolding files for linting jobs from core to the assets folder is still not done - will we break contrib testing?
Comment #44
neclimdul"any sites I have worked on have their own linting config in the theme or the root of the repo."
I mean, we have to since core's was basically impossible to use for several years now waiting on #3440225: Update to ESLint v9 with standard rules. But I was following this thread of issues to hopefully fix that so... is the expectation that sites following core style/lint rules for custom development would pull from Gitlab templates too? Or would they be responsible for manually syncing changes with Core? Or just on their own and can't really follow core like we can for other tools?
Comment #45
longwaveCore's rules are still shipped inside the
coredirectory so I think you should be able to refer to those. Documenting how to reuse the config, or making it work in the contrib templates, would be useful if someone can do that, but I think it's separate to this issue even if it is adjacent to it.The only change here is the removal of the files scaffolded into the root directory of sites.
Comment #46
catchCommitted/pushed to main, thanks!