Lint using putout part 3#3269
Lint using putout part 3#3269Tyriar merged 1 commit intoxtermjs:masterfrom coderaiser:lint-using-putout
Conversation
There was a problem hiding this comment.
Great work, your tools seems to be quite capable 👍 . Nothing to mock about from my side.
Edit:
Ok lemme re-phrase that - your tool seems to make a really great job in transpiling and finding code smells/errors. Maybe you should think about promoting it to other tools like linters/babel, so they can directly benefit from its capabilities?
| describe('proposeDimensions', () => { | ||
| afterEach(async () => { | ||
| return unloadFit(); | ||
| return await unloadFit(); |
There was a problem hiding this comment.
Wow - did your tool find that on its own? Just wondering, because not awaiting a promise might create bigger havoc and normally would qualify as a coding error (though not sure if thats the case here, did not look up the code).
If your tool is capable to find those things it has true benefits. 👍
There was a problem hiding this comment.
Yes :), the rule is promises/add-return-await, what it does is looking for declarations of functions and if it is async, it adds await.
Tyriar
left a comment
There was a problem hiding this comment.
Looks good, love the for ... of changes as I've come to dislike forEach greatly 🙂
Thank you :), I'm using it a lot for all my projects, and want it to be useful for community as much as possible :).
module.exports.replace = () => ({
'if (__a?.__b) {__a.__b(__args)}': '__a?.__b(__args)',
});Also it calls So, because Also Anyways for
Nice :), same with me, |
The main reason for me is debugging |
After successfully merged linting sessions part1 and part2, the time is come for part 3 :).
Any rule can be disabled.
Command used:
putout {src,addons}/**/*.ts --fixApplied rules:
Current config for putout v16:
{ "rules": { "strict-mode": "off", "remove-useless-spread/object": "off", "remove-iife": "off", "convert-generic-to-shorthand": "off", "convert-assignment-to-comparison": "off", "remove-console": "off", "remove-unused-variables": "off", "remove-useless-variables": "off", "apply-destructuring": "off", "merge-if-statements": "off", "convert-apply-to-spread": "off", "convert-math-pow": "off", "convert-for-to-for-of": "off", "convert-template-to-string": "off", "remove-empty": "on", "convert-index-of-to-includes": "on", "convert-for-each-to-for-of": "on", "apply-shorthand-properties": "on", "apply-numeric-separators": "off", "promises/add-missing-await": "off" }, "match": { "SerializeAddon.benchmark.ts": { "remove-unused-expressions": "off" } }, "plugins": [ "apply-shorthand-properties" ] }