Skip to content
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

Feature request: pad_block #268

Open
Josef-Friedrich opened this issue Jan 5, 2023 · 0 comments
Open

Feature request: pad_block #268

Josef-Friedrich opened this issue Jan 5, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Josef-Friedrich
Copy link

Josef-Friedrich commented Jan 5, 2023

Some style guidelines require that block statements must begin and end with blank lines. I would apprecitae if this lovely formatter could support this with the help of an option e. g. pad_block.

https://eslint.org/docs/latest/rules/padded-blocks

Function blocks

-- pad_block: true
function outer() 

  local function inner1() 
  
  end

  local function inner2() 
  
  end

end

-- pad_block: false
function outer() 
  local function inner1() 
  
  end

  local function inner2() 
  
  end
end

Control structure blocks

-- pad_block: true
if x == 1 then 

  print(x)

else

  print(1)
  
end

-- pad_block: false
if x == 1 then 
  print(x)
else
  print(1)
end

Busted

-- pad_block: true
require('busted.runner')()

describe('Test module', function()

  describe('Test function', function()

    it('My test', function()

      assert.are.equal(1, 1,)

    end)

  end)

end)

-- pad_block: false
require('busted.runner')()
describe('Test module', function()
  describe('Test function', function()
    it('My test', function()
      assert.are.equal(1, 1,)
    end)
  end)
end)
@Koihik Koihik added the enhancement New feature or request label Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants