@lumelabs/eslint-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ const confusingBrowserGlobals = require("confusing-browser-globals")
2
+
3
+ module.exports = {
4
+ rules: {
5
+ // enforce or disallow variable initializations at definition
6
+ "init-declarations": "off",
7
+
8
+ // disallow the catch clause parameter name being the same as a variable in the outer scope
9
+ "no-catch-shadow": "off",
10
+
11
+ // disallow deletion of variables
12
+ "no-delete-var": "error",
13
+
14
+ // disallow labels that share a name with a variable
15
+ // https://eslint.org/docs/rules/no-label-var
16
+ "no-label-var": "error",
17
+
18
+ // disallow specific globals
19
+ "no-restricted-globals": [
20
+ "error",
21
+ {
22
+ name: "isFinite",
23
+ message: "Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite",
24
+ },
25
+ {
26
+ name: "isNaN",
27
+ message: "Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan",
28
+ },
29
+ ].concat(
30
+ confusingBrowserGlobals.map((g) => ({
31
+ name: g,
32
+ message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
33
+ }))
34
+ ),
35
+
36
+ // disallow declaration of variables already declared in the outer scope
37
+ "no-shadow": "off", // Off because handled in @typescript-eslint/no-shadow
38
+
39
+ // disallow shadowing of names such as arguments
40
+ "no-shadow-restricted-names": "error",
41
+
42
+ // disallow use of undeclared variables unless mentioned in a /*global */ block
43
+ "no-undef": "error",
44
+
45
+ // disallow use of undefined when initializing variables
46
+ "no-undef-init": "error",
47
+
48
+ // disallow use of undefined variable
49
+ // https://eslint.org/docs/rules/no-undefined
50
+ // TODO: enable?
51
+ "no-undefined": "off",
52
+
53
+ // disallow declaration of variables that are not used in the code
54
+ "no-unused-vars": "off", // Off because handled in @typescript-eslint/no-unused-vars
55
+
56
+ // disallow use of variables before they are defined
57
+ "no-use-before-define": "off", // Off because handled in @typescript-eslint/no-use-before-define
58
+ },
59
+ }