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