Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Allow using PostCSS config #3

Merged
merged 12 commits into from Nov 2, 2020
Merged

Allow using PostCSS config #3

merged 12 commits into from Nov 2, 2020

Conversation

jarrodldavis
Copy link
Owner

Closes #2

  • Update tests:
    • Patch ESLint with New: Allow mocking the cwd in rule tester eslint/eslint#12443 to allow mocking current working directory (CWD) per test case
    • Update test discovery to set the CWD to the fixture root
    • Move default config test fixtures into approprirate directory
    • Add tests for new PostCSS config behavior
    • Prime class cache per test-suite instead of globally
  • Update plugin:
    • Allow using a PostCSS config to load additional plugins, which may be needed to pickup additional component or utility classes
    • Improve input validation of class extractor using ajv
    • Invalidate class cache when the input stylesheet is re-saved even if contents haven't changed
      • This allows for a workaround in long-running ESLint processes (e.g. in editors) to pickup changed classes in @import-ed stylesheets

allow mocking `cwd` in `RuleTester` test cases.

Patch based on this pull request:
eslint/eslint#12443
- add missing plugins
- use interoperable config format
- use `cwd` option in test case
- increase timeout
- don't printout stderr from `extract-classes-bin`
- split out postcss tests from default config tests
- when loading test cases, add an additional test to prime the class
  cache for the upcoming test suite
- remove custom timeout and lower slow test threshold back to 150
  milliseconds
this allows for a workaround for not picking up changes from
`@import`-ed stylesheets
@jarrodldavis jarrodldavis added this to In progress in Progress Board Nov 2, 2020
@jarrodldavis jarrodldavis merged commit 8151bf8 into main Nov 2, 2020
Progress Board automation moved this from In progress to Done Nov 2, 2020
@jarrodldavis jarrodldavis deleted the postcss-config branch November 2, 2020 02:47
@jarrodldavis jarrodldavis added the enhancement New feature or request label Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Use PostCSS config to use configured plugins
1 participant