eslint-config-nodebb 0.0.3
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.
- package/README.md +79 -0
- package/index.js +1 -0
- package/lib.js +115 -0
- package/package-lock.json +272 -0
- package/package.json +19 -0
- package/public.js +83 -0
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# eslint-config-nodebb
|
|
2
|
+
|
|
3
|
+
This package provides NodeBB's .eslintrc for server & client sides as an extensible shared config.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
We export two ESLint configurations for your usage.
|
|
8
|
+
Both configurations require `eslint` and `eslint-plugin-import`.
|
|
9
|
+
|
|
10
|
+
### `eslint-config-nodebb`
|
|
11
|
+
|
|
12
|
+
Our default export is used to lint the backend-side.
|
|
13
|
+
You should use it at the root of your plugins/themes/etc.
|
|
14
|
+
|
|
15
|
+
This config is based on [`airbnb-base`](https://www.npmjs.com/package/eslint-config-airbnb-base) config with some overwritten rules.
|
|
16
|
+
|
|
17
|
+
1. [Install `peerDependencies`](#Peer-dependencies)
|
|
18
|
+
2. Add `"extends": "nodebb"` or `"extends": "nodebb/lib"` to your `.eslintrc`.
|
|
19
|
+
|
|
20
|
+
### `eslint-config-nodebb/public`
|
|
21
|
+
|
|
22
|
+
Second configuration is used to lint the frontend-side.
|
|
23
|
+
You should use it in the folder with files for client (scripts, acpScripts, etc.).
|
|
24
|
+
|
|
25
|
+
1. [Install `peerDependencies`](#Peer-dependencies)
|
|
26
|
+
2. Add `"extends": "nodebb/public"` to your `.eslintrc`.
|
|
27
|
+
|
|
28
|
+
## Peer dependencies
|
|
29
|
+
|
|
30
|
+
This config requires `eslint` and `eslint-plugin-import`.
|
|
31
|
+
|
|
32
|
+
Install the correct versions of each package, which are listed by the command:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm info "eslint-config-nodebb@latest" peerDependencies
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If using **npm 5+**, use this shortcut
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npx install-peerdeps --dev eslint-config-nodebb
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If using **yarn**, you can also use the shortcut described above if you have npm 5+ installed on your machine, as the command will detect that you are using yarn and will act accordingly.
|
|
45
|
+
Otherwise, run `npm info "eslint-config-nodebb@latest" peerDependencies` to list the peer dependencies and versions, then run `yarn add --dev <dependency>@<version>` for each listed peer dependency.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
If using **npm < 5**, Linux/OSX users can run
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
(
|
|
52
|
+
export PKG=eslint-config-nodebb;
|
|
53
|
+
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
|
|
54
|
+
)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Which produces and runs a command like:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
npm install --save-dev eslint-config-nodebb eslint@^#.#.# eslint-plugin-import@^#.#.#
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If using **npm < 5**, Windows users can either install all the peer dependencies manually, or use the [install-peerdeps](https://github.com/nathanhleung/install-peerdeps) cli tool.
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
npm install -g install-peerdeps
|
|
67
|
+
install-peerdeps --dev eslint-config-nodebb
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The cli will produce and run a command like:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
npm install --save-dev eslint-config-nodebb eslint@^#.#.# eslint-plugin-import@^#.#.#
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Credits
|
|
77
|
+
- [eslint](https://www.npmjs.com/package/eslint)
|
|
78
|
+
- [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import)
|
|
79
|
+
- [eslint-config-airbnb-base](https://www.npmjs.com/package/eslint-config-airbnb-base)
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./lib');
|
package/lib.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"extends": "airbnb-base",
|
|
3
|
+
"parserOptions": {
|
|
4
|
+
"sourceType": "script"
|
|
5
|
+
},
|
|
6
|
+
|
|
7
|
+
"rules": {
|
|
8
|
+
// === Configure rules for our style ===
|
|
9
|
+
// imports must be resolvable
|
|
10
|
+
"import/no-unresolved": "error",
|
|
11
|
+
// use single quotes,
|
|
12
|
+
// unless a different style allows avoiding escapes
|
|
13
|
+
"quotes": ["error", "single", {
|
|
14
|
+
"avoidEscape": true,
|
|
15
|
+
"allowTemplateLiterals": true
|
|
16
|
+
}],
|
|
17
|
+
// allow else-if return
|
|
18
|
+
"no-else-return": [ "error", { "allowElseIf": true } ],
|
|
19
|
+
// expressions split over multiple lines
|
|
20
|
+
// should break after the operator
|
|
21
|
+
"operator-linebreak": [ "error", "after" ],
|
|
22
|
+
// require arrow parens only when needed
|
|
23
|
+
// and whenever the body is a block
|
|
24
|
+
"arrow-parens": ["error", "as-needed", { "requireForBlockBody": true }],
|
|
25
|
+
// what variables are errors in callbacks
|
|
26
|
+
"handle-callback-err": [ "error","^(e$|(e|(.*(_e|E)))rr)" ],
|
|
27
|
+
// allow dangling commas in functions
|
|
28
|
+
// require them everywhere else
|
|
29
|
+
"comma-dangle": ["error", {
|
|
30
|
+
"arrays": "always-multiline",
|
|
31
|
+
"objects": "always-multiline",
|
|
32
|
+
"imports": "always-multiline",
|
|
33
|
+
"exports": "always-multiline",
|
|
34
|
+
"functions": "only-multiline"
|
|
35
|
+
}],
|
|
36
|
+
// we actually encourage `return await`
|
|
37
|
+
"no-return-await": "off",
|
|
38
|
+
// allow `while (true)`
|
|
39
|
+
"no-constant-condition": ["error", { "checkLoops": false }],
|
|
40
|
+
// allow ignoring an error with `catch`
|
|
41
|
+
"no-empty": ["error", { "allowEmptyCatch": true }],
|
|
42
|
+
// allow `3 + 5 - 1`, but not `3 * 5 - 1`
|
|
43
|
+
"no-mixed-operators": ["error", { "allowSamePrecedence": true }],
|
|
44
|
+
// require `'use strict';`
|
|
45
|
+
"strict": ["error", "global"],
|
|
46
|
+
// we actually use tabs for indentation
|
|
47
|
+
"indent": ["error", "tab", { "SwitchCase": 1 }],
|
|
48
|
+
"no-tabs": "off",
|
|
49
|
+
// we want `== null` to also handle undefined
|
|
50
|
+
"no-eq-null": "off",
|
|
51
|
+
// allow `for (..; i++)`
|
|
52
|
+
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
|
|
53
|
+
// allow using functions defined later
|
|
54
|
+
"no-use-before-define": ["error", "nofunc"],
|
|
55
|
+
// require consistent newlines before and after braces
|
|
56
|
+
// if contents are multiline
|
|
57
|
+
"object-curly-newline": ["error", { "consistent": true, "multiline": true }],
|
|
58
|
+
// require consistent linebreaks inline function parenthesis (arguments or params)
|
|
59
|
+
"function-paren-newline": ["error", "consistent"],
|
|
60
|
+
// only require const if all parts of destructuring can be const
|
|
61
|
+
"prefer-const": ["error", { "destructuring": "all" }],
|
|
62
|
+
// don't require destructuring for arrays or assignment
|
|
63
|
+
"prefer-destructuring": ["error", {
|
|
64
|
+
"VariableDeclarator": { "array": false, "object": true },
|
|
65
|
+
"AssignmentExpression": { "array": false, "object": false }
|
|
66
|
+
}],
|
|
67
|
+
// identical to airbnb rule, except for allowing for..of, because we want to use it
|
|
68
|
+
"no-restricted-syntax": [
|
|
69
|
+
"error",
|
|
70
|
+
{
|
|
71
|
+
"selector": "ForInStatement",
|
|
72
|
+
"message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"selector": "LabeledStatement",
|
|
76
|
+
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"selector": "WithStatement",
|
|
80
|
+
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
// allow lines of up to 120 characters
|
|
84
|
+
"max-len": ["error", { "code": 120, "tabWidth": 2, "ignoreUrls": true, "ignoreStrings": true, "ignoreTemplateLiterals": true, "ignoreRegExpLiterals": true }],
|
|
85
|
+
|
|
86
|
+
// === Disable rules ===
|
|
87
|
+
// more liberal naming
|
|
88
|
+
"camelcase": "off",
|
|
89
|
+
"no-underscore-dangle": "off",
|
|
90
|
+
// don't require anonymous function names
|
|
91
|
+
"func-names": "off",
|
|
92
|
+
// allow console
|
|
93
|
+
"no-console": "off",
|
|
94
|
+
// allow new for side effects
|
|
95
|
+
// allow new with non-capitalized
|
|
96
|
+
"no-new": "off",
|
|
97
|
+
"new-cap": "off",
|
|
98
|
+
// allow shadowing variables (usually callbacks)
|
|
99
|
+
"no-shadow": "off",
|
|
100
|
+
// allow multiple empty lines in a row
|
|
101
|
+
"no-multiple-empty-lines": "off",
|
|
102
|
+
// allow not using object shorthand
|
|
103
|
+
"object-shorthand": "off",
|
|
104
|
+
|
|
105
|
+
// TODO
|
|
106
|
+
"consistent-return": "off",
|
|
107
|
+
"no-restricted-globals": "off",
|
|
108
|
+
"no-prototype-builtins": "off",
|
|
109
|
+
"import/no-extraneous-dependencies": "off",
|
|
110
|
+
"import/no-dynamic-require": "off",
|
|
111
|
+
"global-require": "off",
|
|
112
|
+
"no-param-reassign": "off",
|
|
113
|
+
"default-case": "off"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eslint-config-nodebb",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"lockfileVersion": 1,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"call-bind": {
|
|
8
|
+
"version": "1.0.2",
|
|
9
|
+
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
|
10
|
+
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
|
11
|
+
"requires": {
|
|
12
|
+
"function-bind": "^1.1.1",
|
|
13
|
+
"get-intrinsic": "^1.0.2"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"confusing-browser-globals": {
|
|
17
|
+
"version": "1.0.10",
|
|
18
|
+
"resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz",
|
|
19
|
+
"integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA=="
|
|
20
|
+
},
|
|
21
|
+
"define-properties": {
|
|
22
|
+
"version": "1.1.3",
|
|
23
|
+
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
|
24
|
+
"integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
|
|
25
|
+
"requires": {
|
|
26
|
+
"object-keys": "^1.0.12"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"es-abstract": {
|
|
30
|
+
"version": "1.18.5",
|
|
31
|
+
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz",
|
|
32
|
+
"integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==",
|
|
33
|
+
"requires": {
|
|
34
|
+
"call-bind": "^1.0.2",
|
|
35
|
+
"es-to-primitive": "^1.2.1",
|
|
36
|
+
"function-bind": "^1.1.1",
|
|
37
|
+
"get-intrinsic": "^1.1.1",
|
|
38
|
+
"has": "^1.0.3",
|
|
39
|
+
"has-symbols": "^1.0.2",
|
|
40
|
+
"internal-slot": "^1.0.3",
|
|
41
|
+
"is-callable": "^1.2.3",
|
|
42
|
+
"is-negative-zero": "^2.0.1",
|
|
43
|
+
"is-regex": "^1.1.3",
|
|
44
|
+
"is-string": "^1.0.6",
|
|
45
|
+
"object-inspect": "^1.11.0",
|
|
46
|
+
"object-keys": "^1.1.1",
|
|
47
|
+
"object.assign": "^4.1.2",
|
|
48
|
+
"string.prototype.trimend": "^1.0.4",
|
|
49
|
+
"string.prototype.trimstart": "^1.0.4",
|
|
50
|
+
"unbox-primitive": "^1.0.1"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"es-to-primitive": {
|
|
54
|
+
"version": "1.2.1",
|
|
55
|
+
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
|
|
56
|
+
"integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
|
|
57
|
+
"requires": {
|
|
58
|
+
"is-callable": "^1.1.4",
|
|
59
|
+
"is-date-object": "^1.0.1",
|
|
60
|
+
"is-symbol": "^1.0.2"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"eslint-config-airbnb-base": {
|
|
64
|
+
"version": "14.2.1",
|
|
65
|
+
"resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz",
|
|
66
|
+
"integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==",
|
|
67
|
+
"requires": {
|
|
68
|
+
"confusing-browser-globals": "^1.0.10",
|
|
69
|
+
"object.assign": "^4.1.2",
|
|
70
|
+
"object.entries": "^1.1.2"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"function-bind": {
|
|
74
|
+
"version": "1.1.1",
|
|
75
|
+
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
|
76
|
+
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
|
77
|
+
},
|
|
78
|
+
"get-intrinsic": {
|
|
79
|
+
"version": "1.1.1",
|
|
80
|
+
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
|
|
81
|
+
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
|
|
82
|
+
"requires": {
|
|
83
|
+
"function-bind": "^1.1.1",
|
|
84
|
+
"has": "^1.0.3",
|
|
85
|
+
"has-symbols": "^1.0.1"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"has": {
|
|
89
|
+
"version": "1.0.3",
|
|
90
|
+
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
|
91
|
+
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
|
92
|
+
"requires": {
|
|
93
|
+
"function-bind": "^1.1.1"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"has-bigints": {
|
|
97
|
+
"version": "1.0.1",
|
|
98
|
+
"resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz",
|
|
99
|
+
"integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA=="
|
|
100
|
+
},
|
|
101
|
+
"has-symbols": {
|
|
102
|
+
"version": "1.0.2",
|
|
103
|
+
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
|
|
104
|
+
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw=="
|
|
105
|
+
},
|
|
106
|
+
"has-tostringtag": {
|
|
107
|
+
"version": "1.0.0",
|
|
108
|
+
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
|
|
109
|
+
"integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
|
|
110
|
+
"requires": {
|
|
111
|
+
"has-symbols": "^1.0.2"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"internal-slot": {
|
|
115
|
+
"version": "1.0.3",
|
|
116
|
+
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz",
|
|
117
|
+
"integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==",
|
|
118
|
+
"requires": {
|
|
119
|
+
"get-intrinsic": "^1.1.0",
|
|
120
|
+
"has": "^1.0.3",
|
|
121
|
+
"side-channel": "^1.0.4"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"is-bigint": {
|
|
125
|
+
"version": "1.0.3",
|
|
126
|
+
"resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.3.tgz",
|
|
127
|
+
"integrity": "sha512-ZU538ajmYJmzysE5yU4Y7uIrPQ2j704u+hXFiIPQExpqzzUbpe5jCPdTfmz7jXRxZdvjY3KZ3ZNenoXQovX+Dg=="
|
|
128
|
+
},
|
|
129
|
+
"is-boolean-object": {
|
|
130
|
+
"version": "1.1.2",
|
|
131
|
+
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
|
|
132
|
+
"integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
|
|
133
|
+
"requires": {
|
|
134
|
+
"call-bind": "^1.0.2",
|
|
135
|
+
"has-tostringtag": "^1.0.0"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"is-callable": {
|
|
139
|
+
"version": "1.2.4",
|
|
140
|
+
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
|
|
141
|
+
"integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w=="
|
|
142
|
+
},
|
|
143
|
+
"is-date-object": {
|
|
144
|
+
"version": "1.0.5",
|
|
145
|
+
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
|
|
146
|
+
"integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
|
|
147
|
+
"requires": {
|
|
148
|
+
"has-tostringtag": "^1.0.0"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"is-negative-zero": {
|
|
152
|
+
"version": "2.0.1",
|
|
153
|
+
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
|
|
154
|
+
"integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w=="
|
|
155
|
+
},
|
|
156
|
+
"is-number-object": {
|
|
157
|
+
"version": "1.0.6",
|
|
158
|
+
"resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz",
|
|
159
|
+
"integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==",
|
|
160
|
+
"requires": {
|
|
161
|
+
"has-tostringtag": "^1.0.0"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"is-regex": {
|
|
165
|
+
"version": "1.1.4",
|
|
166
|
+
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
|
167
|
+
"integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
|
|
168
|
+
"requires": {
|
|
169
|
+
"call-bind": "^1.0.2",
|
|
170
|
+
"has-tostringtag": "^1.0.0"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"is-string": {
|
|
174
|
+
"version": "1.0.7",
|
|
175
|
+
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
|
|
176
|
+
"integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
|
|
177
|
+
"requires": {
|
|
178
|
+
"has-tostringtag": "^1.0.0"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"is-symbol": {
|
|
182
|
+
"version": "1.0.4",
|
|
183
|
+
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
|
|
184
|
+
"integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
|
|
185
|
+
"requires": {
|
|
186
|
+
"has-symbols": "^1.0.2"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"object-inspect": {
|
|
190
|
+
"version": "1.11.0",
|
|
191
|
+
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
|
|
192
|
+
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg=="
|
|
193
|
+
},
|
|
194
|
+
"object-keys": {
|
|
195
|
+
"version": "1.1.1",
|
|
196
|
+
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
|
197
|
+
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
|
|
198
|
+
},
|
|
199
|
+
"object.assign": {
|
|
200
|
+
"version": "4.1.2",
|
|
201
|
+
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
|
|
202
|
+
"integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
|
|
203
|
+
"requires": {
|
|
204
|
+
"call-bind": "^1.0.0",
|
|
205
|
+
"define-properties": "^1.1.3",
|
|
206
|
+
"has-symbols": "^1.0.1",
|
|
207
|
+
"object-keys": "^1.1.1"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"object.entries": {
|
|
211
|
+
"version": "1.1.4",
|
|
212
|
+
"resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.4.tgz",
|
|
213
|
+
"integrity": "sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA==",
|
|
214
|
+
"requires": {
|
|
215
|
+
"call-bind": "^1.0.2",
|
|
216
|
+
"define-properties": "^1.1.3",
|
|
217
|
+
"es-abstract": "^1.18.2"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"side-channel": {
|
|
221
|
+
"version": "1.0.4",
|
|
222
|
+
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
|
|
223
|
+
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
|
|
224
|
+
"requires": {
|
|
225
|
+
"call-bind": "^1.0.0",
|
|
226
|
+
"get-intrinsic": "^1.0.2",
|
|
227
|
+
"object-inspect": "^1.9.0"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"string.prototype.trimend": {
|
|
231
|
+
"version": "1.0.4",
|
|
232
|
+
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
|
|
233
|
+
"integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
|
|
234
|
+
"requires": {
|
|
235
|
+
"call-bind": "^1.0.2",
|
|
236
|
+
"define-properties": "^1.1.3"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"string.prototype.trimstart": {
|
|
240
|
+
"version": "1.0.4",
|
|
241
|
+
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
|
|
242
|
+
"integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
|
|
243
|
+
"requires": {
|
|
244
|
+
"call-bind": "^1.0.2",
|
|
245
|
+
"define-properties": "^1.1.3"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"unbox-primitive": {
|
|
249
|
+
"version": "1.0.1",
|
|
250
|
+
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
|
|
251
|
+
"integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
|
|
252
|
+
"requires": {
|
|
253
|
+
"function-bind": "^1.1.1",
|
|
254
|
+
"has-bigints": "^1.0.1",
|
|
255
|
+
"has-symbols": "^1.0.2",
|
|
256
|
+
"which-boxed-primitive": "^1.0.2"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"which-boxed-primitive": {
|
|
260
|
+
"version": "1.0.2",
|
|
261
|
+
"resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
|
|
262
|
+
"integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
|
|
263
|
+
"requires": {
|
|
264
|
+
"is-bigint": "^1.0.1",
|
|
265
|
+
"is-boolean-object": "^1.1.0",
|
|
266
|
+
"is-number-object": "^1.0.4",
|
|
267
|
+
"is-string": "^1.0.5",
|
|
268
|
+
"is-symbol": "^1.0.3"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eslint-config-nodebb",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"eslint-config-airbnb-base": "14.2.1"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"eslint": "7.x",
|
|
16
|
+
"eslint-plugin-import": "2.x"
|
|
17
|
+
},
|
|
18
|
+
"license": "ISC"
|
|
19
|
+
}
|
package/public.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"globals": {
|
|
3
|
+
"app": true,
|
|
4
|
+
"io": true,
|
|
5
|
+
"socket": true,
|
|
6
|
+
"ajaxify": true,
|
|
7
|
+
"config": true,
|
|
8
|
+
"utils": true,
|
|
9
|
+
"overrides": true,
|
|
10
|
+
"componentHandler": true,
|
|
11
|
+
"bootbox": true,
|
|
12
|
+
"Visibility": true,
|
|
13
|
+
"Tinycon": true,
|
|
14
|
+
"Promise": true,
|
|
15
|
+
"navigator": true
|
|
16
|
+
},
|
|
17
|
+
"env": {
|
|
18
|
+
"jquery": true,
|
|
19
|
+
"amd": true,
|
|
20
|
+
"browser": true,
|
|
21
|
+
"es6": true
|
|
22
|
+
},
|
|
23
|
+
"rules": {
|
|
24
|
+
"comma-dangle": ["error", {
|
|
25
|
+
"arrays": "always-multiline",
|
|
26
|
+
"objects": "always-multiline",
|
|
27
|
+
"imports": "always-multiline",
|
|
28
|
+
"exports": "always-multiline",
|
|
29
|
+
"functions": "never"
|
|
30
|
+
}],
|
|
31
|
+
"block-scoped-var": "off",
|
|
32
|
+
"no-dupe-class-members": "off",
|
|
33
|
+
"prefer-object-spread": "off",
|
|
34
|
+
"prefer-reflect": "off",
|
|
35
|
+
|
|
36
|
+
// ES6
|
|
37
|
+
"prefer-rest-params": "off",
|
|
38
|
+
"prefer-spread": "off",
|
|
39
|
+
"prefer-arrow-callback": "off",
|
|
40
|
+
"prefer-template": "off",
|
|
41
|
+
"no-var": "off",
|
|
42
|
+
"object-shorthand": "off",
|
|
43
|
+
"vars-on-top": "off",
|
|
44
|
+
"prefer-destructuring": "off",
|
|
45
|
+
// identical to airbnb rule
|
|
46
|
+
// except for allowing for..in, because for..of is unavailable on some clients
|
|
47
|
+
"no-restricted-syntax": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
"selector": "ForOfStatement",
|
|
51
|
+
"message": "iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"selector": "LabeledStatement",
|
|
55
|
+
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"selector": "WithStatement",
|
|
59
|
+
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"parserOptions": {
|
|
64
|
+
"ecmaVersion": 2018,
|
|
65
|
+
"ecmaFeatures": {
|
|
66
|
+
"classes": false,
|
|
67
|
+
"defaultParams": false,
|
|
68
|
+
"blockBindings": false,
|
|
69
|
+
"forOf": false,
|
|
70
|
+
"generators": false,
|
|
71
|
+
"globalReturn": false,
|
|
72
|
+
"jsx": false,
|
|
73
|
+
"modules": false,
|
|
74
|
+
"objectLiteralComputedProperties": false,
|
|
75
|
+
"objectLiteralDuplicateProperties": false,
|
|
76
|
+
"objectLiteralShorthandMethods": false,
|
|
77
|
+
"objectLiteralShorthandProperties": false,
|
|
78
|
+
"impliedStrict": false,
|
|
79
|
+
"restParams": false,
|
|
80
|
+
"superInFunctions": false
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|