-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: display tracking information about unused variables #125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did in non feasible way plz check #124
Breaking Change Co-Authored-By: Georg Gentzen <60478031+gentzeng@users.noreply.github.com>
137e4e1
to
300b76f
Compare
index.js
Outdated
total: variables.length, | ||
unusedOrigin: unusedVarsOrigin, | ||
// for backwards compatibility of API | ||
unused: unusedVarsOrigin.map(({ name }) => name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
should above only, plz do not make more complicated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep the original 'unused' as an array containing only the variable names, as well as total being the amount of all variables, since I don't want to break the API of this function. Hence the additional return value for more information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4117c18
to
9fe401c
Compare
@gentzeng rebase it |
d83753e
to
83e74ed
Compare
Unused variables are grouped per containig files and displayed with line and column information. Files are displayed relatively to working directory. In addition to total amount of variables, amount of unused variables gets also displayed. fix(app.js): Fixed file according to xo linting rules feat: print enhanced information of unused variable line and column of unused variable with respect to all files of one regarded directory, i.e., within concatenation of all those files, are printed fix: line Info of variable now gets displayed per containing file fix: unused variables are grouped per containing file feat: display path of files containing unused variables relatively fix: added newline before files containing UVs are displayed stlye(cli.js): put console.log command on more lines refactor(index.js): refactored calculation of variable Lines per File fix(cli.js): exchanged manual ansi escape code with chalk command fix: Deleted wrongfully copied directory fix(README.md): Updated README.md fix(): incorporated ideas from PR XhmikosR#124 Co-Authored-By: Daniel <50356015+danny007in@users.noreply.github.com>
83e74ed
to
4e2b3ee
Compare
Done |
@@ -5,27 +5,32 @@ const Declaration = require('postcss/lib/declaration'); | |||
const Comment = require('postcss/lib/comment'); | |||
let fusvEnabled = true; | |||
|
|||
function parseNodes(nodes, variables, ignoreList) { | |||
function parseNodes(nodes, variables, ignoreList, file = '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
carefully adapt this
#134 (comment)
for file = '')
This is a feature and not a breaking change
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.
This feature heavily incorporates ideas from PR #124.
Co-Authored-By: Daniel 50356015+danny007in@users.noreply.github.com