-
Notifications
You must be signed in to change notification settings - Fork 888
Option for "variable-name" rule to allow leading underscore for property backing fields #1489
Comments
This naming convention for backing fields is also suggested in the typescript handbook ;
|
|
@JoshuaKGoldberg That's not new, and allows leading underscores on any variable. |
Oh! My apologies, I speed-read the rule and missed the difference. Agreed that an option to allow a leading underscore only for backing properties would be nice. We should note that it shouldn't be allowed to be enabled at the same time as |
The webpack process took quite a while to run, and there were no updates in the console while running. This PR adds a spinner (when there is no dashboard) and status updates every 5 seconds. When there is a dashboard, the updates are added to a new line. After (with dashboard): ![with dashboard](https://i.imgur.com/zVJH5U4.png) After (`—nodashboard`): ![no dashboard](http://g.recordit.co/2zRNLt51jU.gif) Convert LongRunningProcessTimer to TypeScript PR feedback and consistency changes Changed the constructor signature to accept an options object instead of individual optional parameters, for readability. Changed library_manager to use the spinner when not using the dashboard, for consistency’s sake. Additionally increased the update time for the library manager from 750ms to 1s. Fix lint errors Added `"variable-name": ["allow-leading-underscore”]` to `tslint.json` due to a lack of the ability to prefix backing variables with underscore. This is an [ongoing discussion](palantir/tslint#1489), and something the community thinks should be implemented, as it the preferred way to use a property with backing variable in TypeScript.
The webpack process took quite a while to run, and there were no updates in the console while running. This PR adds a spinner (when there is no dashboard) and status updates every 5 seconds. When there is a dashboard, the updates are added to a new line. After (with dashboard): ![with dashboard](https://i.imgur.com/zVJH5U4.png) After (`—nodashboard`): ![no dashboard](http://g.recordit.co/2zRNLt51jU.gif) Convert LongRunningProcessTimer to TypeScript PR feedback and consistency changes Changed the constructor signature to accept an options object instead of individual optional parameters, for readability. Changed library_manager to use the spinner when not using the dashboard, for consistency’s sake. Additionally increased the update time for the library manager from 750ms to 1s. Fix lint errors Added `"variable-name": ["allow-leading-underscore”]` to `tslint.json` due to a lack of the ability to prefix backing variables with underscore. This is an [ongoing discussion](palantir/tslint#1489), and something the community thinks should be implemented, as it the preferred way to use a property with backing variable in TypeScript.
The webpack process took quite a while to run, and there were no updates in the console while running. This PR adds a spinner (when there is no dashboard) and status updates every 5 seconds. When there is a dashboard, the updates are added to a new line. After (with dashboard): ![with dashboard](https://i.imgur.com/zVJH5U4.png) After (`—nodashboard`): ![no dashboard](http://g.recordit.co/2zRNLt51jU.gif) Convert LongRunningProcessTimer to TypeScript PR feedback and consistency changes Changed the constructor signature to accept an options object instead of individual optional parameters, for readability. Changed library_manager to use the spinner when not using the dashboard, for consistency’s sake. Additionally increased the update time for the library manager from 750ms to 1s. Fix lint errors Added `"variable-name": ["allow-leading-underscore”]` to `tslint.json` due to a lack of the ability to prefix backing variables with underscore. This is an [ongoing discussion](palantir/tslint#1489), and something the community thinks should be implemented, as it the preferred way to use a property with backing variable in TypeScript.
The issue is closed but I can't find a option at the documentation. Is it still planned to offer a option like |
Thanks for the catch @Xenya0815 - this should have been re-opened. |
Closing in favor of typescript-eslint/typescript-eslint#816 |
🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖 🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋 |
It would be nice to have this:
allow-leading-underscore-backing-fields
maybe.Edit: It would be considered a backing field if there was either a getter or a setter with the same name (sans the leading underscore).
The text was updated successfully, but these errors were encountered: