Skip to content
This repository was archived by the owner on Jul 31, 2019. It is now read-only.

Conversation

@badrmodoukh
Copy link
Contributor

@badrmodoukh badrmodoukh commented Apr 2, 2017

@Pomax @humphd I have updated the grunt-lesslint dependency
I tested using "npm install" and all seems to work fine from my end
However when I ran "npm test" I got many warnings from the less and css files

This is what it showed
screen shot 2017-04-01 at 9 52 05 pm
screen shot 2017-04-01 at 9 52 40 pm
screen shot 2017-04-01 at 9 53 15 pm
screen shot 2017-04-01 at 9 53 45 pm

The warnings are from the rules known-properties and order-alphabetical
I'm guessing all of these files need to be modified to meet with the new update
However, I am not sure if I should change these files or ignore these rules for now by modifying the Gruntfile.js file or return to the previous version

@Pomax
Copy link
Contributor

Pomax commented Apr 4, 2017

Now would be the perfect time to fix the associated linting issues, too.

@badrmodoukh
Copy link
Contributor Author

@Pomax does that mean I need to fix all these files to meet with the new update?
Or should I just modify the Gruntfile.js file and turn the known-properties and order-alphabetical rules off

@humphd
Copy link
Contributor

humphd commented Apr 5, 2017

@badrmodoukh in each of this separate PRs, fix whatever fall out you find from changing things. This is the value of doing them all as separate PRs vs. one giant change, since you can easily deal with things one problem at a time. Also, later on we can git bisect to figure out which thing is causing some unknown regression or bug based on a change that affects us more deeply than we realized at the time.

@badrmodoukh
Copy link
Contributor Author

badrmodoukh commented Apr 11, 2017

@Pomax @humphd I tried to order alphabetically for the css and less files but I kept getting warnings for the files public/editor/stylesheets/editor.less and public/editor/stylesheets/publish.less because they call a class directly. For example in the public/editor/stylesheets/publish.less file in #publish-dialog it uses .menu-appear; which results in a warning. This is used throughout most of the file to call other classes.

Also for the known-properties warning the file public/editor/stylesheets/editor.less uses alpha(opacity=45); which results in a warning. This is also used throughout most of the file.

Therefore as a result, I decided to turn these rules off in the Gruntfile.

@humphd
Copy link
Contributor

humphd commented Apr 13, 2017

Assigning @flukeout to see what he wants to do here.

@humphd humphd requested a review from flukeout April 13, 2017 02:25
Copy link
Contributor

@gideonthomas gideonthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote to just set order-alphabetical to be false because I think alphabetically ordering classes is overkill (what do you think @flukeout?).
However, I think we should keep known-properties since it is useful in catching typos in the less file.

Gruntfile.js Outdated
"font-sizes": false,
"ids": false,
"important": false,
"known-properties": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this and fix the less errors (it seems like they are mostly all filter: alpha(opacity); which we can safely change to opacity: ##). Note that when you change filter to opacity, you will need to divide the filter value by 100, so for e.g. 45 will become 0.45.

There is one error generated by normalize.less. We should probably not lint that file since they lint it already (we probably want to switch to npm installing this at some point). You just need to add an entry to src above with "!./public/editor/stylesheets/normalize.less"

@badrmodoukh
Copy link
Contributor Author

badrmodoukh commented May 3, 2017

@gideonthomas I modified Gruntfile.js so that we can use the known-properties rule. I also added !./public/editor/stylesheets/normalize.less to src so that it does not get checked. I also modified public/editor/stylesheets/editor.less to meet with the known-properties rule.

@badrmodoukh badrmodoukh force-pushed the issue-1908-grunt-lesslint-update branch from 8422993 to a151302 Compare May 3, 2017 07:45
@gideonthomas
Copy link
Contributor

I'm good with this change, nice work @badrmodoukh! @flukeout wanna do a quick review?

@gideonthomas
Copy link
Contributor

We would do this with webpack since that's what we're switching to. Feel free to contribute to that change. Closing in favor of that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants