-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
52 lines (47 loc) · 2.26 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"use strict";
/**
* Rules that are specific to browser-based apps and isomorphic libraries.
*/
module.exports = {
rules: {
/**
* Bans the use of specific functions or global methods.
*
* @see https://palantir.github.io/tslint/rules/ban/
*/
ban: {
severity: "warning",
options: [
{ name: "alert", message: "Don't use `alert`. It blocks the execution thread." },
{ name: ["window", "alert"], message: "Don't use `alert`. It blocks the execution thread." },
{ name: "confirm", message: "Don't use `confirm`. It blocks the execution thread." },
{ name: ["window", "confirm"], message: "Don't use `confirm`. It blocks the execution thread." },
{ name: "prompt", message: "Don't use `prompt`. It blocks the execution thread." },
{ name: ["window", "prompt"], message: "Don't use `prompt`. It blocks the execution thread." },
{ name: "$", message: "You probably don't need jQuery. See http://youmightnotneedjquery.com" },
],
},
/**
* Bans `window` properties from being used as global variables. This prevents you from
* accidentally using a variable named something like `name` without defining it. TypeScript
* won't warn you about the undefined variable, because it'll assume you're using the
* `window.name` property.
*
* @see https://palantir.github.io/tslint/rules/no-restricted-globals/
*/
"no-restricted-globals": {
severity: "default",
options: [
"name", // https://developer.mozilla.org/en-US/docs/Web/API/Window/name
"event", // https://developer.mozilla.org/en-US/docs/Web/API/Window/event
"length", // https://developer.mozilla.org/en-US/docs/Web/API/Window/length
"self", // https://developer.mozilla.org/en-US/docs/Web/API/Window/self
"parent", // https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
"origin", // https://developer.mozilla.org/en-US/docs/Web/API/Window/origin
"top", // https://developer.mozilla.org/en-US/docs/Web/API/Window/top
"status", // https://developer.mozilla.org/en-US/docs/Web/API/Window/status
"performance", // https://developer.mozilla.org/en-US/docs/Web/API/Window/performance
]
}
}
};