question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running Stylelint (SCSS) within github/super-linter ignores configuration

See original GitHub issue

What steps are needed to reproduce the bug?

Hi dear Stylelint maintainers.

Thanks for all your hard work. I’ve been trying to migrate multiple of our projects over to V14 for some time now but I can’t seem to get it to fit into our Github PR Actions workflow anymore. It worked great in V13 before.

Locally it works great when running a command like: npm run stylelint it returns the expected errors but when run trough Github’s Super-linter Action the results seem to ignore our custom rules and complains it needs a customSyntax. I’ve added those as a test but no luck thus far.

I’ve set up a demo repository with a PR that triggers stylelint to simulate the issue here: https://github.com/mutschelknauss/lintertest/runs/4818424661?check_suite_focus=true

What Stylelint configuration is needed to reproduce the bug?

{
  "extends": ["stylelint-config-standard-scss"],
  "customSyntax": "postcss-scss",
  "rules": {
    "selector-class-pattern": null
  }
}

Also tried without the “customSyntax” but it doesn’t seem to change anything.

My super-linter config:

name: PR Linter

#############################
# Start the job on all push #
#############################
on:
  push:
    branches-ignore: [main]
    # Remove the line above to run when pushing to master

###############
# Set the Job #
###############
jobs:
  build:
    # Name the Job
    name: Lint Code Base
    # Set the agent to run on
    runs-on: ubuntu-latest

    ##################
    # Load all steps #
    ##################
    steps:
      ##########################
      # Checkout the code base #
      ##########################
      - name: Checkout Code
        uses: actions/checkout@v2
        with:
          # Full git history is needed to get a proper list of changed files within `super-linter`
          fetch-depth: 0

      ################################
      # Run Linter against code base #
      ################################
      - name: Lint Code Base
        uses: docker://github/super-linter:v4
        env:
          VALIDATE_ALL_CODEBASE: false
          VALIDATE_CSS: true
          DEFAULT_BRANCH: main
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How did you run Stylelint?

running trough github/super-linter as a github action

Which version of Stylelint are you using?

‘^14.2.0’

What did you expect to happen?

I would expect my custom rules to apply and the Expected class selector to be kebab-case selector-class-pattern to not come up similar to how my locally ran stylelint output.

What actually happened?

If i run npm run stylelint I get:

> lintertest@0.1.0 stylelint
> stylelint "**/*.scss"

scss/test.scss
 4:3  ✖  Expected shorthand property "flex-flow"  declaration-block-no-redundant-longhand-properties

But when it’s run on inside GitHub super-linter the same command gives me:

2022-01-14 14:36:24 [ERROR]   Found errors in [stylelint] linter!
2022-01-14 14:36:24 [ERROR]   Error code: 2. Command output:
------
/github/workspace/scss/test.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option

scss/test.scss
1:1  ✖  Expected class selector to be kebab-case  selector-class-pattern                            
5:1  ✖  Expected class selector to be kebab-case  selector-class-pattern                            
8:3  ✖  Expected shorthand property "flex-flow"   declaration-block-no-redundant-longhand-properties
------

Does the bug relate to non-standard syntax?

Yes its related to SCSS support in V14

Proposal to fix the bug

I hope it’s a configuration issue

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mutschelknausscommented, Jan 14, 2022

Thanks for the support, fingers crossed Super-linter agree’s

0reactions
ybiquitouscommented, Jan 14, 2022

Shall i close this issue here then?

Yes, please!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running Stylelint (SCSS) within github/super-linter ignores ...
This was plaguing me as well. In my case it was because I had the Stylelint config ( .stylelintrc.json ) at the repo...
Read more >
Add postcss-scss package to support .SCSS in Stylelint's V14
With the new V14 release of Stylelint it only supports CSS out of the box. As the migration guide mentions here, SCSS support...
Read more >
Configuration | Stylelint
Stylelint uses cosmiconfig to find and load your configuration object. Starting from the current working directory, it looks for the following possible sources:....
Read more >
Running Stylelint Scss Within Github/Superlinter Ignores ... - ADocLib
A mighty modern linter that helps you avoid errors and enforce conventions in your styles.Features.It's mighty as it: has over 170 builtin rules...
Read more >
Code Linting for Web Designers - Cloud Four
For example, in CSS, the linter keeps our rules sorted ... even add the GitHub Super Linter, a GitHub Action that will run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found