Skip to content
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

custom-property-pattern rule changed for compatibility with WP naming #2539

Merged
merged 4 commits into from
Jan 9, 2024

Conversation

cawa-93
Copy link
Contributor

@cawa-93 cawa-93 commented Jan 3, 2024

Type of change

MAJOR: breaking change
fix #2538

@kellymears
Copy link
Member

kellymears commented Jan 3, 2024

We will want to make this change here, because it is a WordPress specific rule and should not be applied to everyone using sass with bud.js.

https://github.com/roots/bud/tree/main/sources/%40roots/bud-preset-wordpress/config/stylelint.cjs#L1-L8

@cawa-93
Copy link
Contributor Author

cawa-93 commented Jan 7, 2024

@kellymears moved

@kellymears kellymears self-assigned this Jan 8, 2024
@kellymears
Copy link
Member

kellymears commented Jan 8, 2024

Okay, I ran some tests on this and it's looking good.

Can you add the following test to @sources/@roots/bud-preset-wordpress/test/stylelint-config.test.ts?

import * as stylelint from 'stylelint'
import {describe, expect, it} from 'vitest'

describe(`@roots/bud-preset-wordpress/stylelint`, () => {
  it(`should error without rule`, async () => {
    const result = await stylelint.lint({
      code: `
        .foo {
          color: var(--wp--preset--color--primary);
        }
      `,
      config: {
        extends: [
          `@roots/bud-sass/stylelint-config`,
        ],
      },
    })

    expect(result.errored).toBe(true)
  })

  it(`should not error with rule`, async () => {
    const result = await stylelint.lint({
      code: `
        .foo {
          color: var(--wp--preset--color--primary);
        }
      `,
      config: {
        extends: [
          `@roots/bud-sass/stylelint-config`,
          `@roots/bud-preset-wordpress/stylelint`,
        ],
      },
    })

    expect(result.errored).toBe(false)
  })
})

@github-actions github-actions bot added the test label Jan 8, 2024
@kellymears kellymears added the 🚀! automerge label Jan 9, 2024
@kodiakhq kodiakhq bot merged commit 07083aa into roots:main Jan 9, 2024
8 checks passed
@kellymears
Copy link
Member

thank you very much!

@cawa-93 cawa-93 deleted the patch-1 branch January 9, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test 🚀! automerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] bud-sass/stylelint-config in incompatible with WP naming
2 participants