@brybrant/eslint-config 0.0.4 → 0.0.6

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.
@@ -2,19 +2,19 @@ import { Linter } from "eslint";
2
2
 
3
3
  //#region eslint.config.d.ts
4
4
  /**
5
- * ## ESLint Config Function
6
- *
7
- * Ignores all files in the `dist` folder within the current working directory.
8
- *
9
- * ### Configs:
10
- * 1. [Recommended JS ESLint config](https://www.npmjs.com/@eslint/js)
11
- * 2. {@link tseslintConfig my TS ESLint config}
12
- * 3. **ESLint config object(s)** *(rest parameter)*
13
- * 4. [my Prettier config](https://www.npmjs.com/@brybrant/prettier-config)
14
- * 5. {@link jsdocConfigs JSDoc ESLint config}
15
- *
16
- * @param configs - [ESLint config object(s)](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects)
17
- */
18
- declare function export_default(...configs: Linter.Config[]): Linter.Config[];
5
+ * ## ESLint Config Function
6
+ *
7
+ * Ignores all files in the `dist` folder within the current working directory.
8
+ *
9
+ * ### Configs:
10
+ * 1. [Recommended JS ESLint config](https://www.npmjs.com/@eslint/js)
11
+ * 2. {@link tseslintConfig my TS ESLint config}
12
+ * 3. **ESLint config object(s)** *(rest parameter)*
13
+ * 4. [my Prettier config](https://www.npmjs.com/@brybrant/prettier-config)
14
+ * 5. {@link jsdocConfigs JSDoc ESLint config}
15
+ *
16
+ * @param configs - [ESLint config object(s)](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects)
17
+ */
18
+ declare const eslintConfig: (...configs: Linter.Config[]) => Linter.Config[];
19
19
  //#endregion
20
- export { export_default as default };
20
+ export { eslintConfig as default };
@@ -1,7 +1,7 @@
1
1
  import { defineConfig, globalIgnores } from "eslint/config";
2
2
  import globals from "globals";
3
3
  import js from "@eslint/js";
4
- import { jsdoc } from "eslint-plugin-jsdoc";
4
+ import eslintPluginJSDoc from "eslint-plugin-jsdoc";
5
5
  import eslintPluginPrettier from "eslint-plugin-prettier/recommended";
6
6
  import tseslint from "typescript-eslint";
7
7
  import prettierConfig from "@brybrant/prettier-config";
@@ -19,14 +19,9 @@ const tseslintConfig = {
19
19
  },
20
20
  rules: tseslint.configs.strictTypeChecked.reduce((rules, config) => Object.assign(rules, config.rules ?? {}), {})
21
21
  };
22
- const jsdocSettings = { tagNamePreference: {
23
- property: "prop",
24
- augments: "extends"
25
- } };
26
22
  /** https://github.com/gajus/eslint-plugin-jsdoc#configuration */
27
- const jsdocConfigs = [jsdoc({
28
- files: ["./**/*.{js,jsx,cjs,mjs}"],
29
- config: "flat/recommended-typescript-flavor",
23
+ const jsdocBaseConfig = {
24
+ plugins: { jsdoc: eslintPluginJSDoc },
30
25
  rules: {
31
26
  "jsdoc/check-indentation": 1,
32
27
  "jsdoc/check-syntax": 1,
@@ -34,25 +29,23 @@ const jsdocConfigs = [jsdoc({
34
29
  "jsdoc/no-blank-blocks": 1,
35
30
  "jsdoc/no-defaults": 1,
36
31
  "jsdoc/no-multi-asterisks": [1, { "allowWhitespace": true }],
37
- "jsdoc/require-asterisk-prefix": 1,
32
+ "jsdoc/require-asterisk-prefix": 1
33
+ },
34
+ settings: { tagNamePreference: {
35
+ property: "prop",
36
+ augments: "extends"
37
+ } }
38
+ };
39
+ const jsdocConfigs = [Object.assign({}, jsdocBaseConfig, {
40
+ files: ["./**/*.{js,jsx,cjs,mjs}"],
41
+ rules: Object.assign({}, eslintPluginJSDoc.configs["flat/recommended-typescript-flavor"].rules, jsdocBaseConfig.rules, {
38
42
  "jsdoc/require-param-description": 0,
39
43
  "jsdoc/require-property-description": 0,
40
44
  "jsdoc/require-returns": 0
41
- },
42
- settings: jsdocSettings
43
- }), jsdoc({
45
+ })
46
+ }), Object.assign({}, jsdocBaseConfig, {
44
47
  files: ["./**/*.{ts,tsx,cts,mts}"],
45
- config: "flat/recommended-typescript",
46
- rules: {
47
- "jsdoc/check-indentation": 1,
48
- "jsdoc/check-syntax": 1,
49
- "jsdoc/no-blank-block-descriptions": 1,
50
- "jsdoc/no-blank-blocks": 1,
51
- "jsdoc/no-defaults": 1,
52
- "jsdoc/no-multi-asterisks": [1, { "allowWhitespace": true }],
53
- "jsdoc/require-asterisk-prefix": 1
54
- },
55
- settings: jsdocSettings
48
+ rules: Object.assign({}, eslintPluginJSDoc.configs["flat/recommended-typescript"].rules, jsdocBaseConfig.rules)
56
49
  })];
57
50
  /**
58
51
  * ## ESLint Config Function
@@ -68,7 +61,7 @@ const jsdocConfigs = [jsdoc({
68
61
  *
69
62
  * @param configs - [ESLint config object(s)](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects)
70
63
  */
71
- function eslint_config_default(...configs) {
64
+ const eslintConfig = (...configs) => {
72
65
  return defineConfig([
73
66
  globalIgnores(["./dist/**/*"]),
74
67
  js.configs.recommended,
@@ -84,6 +77,6 @@ function eslint_config_default(...configs) {
84
77
  },
85
78
  ...jsdocConfigs
86
79
  ]);
87
- }
80
+ };
88
81
  //#endregion
89
- export { eslint_config_default as default };
82
+ export { eslintConfig as default };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@brybrant/eslint-config",
3
3
  "author": "brybrant",
4
4
  "license": "GPL-3.0-only",
5
- "version": "0.0.4",
5
+ "version": "0.0.6",
6
6
  "type": "module",
7
7
  "module": "./dist/eslint.config.js",
8
8
  "types": "./dist/eslint.config.d.ts",
@@ -17,14 +17,15 @@
17
17
  "dependencies": {
18
18
  "@brybrant/prettier-config": "^0.0.3",
19
19
  "@types/node": "^22.19.17",
20
- "eslint": "^9.39.4",
21
20
  "eslint-config-prettier": "^10.1.8",
22
21
  "eslint-plugin-jsdoc": "^62.8.1",
23
22
  "eslint-plugin-prettier": "^5.5.5",
24
23
  "globals": "^17.4.0",
25
- "prettier": "^3.8.1",
26
24
  "typescript-eslint": "^8.58.0"
27
25
  },
26
+ "peerDependencies": {
27
+ "eslint": "9.x || 10.x"
28
+ },
28
29
  "devDependencies": {
29
30
  "@types/eslint": "^9.6.1",
30
31
  "typescript": "^5.9.3"