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.

PostCSS Conversion Checklist

See original GitHub issue

Starting this issue to track progress on the conversion to using PostCSS.

Misc Tasks:

  • merge linting fixes from master
  • merge changes from #156, when that is merged
  • util module for common operations. see note on then/catch with the parser below.
  • write proper value parser
  • move to postcss-values-parser

Linters:

  • attributeQuotes
  • borderZero
  • comment
  • decimalZero
  • depthLevel
  • duplicateProperty
  • emptyRule
  • finalNewline
  • hexLength
  • hexNotation
  • hexValidation
  • idSelector
  • importantRule
  • importPath
  • propertyOrdering
  • propertyUnits
  • qualifyingElement
  • selectorNaming
  • singleLinePerProperty
  • singleLinePerSelector
  • spaceAfterPropertyColon
  • spaceAfterPropertyName
  • spaceAfterPropertyValue
  • spaceAroundComma
  • spaceAroundOperator
  • spaceBeforeBrace
  • spaceBetweenParens
  • stringQuotes
  • trailingSemicolon
  • trailingWhitespace
  • urlFormat
  • urlQuotes
  • zeroUnit

Then/Catch

Considering the following code:

parser = getParser(source);
parser.then(function (ast) {
  expect(linter.nodeTypes).to.include(ast.root.first.type);
});

If that expect throws an AssertionError, it’s swallowed by the Promise implementation of PostCSS less. So we’ll essentially get a false-positive for the expect result. Found this while implementing new tests for the nodeTypes property in the comments linter. And so we need to have a .catch(...) for every parse operation. And so we need to return the promise for every it(). We already have a ton of copy/paste’d code in the specs, so a small util lib that wraps this for us is reasonable.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
shellscapecommented, Mar 24, 2016

@jwilsson cool. I’ve got the value parser coding portion done, and I’m working on unit tests now that match postcss-value-parser (minus some really weird rules he was allowing, like unmatched parens and quotes).

let’s get you and @kokarn to knock out a few of those remaining linters that don’t rely on property parsing 😉

2reactions
shellscapecommented, Mar 22, 2016

Knocked out 12 of the linters. Will have some more free time towards the weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PostCSS - a tool for transforming CSS with JavaScript
PostCSS Preset Env, lets you convert modern CSS into something most browsers can understand, determining the polyfills you need based on your targeted...
Read more >
postcss-unit-conversion - npm package - Snyk
PostCSS plugin for converting units from px to em or rem. For more information about how to use this package see README.
Read more >
Getting started with PostCSS - LogRocket Blog
PostCSS is a tool for transforming CSS with JavaScript plugins. It provides features via its extensive plugin ecosystem to help improve your CSS ......
Read more >
PostCSS - Transforming Your CSS with JavaScript - KeyCDN
PostCSS allows you to transform and extend your CSS using JavaScript. With its large ecosystem of plugins, it can help streamline your ...
Read more >
hoivee/postcss-convert-unit - GitHub
Contribute to hoivee/postcss-convert-unit development by creating an account on GitHub. ... convertConfig, convert config list, convertItem[], [], yes ...
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