anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

Use with scss (sass), aspect of third-party code processed too ..? #32

Closed fabm22 closed 8 years ago

fabm22 commented 8 years ago

Hi.

AMAZING project in concept.

I was just wondering, if i use a preprocessor such as sass for example, I suppose I could lint the produced css, ok. But what if we include lot of third parties in our scss/sass too , such as whole libraries like Bootstrap which obviously will throw warnings I, as a dev, don't care of ?

Should I necessarly produce "only" my app specific code to some place to lint it ?

Or will features be detected etc. in "native" sass/scss simply without problem in the first place?? Would I obligatory need to use something like postcss-scss to parse it ?

anandthakker commented 8 years ago

If you use source maps, you should be able to ignore the included files using the ignoreFiles option.

On Fri, Jan 1, 2016 at 10:27 PM Fab notifications@github.com wrote:

Hi

AMAZING project in concept

I was just wondering, if i use a preprocessor such as sass for example, I suppose I could lint the produced css, ok But what if we include lot of third parties in our scss/sass too , such as whole libraries like Bootstrap which obviously will throw warnings I, as a dev, don't care of ?

Should I necessary produce "only" my app specific code to some place to lint it ?

— Reply to this email directly or view it on GitHub https://github.com/anandthakker/doiuse/issues/32.

fabm22 commented 8 years ago

Thanks for feedback ! I see yes like in the docs

...
ignoreFiles: ['**/normalize.css'], // an optional array of file globs to match against original source file
path, to ignore

Still, this targets a specific ".css" file, very distinguishable as it is a file on its own (same for x files). On usual sass/scss files we do @ imports of other scss (or .css too) files and in the end the final produced css is only ONE file, so I dont have the luxury of specifying which files I want to lint as I only have one.

I also ve been quickly playing around with your online demo ( http://www.doiuse.com/ ) and it seems to more or less detect the features usage in text ( key tokens i guess) but still throw errors of CssSyntax, which make sense as it is scss, with variables, nesting etc.

So I guess the best bet is to go ahead and lint everything, including third parties of a generated scss 2 css file OR, again, produce different files for third parties.

acdha commented 7 years ago

@anandthakker Is there an example which shows how to enable source-maps? It looks like #42 is still open and as far as I can tell at least the CLI interface doesn't support sourceMappingURL automatically. I was hoping to have a way to easily avoid everything produced by my tested mixins.