Showing 1,297 of 1,297 total issues
Expected linebreaks to be 'LF' but found 'CRLF'. Open
* load ghost
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
* @param {Hash<GhostKernelController>} [controllers] - コントローラ
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
async _getGhostKernelAsProfile(namedId, profile, routes, controllers, GhostViewClass) {
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
NanikaStorage: this.components.NanikaStorage,
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
}
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
* @param {NanikaDirectory} ghost directory contents
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
return shiori;
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
const balloon = await this._load_balloon(directory, GhostViewClass);
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
/**
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
* @param {string} balloonname - balloonname
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
}
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
* @param {cuttlebone} [GhostViewClass] ghost view class
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
* install named
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
* @param {Blob | URL | string} target install target resource (file, url or some)
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
*/
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
const install_results = await nanikaStorage.install_nar(nar, dirpath, sakuraname);
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
if (install_result.type === 'ghost') {
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
});
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
if (ghost_result) {
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/
Expected linebreaks to be 'LF' but found 'CRLF'. Open
profile.balloonname = 'origin'; // TODO: 設定を読む
- Read upRead up
- Exclude checks
enforce consistent linebreak style (linebreak-style)
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF)
whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are "\n"
(for LF) and "\r\n"
for (CRLF).
Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
Rule Details
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
Options
This rule has a string option:
-
"unix"
(default) enforces the usage of Unix line endings:\n
for LF. -
"windows"
enforces the usage of Windows line endings:\r\n
for CRLF.
unix
Examples of incorrect code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a'; // \r\n
Examples of correct code for this rule with the default "unix"
option:
/*eslint linebreak-style: ["error", "unix"]*/
var a = 'a', // \n
b = 'b'; // \n
// \n
function foo(params) { // \n
// do stuff \n
}// \n
windows
Examples of incorrect code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a'; // \n
Examples of correct code for this rule with the "windows"
option:
/*eslint linebreak-style: ["error", "windows"]*/
var a = 'a', // \r\n
b = 'b'; // \r\n
// \r\n
function foo(params) { // \r\n
// do stuff \r\n
} // \r\n
Using this rule with version control systems
Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
For example, the default behavior of git on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the linebreak-style
rule to report errors if configured with the "unix"
setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your .gitattributes
file to prevent git from converting linebreaks in .js
files:
*.js text eol=lf
When Not To Use It
If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
Compatibility
- JSCS: validateLineBreaks Source: http://eslint.org/docs/rules/