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