Skip to content

Commit

Permalink
[eslint config] [minor] Fix typo in no-multiple-empty-lines rule
Browse files Browse the repository at this point in the history
 ## Why is the change being made?

This change is made because the Airbnb documentation states to "avoid a
newline at the beginning of files", yet the code does not follow this.

 ## What has changed to address the problem?

This change fixes the `no-multiple-empty-lines` rule by setting max
beginning of file (`maxBOF`) to from 1 to 0.

 ## How was this change tested?

This change was tested with `npm test`.

 ## Related docs

https://github.com/airbnb/javascript#whitespace--no-multiple-empty-lines
  • Loading branch information
Luis729 authored and ljharb committed Feb 20, 2020
1 parent c0ee2c4 commit 06b3ab1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-config-airbnb-base/rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ module.exports = {

// disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
// https://eslint.org/docs/rules/no-multiple-empty-lines
'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 1, maxEOF: 0 }],
'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 0, maxEOF: 0 }],

// disallow negated conditions
// https://eslint.org/docs/rules/no-negated-condition
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-airbnb/test/test-react-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function lint(text) {
}

function wrapComponent(body) {
return `
return `\
import React from 'react';
export default class MyComponent extends React.Component {
Expand Down

0 comments on commit 06b3ab1

Please sign in to comment.