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

Issue fork drupal-2876298

Command icon 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:

Comments

alexpott created an issue. See original summary.

xjm’s picture

Title: Contrib, csslint and stylelint » Contrib, csslint and stylelint (discuss whether to remove .csslint from core)
mile23’s picture

Drupal core has a few different places to look for .[something]rc files.

In DRUPAL_ROOT we have:

.csslintrc
.eslintignore
.eslintrc.json

In DRUPAL_ROOT/core we have:

.eslintignore
.eslintrc.json
.eslintrc.legacy.json
.stylelintrc.json

Do we have related issues to deal with eslint config?

.stylelintrc.json seems to be setting a pattern that this sort of config file will be in core/.

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.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

I 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...

By default, ESLint will look for configuration files in all parent folders up to the root directory.

So removal of config files from root can cause a storm of failures

joelpittet’s picture

@andypost could we remove it in a minor version with a change record for people to add it back in?

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

@joelpittet sure it just needs change record

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

lauriii’s picture

I 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.

andypost’s picture

As related commited the removal is straight

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Reviving 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.

jonathan1055’s picture

I think we should definitely drop the csslintrc file.
I also think we should do the same for the ESLint config files.

Just wondering if core/.eslintrc.passing.json and core/.eslintrc.jquery.json the files you are refering to? These are used in Contrib testing via Gitlab Templates

longwave’s picture

No, 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.

longwave’s picture

Title: Contrib, csslint and stylelint (discuss whether to remove .csslint from core) » Remove scaffolded csslint and eslint config
Category: Plan » Task

Let's repurpose this issue a bit and get the ball rolling.

longwave’s picture

Status: Active » Needs review
longwave’s picture

Let'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.

longwave’s picture

Issue summary: View changes
Issue tags: +Needs change record

Rewrote the IS with the latest proposal.

fjgarlin’s picture

smustgrave’s picture

Issue tags: +Drupal 12
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

longwave’s picture

Title: Remove scaffolded csslint and eslint config » [12.x] Remove scaffolded csslint and eslint config
Status: Needs work » Needs review
smustgrave’s picture

This 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.

smustgrave’s picture

Status: Needs review » Needs work
andypost’s picture

IS needs update as tags, csslint is obsolete but jslint is not clear, needs CR and release notes as #5

quietone’s picture

Title: [12.x] Remove scaffolded csslint and eslint config » Remove scaffolded csslint and eslint config
Issue tags: -Drupal 12
xjm’s picture

@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!

quietone’s picture

Status: Needs work » Needs review
longwave’s picture

Priority: Normal » Major
Issue tags: -Needs change record

This 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

nod_’s picture

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.

godotislate’s picture

Status: Needs review » Reviewed & tested by the community

lgtm

alexpott’s picture

neclimdul’s picture

"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?

longwave’s picture

Core's rules are still shipped inside the core directory 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.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to main, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed 788924b8 on main
    task: #2876298 Remove scaffolded csslint and eslint config
    
    By: alexpott...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.