@brybrant/eslint-config 0.0.6 → 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 +4 -4
- package/dist/eslint.config.js +20 -11
- package/package.json +4 -4
package/dist/eslint.config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfigWithExtends } from "@eslint/config-helpers";
|
|
2
2
|
|
|
3
3
|
//#region eslint.config.d.ts
|
|
4
4
|
/**
|
|
@@ -7,14 +7,14 @@ import { Linter } from "eslint";
|
|
|
7
7
|
* Ignores all files in the `dist` folder within the current working directory.
|
|
8
8
|
*
|
|
9
9
|
* ### Configs:
|
|
10
|
-
* 1. [Recommended
|
|
11
|
-
* 2. {@link tseslintConfig my
|
|
10
|
+
* 1. [Recommended JavaScript ESLint config](https://www.npmjs.com/@eslint/js)
|
|
11
|
+
* 2. {@link tseslintConfig my TypeScript ESLint config}
|
|
12
12
|
* 3. **ESLint config object(s)** *(rest parameter)*
|
|
13
13
|
* 4. [my Prettier config](https://www.npmjs.com/@brybrant/prettier-config)
|
|
14
14
|
* 5. {@link jsdocConfigs JSDoc ESLint config}
|
|
15
15
|
*
|
|
16
16
|
* @param configs - [ESLint config object(s)](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects)
|
|
17
17
|
*/
|
|
18
|
-
declare const eslintConfig: (...configs:
|
|
18
|
+
declare const eslintConfig: (...configs: ConfigWithExtends[]) => ConfigWithExtends[];
|
|
19
19
|
//#endregion
|
|
20
20
|
export { eslintConfig as default };
|
package/dist/eslint.config.js
CHANGED
|
@@ -6,9 +6,10 @@ 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,7 +18,10 @@ 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
26
|
/** https://github.com/gajus/eslint-plugin-jsdoc#configuration */
|
|
23
27
|
const jsdocBaseConfig = {
|
|
@@ -28,7 +32,7 @@ const jsdocBaseConfig = {
|
|
|
28
32
|
"jsdoc/no-blank-block-descriptions": 1,
|
|
29
33
|
"jsdoc/no-blank-blocks": 1,
|
|
30
34
|
"jsdoc/no-defaults": 1,
|
|
31
|
-
"jsdoc/no-multi-asterisks": [1, {
|
|
35
|
+
"jsdoc/no-multi-asterisks": [1, { allowWhitespace: true }],
|
|
32
36
|
"jsdoc/require-asterisk-prefix": 1
|
|
33
37
|
},
|
|
34
38
|
settings: { tagNamePreference: {
|
|
@@ -36,16 +40,21 @@ const jsdocBaseConfig = {
|
|
|
36
40
|
augments: "extends"
|
|
37
41
|
} }
|
|
38
42
|
};
|
|
39
|
-
const jsdocConfigs = [
|
|
43
|
+
const jsdocConfigs = [(
|
|
44
|
+
/** JavaScript */
|
|
45
|
+
{
|
|
46
|
+
extends: [eslintPluginJSDoc.configs["flat/recommended-typescript-flavor"], jsdocBaseConfig],
|
|
40
47
|
files: ["./**/*.{js,jsx,cjs,mjs}"],
|
|
41
|
-
rules:
|
|
48
|
+
rules: {
|
|
42
49
|
"jsdoc/require-param-description": 0,
|
|
43
50
|
"jsdoc/require-property-description": 0,
|
|
44
51
|
"jsdoc/require-returns": 0
|
|
45
|
-
}
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
}
|
|
53
|
+
}), (
|
|
54
|
+
/** TypeScript */
|
|
55
|
+
{
|
|
56
|
+
extends: [eslintPluginJSDoc.configs["flat/recommended-typescript"], jsdocBaseConfig],
|
|
57
|
+
files: ["./**/*.{ts,tsx,cts,mts}"]
|
|
49
58
|
})];
|
|
50
59
|
/**
|
|
51
60
|
* ## ESLint Config Function
|
|
@@ -53,8 +62,8 @@ const jsdocConfigs = [Object.assign({}, jsdocBaseConfig, {
|
|
|
53
62
|
* Ignores all files in the `dist` folder within the current working directory.
|
|
54
63
|
*
|
|
55
64
|
* ### Configs:
|
|
56
|
-
* 1. [Recommended
|
|
57
|
-
* 2. {@link tseslintConfig my
|
|
65
|
+
* 1. [Recommended JavaScript ESLint config](https://www.npmjs.com/@eslint/js)
|
|
66
|
+
* 2. {@link tseslintConfig my TypeScript ESLint config}
|
|
58
67
|
* 3. **ESLint config object(s)** *(rest parameter)*
|
|
59
68
|
* 4. [my Prettier config](https://www.npmjs.com/@brybrant/prettier-config)
|
|
60
69
|
* 5. {@link jsdocConfigs JSDoc ESLint config}
|
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,13 +15,13 @@
|
|
|
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
27
|
"eslint": "9.x || 10.x"
|