Actions
Patch #32888
closedUse stylelint to avoid errors and enforce conventions in CSS files
Description
In the last few months we had some cases when we added/fixed broken CSS code (ex: r18173, r18144, #32838). These types of errors can be easily avoid if we use a lint tool for CSS (as we started using Rubocop for Ruby).
My proposal is to add Stylelint which is a very well know library, actively maintained, with good community and integrated by many tools.
Attached is a patch that:- Adds
package.json
andyarn.lock[1]
to request the library as development dependency. To install and run it, I propose to use Yarn. - Adds
.stylelintrc
with the initial list of rules from here. For now, I propose to start only with the possible-errors rules. - Adds
.stylelintignore
to ignore some files from linting (jquery-ui-*.ccs for now). - Updates the documentation
- Add more rules to enforce some coding standards in CSS files
- Add a Javascript lint tool like ESLint
- Use package.json to handle the version of the current JS libraries (ex: jQuery, jQuery UI, Chart, Raphael, Tribute, etc)
- Give a shoot to integrate Webpack as assets pipeline (In Rails 6, is default)
Any feedback is really appreciated.
1 I prefer to have yarn.lock
committed in the repository in order to enforce the same version between Redmine installations.
Files
Related issues
Actions