collective / cookiecutter-plone-starter

Cookiecutter Plone Starter is a framework for jumpstarting Plone 6 projects quickly.
MIT License
18 stars 10 forks source link

"make format" throws an exception when ./frontend/src folder does not contain any .?css or .override files #100

Open elcoda opened 7 months ago

elcoda commented 7 months ago

``When using

make format

stylint throws an exception when ./frontend/src folder does not contain .css/.scss/.ovverride

"Error: No files matching the pattern "theme/**/*.{css,scss,less}, src/**/*.{css,scss,less}" were found.
    at standalone (/Users/xxxx/ploneconf2023/frontend/node_modules/stylelint/lib/standalone.js:261:43)
make[1]: *** [format-stylelint] Error 1
make: *** [format] Error 2"

To avoid it I used the --allow-empty-input option on stylelint, to have it working I changed the frontend/package.json file changing lines "stylelint:overrides" and "stylelint:overrides" in the following way:

"stylelint:overrides": "stylelint 'theme/**/*.overrides' 'src/**/*.overrides' --allow-empty-input",
"stylelint:fix": "yarn stylelint --allow-empty-input --fix && yarn stylelint:overrides --fix",

I have no clue to make this change permanent on cookiecutter-plone-starter.

Ivan

fredvd commented 7 months ago

@sneridagh I've been bitten by this twice now. Is this a good option to add so that we can get rid of this problem, or will it mask other problems?

sneridagh commented 7 months ago

@fredvd the generator is already taken care of it. @elcoda as far as I know, the --allow-empty-input --fix are not compatible, are you sure that it's working? I know because I tried to fix it long ago.

If you don't have styles, then you have to remove the :fix from your flow until you have. That's how you workaround it.