Skip to content
This repository was archived by the owner on Sep 12, 2022. It is now read-only.

Commit 5ae6676

Browse files
committed
added rules for logging and strict mode
1 parent 2dc6bef commit 5ae6676

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
## Table of Contents
77

88
1. [Linting](#linting)
9+
1. [Strict Mode](#strict-mode)
910
1. [Editor Config](#editor-config)
1011
1. [Types](#types)
1112
1. [Dates and times](#dates-and-times)
@@ -29,6 +30,7 @@
2930
1. [Constructors](#constructors)
3031
1. [Events](#events)
3132
1. [Modules](#modules)
33+
1. [Logging](#logging)
3234
1. [3rd Party Libraries](#3rd-party-libraries)
3335
1. [jQuery](#jquery)
3436
1. [ECMAScript 5 Compatibility](#ecmascript-5-compatibility)
@@ -56,6 +58,9 @@ You must use the relevant plugins for your editor/IDE for this to work. Here is
5658
- Atom (Requires [Atom Linter](https://github.com/atom-community/linter) and [Linter ESLint](https://github.com/AtomLinter/linter-eslint))
5759
- Webstorm ([Docs on enabling ESLint](https://www.jetbrains.com/webstorm/help/eslint.html))
5860

61+
## Strict Mode
62+
Always declare `'use strict';` at the top of every javascript file. This will ensure that any linters used know that all files are in strict mode.
63+
5964
## Editor Config
6065
[BESK](https://bitbucket.org/mbst/besk) and [FESK](https://bitbucket.org/mbst/fesk) contain an `.editorconfig` file with out common editor settings. For this to take effect you must install the relevant [Editor Config](http://editorconfig.org) plugin for your editor/IDE. Some common ones are:
6166
- Sublime Text ([Plugin](https://github.com/sindresorhus/editorconfig-sublime))
@@ -1518,6 +1523,14 @@ age > 18 ? location.assign("continue.html") : stop = true;
15181523
15191524
**[⬆ back to top](#table-of-contents)**
15201525
1526+
## Logging
1527+
1528+
Always use a wrapper for logging rather than using `console.log();`. This is due to some browsers crashing when `console.log();` is used.
1529+
1530+
[This tool](https://github.com/patik/console.log-wrapper) is a very good wrapper with some great customizable options.
1531+
1532+
**[⬆ back to top](#table-of-contents)**
1533+
15211534
## 3rd Party Libraries
15221535
15231536
- namespace all 3rd party libraries

0 commit comments

Comments
 (0)