@hellomouse/eslint-config 2.0.0-stylistic.1 → 2.0.1-flat.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.
- package/index.js +71 -64
- package/package.json +16 -8
package/index.js
CHANGED
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
'@hellomouse/google',
|
|
5
|
-
'plugin:jsdoc/recommended'
|
|
6
|
-
],
|
|
7
|
-
// use new jsdoc comment as jsdoc functionality in core eslint is deprecated
|
|
8
|
-
plugins: ['@stylistic', 'jsdoc'],
|
|
9
|
-
rules: {
|
|
10
|
-
// highly subjective: dangling commas feel weird,
|
|
11
|
-
'comma-dangle': ['error', 'never'],
|
|
1
|
+
import google from '@hellomouse/eslint-config-google';
|
|
2
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
|
3
|
+
import js from "@eslint/js";
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
/** @type {import("eslint").Linter.FlatConfig[]} */
|
|
6
|
+
export default [
|
|
7
|
+
js.configs.recommended,
|
|
8
|
+
...google,
|
|
9
|
+
jsdoc.configs.recommended,
|
|
10
|
+
{
|
|
11
|
+
// use new jsdoc comment as jsdoc functionality in core eslint is deprecated
|
|
12
|
+
plugins: {
|
|
13
|
+
jsdoc: jsdoc
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
// highly subjective: dangling commas feel weird,
|
|
17
|
+
'comma-dangle': ['error', 'never'],
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
// so you can do n => +n instead of (n) => +n
|
|
20
|
+
'arrow-parens': ['error', 'as-needed'],
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
// 2 spaces for indent
|
|
23
|
+
'indent': ['error', 2, { SwitchCase: 1 }],
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'object-curly-spacing': ['error', 'always'],
|
|
25
|
+
// console.log() is often used in node.js
|
|
26
|
+
'no-console': 'off',
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
// spaces after curly brackets look cleaner ({a: 4} vs { a: 4 })
|
|
29
|
+
// also done by util.inspect
|
|
30
|
+
'object-curly-spacing': ['error', 'always'],
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'max-len': ['error', {
|
|
32
|
-
code: 120,
|
|
33
|
-
ignoreUrls: true,
|
|
34
|
-
ignoreStrings: true,
|
|
35
|
-
ignoreTemplateLiterals: true,
|
|
36
|
-
ignoreRegExpLiterals: true
|
|
37
|
-
}],
|
|
32
|
+
// a + b rather than a+b, but allow integer hints to not have spaces (eg. b|0)
|
|
33
|
+
'space-infix-ops': ['error', { int32Hint: true }],
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
// lines should generally be kept short but definitely shouldn't be over 120 characters
|
|
36
|
+
// allow long strings and regexes though
|
|
37
|
+
'max-len': ['error', {
|
|
38
|
+
code: 120,
|
|
39
|
+
ignoreUrls: true,
|
|
40
|
+
ignoreStrings: true,
|
|
41
|
+
ignoreTemplateLiterals: true,
|
|
42
|
+
ignoreRegExpLiterals: true
|
|
43
|
+
}],
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'prefer-const': 'off',
|
|
45
|
+
// == has weird behavior with types, always use === instead
|
|
46
|
+
'eqeqeq': ['error', 'always'],
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
// errors due to unintentional reassigning generally are quite rare, in addition,
|
|
49
|
+
// changing from const to let is a bit annoying
|
|
50
|
+
'prefer-const': 'off',
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/*
|
|
52
|
-
* Adds given numbers
|
|
53
|
-
*
|
|
54
|
-
* @param {Number} a First number
|
|
55
|
-
* @param {Number} b Second number
|
|
56
|
-
* @return {Number} The result of the operation
|
|
57
|
-
*/
|
|
58
|
-
'jsdoc/require-param-description': 'off',
|
|
59
|
-
'jsdoc/require-returns-description': 'off',
|
|
52
|
+
// allow while (true)
|
|
53
|
+
'no-constant-condition': ['error', { checkLoops: false }],
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
// descriptions on params and return is often redundant
|
|
56
|
+
// for example:
|
|
57
|
+
/*
|
|
58
|
+
* Adds given numbers
|
|
59
|
+
*
|
|
60
|
+
* @param {Number} a First number
|
|
61
|
+
* @param {Number} b Second number
|
|
62
|
+
* @return {Number} The result of the operation
|
|
63
|
+
*/
|
|
64
|
+
'jsdoc/require-param-description': 'off',
|
|
65
|
+
'jsdoc/require-returns-description': 'off',
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
// not everything needs to be a complete sentence
|
|
68
|
+
'jsdoc/require-description-complete-sentence': 'off',
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
// most things explain themselves
|
|
71
|
+
'jsdoc/require-example': 'off',
|
|
72
|
+
|
|
73
|
+
// don't worry about whether a newline exists after jsdoc description
|
|
74
|
+
'jsdoc/newline-after-description': 'off'
|
|
75
|
+
},
|
|
76
|
+
settings: {
|
|
77
|
+
jsdoc: {
|
|
78
|
+
tagNamePreference: {
|
|
79
|
+
// keep the ones currently in use
|
|
80
|
+
returns: { replacement: 'return' },
|
|
81
|
+
yields: { replacement: 'yield' },
|
|
82
|
+
augments: { replacement: 'extends' }
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
}
|
|
80
|
-
|
|
87
|
+
];
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hellomouse/eslint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1-flat.0",
|
|
4
4
|
"description": "Official ESLint config for Hellomouse, based off of Google's config",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -17,20 +18,27 @@
|
|
|
17
18
|
],
|
|
18
19
|
"author": "Hellomouse",
|
|
19
20
|
"contributors": [
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
{
|
|
22
|
+
"name": "iczero",
|
|
23
|
+
"email": "iczero4@gmail.com"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "wolfy1339",
|
|
27
|
+
"email": "webmaster@wolfy1339.com"
|
|
28
|
+
}
|
|
22
29
|
],
|
|
23
30
|
"license": "MIT",
|
|
24
31
|
"bugs": {
|
|
25
32
|
"url": "https://github.com/hellomouse/eslint-config/issues"
|
|
26
33
|
},
|
|
27
34
|
"homepage": "https://github.com/hellomouse/eslint-config#readme",
|
|
28
|
-
"
|
|
35
|
+
"dependencies": {
|
|
29
36
|
"@stylistic/eslint-plugin": ">= 1.1.0",
|
|
30
|
-
"eslint": "
|
|
31
|
-
"eslint-plugin-jsdoc": ">=
|
|
37
|
+
"@eslint/js": "^9.2.0",
|
|
38
|
+
"eslint-plugin-jsdoc": ">=48.2.3",
|
|
39
|
+
"@hellomouse/eslint-config-google": "../google"
|
|
32
40
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"eslint": ">=8.57"
|
|
35
43
|
}
|
|
36
44
|
}
|