Skip to content

Files

Latest commit

 

History

History
19 lines (12 loc) · 515 Bytes

HardCodedWindowsFileSeparator.md

File metadata and controls

19 lines (12 loc) · 515 Bytes

Pattern: Hardcoded windows file separator

Issue: -

Description

This rule finds usages of a Windows file separator within the constructor call of a File object. It is better to use the Unix file separator or use the File.separator constant.

Example of violations:

new File('.\\foo\\')
new File('c:\\dir')
new File('../foo\\')

Further Reading