Specify the code folding size, Lint code, Enable linting and set preferences – Adobe Dreamweaver CC 2015 User Manual
Page 396: Specify linting rules
389
Coding
Last updated 6/3/2015
Specify the code folding size
The default code folding size is two lines. This means, when you collapse code, all the code fragments that have at least
two lines of code are collapsed. Code fragments that are lesser than two lines are displayed in the expanded mode.
You can change the minimum number of lines for code folding in Preferences.
1
Click Edit > Preferences (Win) or Dreamweaver > Preferences (Mac).
2
Click Code Format in the Category list and specify the minimum code folding size.
Lint code
Whether you are a rookie or an experienced coder, there are always chances of errors creeping in to your code
inadvertently or due to lack of knowledge. When the web page or even a portion of it doesn't look like what you
expected, you are forced to debug code to find any syntax or logical errors. Debugging can be an extremely strenuous
and a time-consuming process especially in cases of complex implementations.
Dreamweaver makes debugging code for common errors simple and easy with the help of linting. Linting is the process
of analyzing code to flag potential errors or suspicious usage of code. HTML syntax errors, parsing errors in CSS, or
warnings in JavaScript files are some of the things flagged by linting in Dreamweaver.
The errors and warnings found are listed in a separate (Output) panel docked at the bottom of the workspace. Each line
in the panel helps you jump to the portion of the code where the error has occurred, making it easy to find and fix the
code. Also, the line numbers of the erroneous code are highlighted in red for errors and yellow for warnings. When you
hover your mouse over the highlighted line numbers, a preview of the error or warning pops-up.
You can lint HTML, CSS, and JavaScript files in Dreamweaver using the following process:
1
Specify linting rules by editing the HTML, CSS, and JS configuration files. See
information.
2
Enable linting and specify when the linting should be triggered. You can lint files when they are loaded, saved, or
edited. S
Errors and warnings found in the files are displayed in the output panel. For more information, see
.
Enable linting and set preferences
Click Edit > Preferences (Win) or Dreamweaver > Preferences (Mac). Select Linting in the Category list.
• Select Enable Linting.
• Specify one or more triggers for linting. You can trigger linting when the file gets loaded, saved, and/or edited.
Specify linting rules
You can lint HTML, CSS, and JS files by editing the linting rules in the corresponding configuration files:
• HTML: DW.htmlhintrc
• CSS: DW.csslintrc
• JS: DW.jshintrc