@brybrant/eslint-config 0.0.5 → 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.
- package/dist/eslint.config.d.ts +16 -16
- package/dist/eslint.config.js +34 -32
- package/package.json +5 -5
package/dist/eslint.config.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfigWithExtends } from "@eslint/config-helpers";
|
|
2
2
|
|
|
3
3
|
//#region eslint.config.d.ts
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare
|
|
5
|
+
* ## ESLint Config Function
|
|
6
|
+
*
|
|
7
|
+
* Ignores all files in the `dist` folder within the current working directory.
|
|
8
|
+
*
|
|
9
|
+
* ### Configs:
|
|
10
|
+
* 1. [Recommended JavaScript ESLint config](https://www.npmjs.com/@eslint/js)
|
|
11
|
+
* 2. {@link tseslintConfig my TypeScript 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: ConfigWithExtends[]) => ConfigWithExtends[];
|
|
19
19
|
//#endregion
|
|
20
|
-
export {
|
|
20
|
+
export { eslintConfig as default };
|
package/dist/eslint.config.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import globals from "globals";
|
|
3
3
|
import js from "@eslint/js";
|
|
4
|
-
import
|
|
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";
|
|
8
8
|
//#region eslint.config.ts
|
|
9
|
+
/** https://typescript-eslint.io/rules/ */
|
|
9
10
|
const tseslintConfig = {
|
|
11
|
+
extends: tseslint.configs.strictTypeChecked,
|
|
10
12
|
files: ["./**/*.{ts,tsx,cts,mts}"],
|
|
11
|
-
plugins: { "@typescript-eslint": tseslint.plugin },
|
|
12
13
|
languageOptions: {
|
|
13
14
|
parser: tseslint.parser,
|
|
14
15
|
globals: globals.nodeBuiltin,
|
|
@@ -17,42 +18,43 @@ const tseslintConfig = {
|
|
|
17
18
|
tsconfigRootDir: import.meta.dirname
|
|
18
19
|
}
|
|
19
20
|
},
|
|
20
|
-
rules:
|
|
21
|
+
rules: { "@typescript-eslint/restrict-template-expressions": [1, {
|
|
22
|
+
allowBoolean: true,
|
|
23
|
+
allowNumber: true
|
|
24
|
+
}] }
|
|
21
25
|
};
|
|
22
|
-
const jsdocSettings = { tagNamePreference: {
|
|
23
|
-
property: "prop",
|
|
24
|
-
augments: "extends"
|
|
25
|
-
} };
|
|
26
26
|
/** https://github.com/gajus/eslint-plugin-jsdoc#configuration */
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
config: "flat/recommended-typescript-flavor",
|
|
27
|
+
const jsdocBaseConfig = {
|
|
28
|
+
plugins: { jsdoc: eslintPluginJSDoc },
|
|
30
29
|
rules: {
|
|
31
30
|
"jsdoc/check-indentation": 1,
|
|
32
31
|
"jsdoc/check-syntax": 1,
|
|
33
32
|
"jsdoc/no-blank-block-descriptions": 1,
|
|
34
33
|
"jsdoc/no-blank-blocks": 1,
|
|
35
34
|
"jsdoc/no-defaults": 1,
|
|
36
|
-
"jsdoc/no-multi-asterisks": [1, {
|
|
37
|
-
"jsdoc/require-asterisk-prefix": 1
|
|
35
|
+
"jsdoc/no-multi-asterisks": [1, { allowWhitespace: true }],
|
|
36
|
+
"jsdoc/require-asterisk-prefix": 1
|
|
37
|
+
},
|
|
38
|
+
settings: { tagNamePreference: {
|
|
39
|
+
property: "prop",
|
|
40
|
+
augments: "extends"
|
|
41
|
+
} }
|
|
42
|
+
};
|
|
43
|
+
const jsdocConfigs = [(
|
|
44
|
+
/** JavaScript */
|
|
45
|
+
{
|
|
46
|
+
extends: [eslintPluginJSDoc.configs["flat/recommended-typescript-flavor"], jsdocBaseConfig],
|
|
47
|
+
files: ["./**/*.{js,jsx,cjs,mjs}"],
|
|
48
|
+
rules: {
|
|
38
49
|
"jsdoc/require-param-description": 0,
|
|
39
50
|
"jsdoc/require-property-description": 0,
|
|
40
51
|
"jsdoc/require-returns": 0
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
52
|
+
}
|
|
53
|
+
}), (
|
|
54
|
+
/** TypeScript */
|
|
55
|
+
{
|
|
56
|
+
extends: [eslintPluginJSDoc.configs["flat/recommended-typescript"], jsdocBaseConfig],
|
|
57
|
+
files: ["./**/*.{ts,tsx,cts,mts}"]
|
|
56
58
|
})];
|
|
57
59
|
/**
|
|
58
60
|
* ## ESLint Config Function
|
|
@@ -60,15 +62,15 @@ const jsdocConfigs = [jsdoc({
|
|
|
60
62
|
* Ignores all files in the `dist` folder within the current working directory.
|
|
61
63
|
*
|
|
62
64
|
* ### Configs:
|
|
63
|
-
* 1. [Recommended
|
|
64
|
-
* 2. {@link tseslintConfig my
|
|
65
|
+
* 1. [Recommended JavaScript ESLint config](https://www.npmjs.com/@eslint/js)
|
|
66
|
+
* 2. {@link tseslintConfig my TypeScript ESLint config}
|
|
65
67
|
* 3. **ESLint config object(s)** *(rest parameter)*
|
|
66
68
|
* 4. [my Prettier config](https://www.npmjs.com/@brybrant/prettier-config)
|
|
67
69
|
* 5. {@link jsdocConfigs JSDoc ESLint config}
|
|
68
70
|
*
|
|
69
71
|
* @param configs - [ESLint config object(s)](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects)
|
|
70
72
|
*/
|
|
71
|
-
|
|
73
|
+
const eslintConfig = (...configs) => {
|
|
72
74
|
return defineConfig([
|
|
73
75
|
globalIgnores(["./dist/**/*"]),
|
|
74
76
|
js.configs.recommended,
|
|
@@ -84,6 +86,6 @@ function eslint_config_default(...configs) {
|
|
|
84
86
|
},
|
|
85
87
|
...jsdocConfigs
|
|
86
88
|
]);
|
|
87
|
-
}
|
|
89
|
+
};
|
|
88
90
|
//#endregion
|
|
89
|
-
export {
|
|
91
|
+
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
|
|
5
|
+
"version": "0.1.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"module": "./dist/eslint.config.js",
|
|
8
8
|
"types": "./dist/eslint.config.d.ts",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"url": "git+https://github.com/brybrant/configs.git"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@brybrant/prettier-config": "^0.0.
|
|
18
|
+
"@brybrant/prettier-config": "^0.0.4",
|
|
19
19
|
"@types/node": "^22.19.17",
|
|
20
20
|
"eslint-config-prettier": "^10.1.8",
|
|
21
21
|
"eslint-plugin-jsdoc": "^62.8.1",
|
|
22
22
|
"eslint-plugin-prettier": "^5.5.5",
|
|
23
|
-
"globals": "^17.
|
|
24
|
-
"typescript-eslint": "^8.58.
|
|
23
|
+
"globals": "^17.5.0",
|
|
24
|
+
"typescript-eslint": "^8.58.1"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"eslint": "
|
|
27
|
+
"eslint": "9.x || 10.x"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/eslint": "^9.6.1",
|