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
Rule Proposal: lines-around-directive #6069
Comments
Can we check lines between Shebang and directive prologues? |
@mysticatea We should be able to, since shebang is commented out before parsing, we just have to check comment value. |
Do we need to check padding before? That would almost always be covered by |
I had imaged the previous padding for shebang and header comment. #!/usr/bin/env node
"use strict" /**
* header comment
*/
"use strict" |
I see. So then this rule's |
/*eslint lines-around-directives*/
function a() {
"use strict";
}
function a() {
"use strict";
}
function a() {
/*
* comment
*/
"use strict";
} |
Sorry, I clicked a wrong button... I'm thinking |
Doesn't |
function foo() {
<!-- by padded-blocks -->
/*COMMENT*/
<!-- by lines-around-directives -->
"use strict";
<!-- by lines-around-directives -->
doSomething()
<!-- by padded-blocks -->
} |
Ah, I see. Got it. 👍 |
Anything else left to discuss here? I'm happy to champion this one. I'm looking for a JSCS compat issue to work on this weekend and this seems like a good one :) @eslint/eslint-team thoughts? |
👍 from me. |
👍 |
👍 |
From requirePaddingNewLinesAfterUseStrict and disallowPaddingNewLinesAfterUseStrict.
This rule will require/disallow blank lines before/after a chunk of directive prologues.
Valid:
Invalid:
The text was updated successfully, but these errors were encountered: