Skip to content

Add new linter for inline CSS #104

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

Closed
wants to merge 6 commits into from
Closed

Conversation

langermank
Copy link

@langermank langermank commented Sep 15, 2023

Copied from @jonrohan in https://github.com/primer/erblint-stylelint

Adds a new linter for inline CSS

  • Find inline style tags
  • Run contents through Stylelint using Primer's config
  • Warn about Primer CSS standards

Closes https://github.com/github/primer/issues/2348

@langermank langermank requested a review from a team as a code owner September 15, 2023 17:18
@smockle smockle requested review from jonrohan and khiga8 September 15, 2023 17:56
@khiga8 khiga8 marked this pull request as draft September 21, 2023 18:14
@khiga8
Copy link
Collaborator

khiga8 commented Sep 21, 2023

Converting to Draft per our Slack chat! Please ping us when this is ready for review!

@jonrohan jonrohan requested a review from a team October 10, 2023 23:20
@primer-css
Copy link

👋 Hello and thanks for pinging us! This issue or PR has been added to our inbox and a Primer first responder will review it soon.

  • 🎨 If this is a PR that includes a visual change, please make sure to add screenshots in the description or deploy this code to a lab machine with instructions for how to test.
  • If this is a PR that includes changes to an interaction, please include a video recording in the description.
  • ⚠️ If this is urgent, please visit us in #primer on Slack and tag the first responders listed in the channel topic.

langermank and others added 3 commits October 19, 2023 21:51
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
@langermank langermank marked this pull request as ready for review November 9, 2023 22:58
Copy link
Collaborator

@khiga8 khiga8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thought to start with - since this lint rule is Primer-specific, could it make sense for this rule to be part of existing ERB linters exported by PVC?

@jonrohan
Copy link
Member

since this lint rule is Primer-specific,

It's not exactly primer specific, we were trying to come up with a way to run stylelint more broadly on style="" attributes which doesn't currently exist. It would be similar to writing a rule to run rubocop rules on ruby found it <% ruby %> erb files, does currently exist.

That's why our first inclination was to put it as a separate repo https://github.com/primer/erblint-stylelint maybe would be useful for the community? 🤷🏻

Copy link
Collaborator

@khiga8 khiga8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonrohan I see!

I notice there's a stylelint config added to this repo, along with a npm install call in the CI step.

If I'm understanding correctly, the consuming application of this rule would have to make sure to install stylelint npm dependencies as a step in their lint workflow, and would also have to provide their own stylelint config in order to run this rule, right? It looks like the setup here doesn't carry over when this rule is called by a consumer, but would appreciate confirmation! This rule is nested under Primer but it seems like it would just use whatever stylelint config is configured by the consuming application?

run: bundle install
run: |
bundle install
npm install
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this npm install call would need to be added as a step in the consuming application, like dotcom?

@@ -0,0 +1,4 @@
{
"extends": ["@primer/stylelint-config"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that the consuming application needs to set their own stylelint config, and that this config is only applicable to the lint runs within this repo?

@langermank
Copy link
Author

Closing as we moved this to dotcom 😄

@langermank langermank closed this Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants