@brybrant/eslint-config 0.0.1 → 0.0.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.
@@ -1,6 +1,6 @@
1
1
  import { Linter } from "eslint";
2
2
 
3
- //#region packages/eslint/eslint.config.d.ts
3
+ //#region eslint.config.d.ts
4
4
  /**
5
5
  * ## ESLint Config Function
6
6
  *
@@ -4,21 +4,8 @@ import js from "@eslint/js";
4
4
  import { jsdoc } from "eslint-plugin-jsdoc";
5
5
  import eslintPluginPrettier from "eslint-plugin-prettier/recommended";
6
6
  import tseslint from "typescript-eslint";
7
- //#region packages/prettier/prettier.config.mjs
8
- /**
9
- * ### Prettier Config Object
10
- *
11
- * https://prettier.io/docs/en/options
12
- */
13
- const prettierConfig = {
14
- bracketSameLine: false,
15
- bracketSpacing: true,
16
- endOfLine: "auto",
17
- singleQuote: true,
18
- jsxSingleQuote: true
19
- };
20
- //#endregion
21
- //#region packages/eslint/eslint.config.ts
7
+ import prettierConfig from "@brybrant/prettier-config";
8
+ //#region eslint.config.ts
22
9
  const tseslintConfig = {
23
10
  files: ["./**/*.{ts,tsx,cts,mts}"],
24
11
  plugins: { "@typescript-eslint": tseslint.plugin },
package/package.json CHANGED
@@ -2,17 +2,20 @@
2
2
  "name": "@brybrant/eslint-config",
3
3
  "author": "brybrant",
4
4
  "license": "GPL-3.0-only",
5
- "version": "0.0.1",
5
+ "version": "0.0.3",
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
+ "files": [
11
+ "dist"
12
+ ],
10
13
  "repository": {
11
14
  "type": "git",
12
15
  "url": "git+https://github.com/brybrant/configs.git"
13
16
  },
14
17
  "dependencies": {
15
- "@brybrant/prettier-config": "^0.0.1",
18
+ "@brybrant/prettier-config": "^0.0.3",
16
19
  "@types/node": "^22.19.15",
17
20
  "eslint": "^9.39.4",
18
21
  "eslint-config-prettier": "^10.1.8",
package/eslint.config.ts DELETED
@@ -1,109 +0,0 @@
1
- import type { Linter } from 'eslint';
2
- import type { RulesConfig } from '@eslint/core';
3
-
4
- import { defineConfig, globalIgnores } from 'eslint/config';
5
- import globals from 'globals';
6
- import js from '@eslint/js';
7
- import { jsdoc } from 'eslint-plugin-jsdoc';
8
- import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';
9
- import tseslint from 'typescript-eslint';
10
-
11
- import prettierConfig from '@brybrant/prettier-config';
12
-
13
- const tseslintConfig: Linter.Config = {
14
- files: ['./**/*.{ts,tsx,cts,mts}'],
15
- plugins: {
16
- '@typescript-eslint': tseslint.plugin,
17
- },
18
- languageOptions: {
19
- parser: tseslint.parser,
20
- globals: globals.nodeBuiltin,
21
- /** https://typescript-eslint.io/packages/parser */
22
- parserOptions: {
23
- /** Required for rules which need type information */
24
- projectService: true,
25
- /** Root directory for relative TSConfig paths */
26
- tsconfigRootDir: import.meta.dirname,
27
- },
28
- },
29
- rules: tseslint.configs.strictTypeChecked.reduce(
30
- (rules, config) => Object.assign(rules, config.rules ?? {}),
31
- {},
32
- ) as RulesConfig,
33
- };
34
-
35
- const jsdocSettings = {
36
- tagNamePreference: {
37
- property: 'prop',
38
- augments: 'extends',
39
- },
40
- };
41
-
42
- /** https://github.com/gajus/eslint-plugin-jsdoc#configuration */
43
- const jsdocConfigs = [
44
- /** JavaScript */
45
- jsdoc({
46
- files: ['./**/*.{js,jsx,cjs,mjs}'],
47
- config: 'flat/recommended-typescript-flavor',
48
- rules: {
49
- 'jsdoc/check-indentation': 1,
50
- 'jsdoc/check-syntax': 1,
51
- 'jsdoc/no-blank-block-descriptions': 1,
52
- 'jsdoc/no-blank-blocks': 1,
53
- 'jsdoc/no-defaults': 1,
54
- 'jsdoc/no-multi-asterisks': [1, { 'allowWhitespace': true }],
55
- 'jsdoc/require-asterisk-prefix': 1,
56
- 'jsdoc/require-param-description': 0,
57
- 'jsdoc/require-property-description': 0,
58
- 'jsdoc/require-returns': 0,
59
- },
60
- settings: jsdocSettings,
61
- }),
62
- /** TypeScript */
63
- jsdoc({
64
- files: ['./**/*.{ts,tsx,cts,mts}'],
65
- config: 'flat/recommended-typescript',
66
- rules: {
67
- 'jsdoc/check-indentation': 1,
68
- 'jsdoc/check-syntax': 1,
69
- 'jsdoc/no-blank-block-descriptions': 1,
70
- 'jsdoc/no-blank-blocks': 1,
71
- 'jsdoc/no-defaults': 1,
72
- 'jsdoc/no-multi-asterisks': [1, { 'allowWhitespace': true }],
73
- 'jsdoc/require-asterisk-prefix': 1,
74
- },
75
- settings: jsdocSettings,
76
- }),
77
- ];
78
-
79
- /**
80
- * ## ESLint Config Function
81
- *
82
- * Ignores all files in the `dist` folder within the current working directory.
83
- *
84
- * ### Configs:
85
- * 1. [Recommended JS ESLint config](https://www.npmjs.com/@eslint/js)
86
- * 2. {@link tseslintConfig my TS ESLint config}
87
- * 3. **ESLint config object(s)** *(rest parameter)*
88
- * 4. [my Prettier config](https://www.npmjs.com/@brybrant/prettier-config)
89
- * 5. {@link jsdocConfigs JSDoc ESLint config}
90
- *
91
- * @param configs - [ESLint config object(s)](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects)
92
- */
93
- export default function(...configs: Linter.Config[]): Linter.Config[] {
94
- return defineConfig([
95
- globalIgnores(['./dist/**/*']),
96
- js.configs.recommended,
97
- tseslintConfig,
98
- ...configs,
99
- {
100
- files: ['./**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts}'],
101
- plugins: eslintPluginPrettier.plugins,
102
- rules: {
103
- ...eslintPluginPrettier.rules,
104
- 'prettier/prettier': ['error', prettierConfig],
105
- },
106
- },
107
- ...jsdocConfigs,
108
- ]);
109
- };