Comments (11)
Let me clarify:
I'd like a rule which checks if braces are on the next line, and that it complains if they are on the same line.
As far as I could tell there is no way to enforce this.
from tslint.
It would be great if next-line braces was a rule as well. Solving it by ignoring the "oneline" rule is not ideal.
from tslint.
Is there any way to enforce the opposite of check-else
? I want to enforce the following style:
if (expr) {
// code
}
else {
// code
}
and restrict the following style:
if (expr) {
// code
} else {
// code
}
EDIT - this can be accomplished with tslint-eslint-rules
from tslint.
I can toggle it with the oneline
rule.
I think it should be split to it's own rule: it is not the same thing as oneline's "opening brace to be on the same line as the expression preceding it".
from tslint.
sure, makes sense.
from tslint.
made all checks optional, fixed by 5cd203a
from tslint.
Can you give us an example of what you mean, @eirikhm? If you want your braces to be on the next line, why do you want to one-line rule enabled at all?
from tslint.
Agreed, why not add the inverse to force blocks to their own line?
from tslint.
Is there any way to enforce the opposite of
check-else
? I want to enforce the following style:if (expr) { // code } else { // code }
and restrict the following style:
if (expr) { // code } else { // code }
This is a very common requirement - I've just found out it's not supported in tslint and I'm a bit surprised... I thought this was exactly the type of thing tslint was for?
from tslint.
from tslint.
Aww that's almost a bit sad :( lol
from tslint.
Related Issues (20)
- TypeScript >=3.8 Support HOT 8
- Fix CVE-2020-7598 HOT 14
- Why is there a version 6.1 when 6.0 is deprecated? HOT 3
- run tslint to specific folder HOT 1
- Vulnerability in minimist, need to upgrade to latest version HOT 5
- Support Typescript 3.8 both type-only import and regular import HOT 2
- Update issue templates to mention deprecation HOT 3
- Make `case-insensitive-legacy` part of possible `ordered-imports` options HOT 3
- error HOT 7
- TSLint 6.1 requires TS 3.8 to compile HOT 4
- Build failed with TypeScript 3.8.3 HOT 2
- tslint wouldn't prompt error if I put before initialized `this` inside a JavaScript getter? HOT 1
- Update https://palantir.github.io/tslint/ to mention deprecation HOT 2
- Compiler option in tsconfig.json not considered causing rule violations of "typescript:S4328" HOT 5
- Improve codeFrame formatter to include rule severity with each failure HOT 1
- Update deps and devDeps? HOT 2
- align rule (and possibly others) broken with TypeScript 4.0.0-dev HOT 1
- Version 6.1.3 is not marked as deprecated HOT 1
- Error thrown in 'align' rule HOT 1
- Angular app not install HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tslint.