@tsofist/web-buddy 1.22.0 → 2.0.0-next.10

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.
Files changed (62) hide show
  1. package/.editorconfig +33 -3
  2. package/LICENSE +167 -21
  3. package/README.md +4 -57
  4. package/lib/eslint/config.d.ts +1201 -0
  5. package/lib/eslint/config.fws-mercurio.d.ts +2 -0
  6. package/lib/eslint/config.fws-mercurio.js +15 -0
  7. package/lib/eslint/config.js +63 -0
  8. package/lib/eslint/config.json.d.ts +2 -0
  9. package/lib/eslint/config.json.js +20 -0
  10. package/lib/eslint/config.json.rules.d.ts +3 -0
  11. package/lib/eslint/config.json.rules.js +9 -0
  12. package/lib/eslint/config.shared.rules.d.ts +3 -0
  13. package/lib/eslint/config.shared.rules.js +70 -0
  14. package/lib/eslint/config.typescript.d.ts +2 -0
  15. package/lib/eslint/config.typescript.js +42 -0
  16. package/lib/eslint/config.typescript.rules.d.ts +2 -0
  17. package/lib/eslint/config.typescript.rules.js +149 -0
  18. package/lib/eslint/config.vue.d.ts +5 -0
  19. package/lib/eslint/config.vue.js +46 -0
  20. package/lib/eslint/config.vue.rules.d.ts +5 -0
  21. package/lib/eslint/config.vue.rules.js +61 -0
  22. package/lib/eslint/config.yaml.d.ts +2 -0
  23. package/lib/eslint/config.yaml.js +13 -0
  24. package/lib/eslint/config.yaml.rules.d.ts +2 -0
  25. package/lib/eslint/config.yaml.rules.js +8 -0
  26. package/lib/eslint/ignores.d.ts +1 -0
  27. package/lib/eslint/ignores.js +40 -0
  28. package/lib/prettier/config.d.ts +39 -0
  29. package/{.prettierrc.js → lib/prettier/config.js} +4 -3
  30. package/lib/semantic-release/config.github.d.ts +16 -0
  31. package/lib/semantic-release/config.github.js +3 -0
  32. package/lib/semantic-release/config.gitlab.d.ts +16 -0
  33. package/lib/semantic-release/config.gitlab.js +3 -0
  34. package/lib/semantic-release/configuration-bootstrap.d.ts +84 -0
  35. package/lib/semantic-release/configuration-bootstrap.js +53 -0
  36. package/lib/stricter-mode.d.ts +1 -0
  37. package/lib/stricter-mode.js +2 -0
  38. package/lib/stylelint/config.d.ts +11 -0
  39. package/lib/stylelint/config.js +21 -0
  40. package/lib/stylelint/rules.d.ts +2 -0
  41. package/lib/stylelint/rules.js +19 -0
  42. package/lib/tsconfig/config.base.json +18 -0
  43. package/lib/tsconfig/config.isomorphic.json +6 -0
  44. package/lib/tsconfig/config.web.json +11 -0
  45. package/lib/types.d.ts +14 -0
  46. package/lib/types.js +1 -0
  47. package/package.json +45 -46
  48. package/.eslintrc.yaml +0 -66
  49. package/.releaserc-github.json +0 -23
  50. package/.releaserc-gitlab.json +0 -23
  51. package/.stylelintrc.yaml +0 -49
  52. package/eslint/shared.yaml +0 -66
  53. package/eslint/stricter.extends.yaml +0 -10
  54. package/eslint/typescript/common.yaml +0 -20
  55. package/eslint/typescript/rules.yaml +0 -159
  56. package/eslint/typescript/stricter.rules.yaml +0 -4
  57. package/eslint/vue/common.yaml +0 -36
  58. package/eslint/vue/rules.yaml +0 -63
  59. package/eslint/yaml/common.yaml +0 -22
  60. package/tsconfig/base.json +0 -18
  61. package/tsconfig/browser.json +0 -10
  62. package/tsconfig/server.json +0 -6
@@ -0,0 +1,2 @@
1
+ import type { ESLintConfigChain } from '../types.js';
2
+ export declare const WebBuddyESLintFrameworkSpecificConfigForMercurio: ESLintConfigChain;
@@ -0,0 +1,15 @@
1
+ export const WebBuddyESLintFrameworkSpecificConfigForMercurio = [
2
+ {
3
+ files: ['**/*.controller.ts', '**/*.service.ts'],
4
+ rules: {
5
+ '@typescript-eslint/require-await': 'off',
6
+ },
7
+ },
8
+ {
9
+ files: ['**/service-api.types.ts'],
10
+ rules: {
11
+ '@typescript-eslint/consistent-type-definitions': 'off',
12
+ '@typescript-eslint/method-signature-style': ['error', 'method'],
13
+ },
14
+ },
15
+ ];
@@ -0,0 +1,63 @@
1
+ import epJS from '@eslint/js';
2
+ import epStylistic from '@stylistic/eslint-plugin';
3
+ import { defineConfig } from 'eslint/config';
4
+ import { importX as epImportX } from 'eslint-plugin-import-x';
5
+ import epPrettier from 'eslint-plugin-prettier';
6
+ import globals from 'globals';
7
+ import { WebBuddyESLintFrameworkSpecificConfigForMercurio } from './config.fws-mercurio.js';
8
+ import { WebBuddyESLintJSON } from './config.json.js';
9
+ import { WebBuddyESLintRulesShared } from './config.shared.rules.js';
10
+ import { WebBuddyESLintTypeScript } from './config.typescript.js';
11
+ import { WebBuddyESLintVue } from './config.vue.js';
12
+ import { WebBuddyESLintYAML } from './config.yaml.js';
13
+ import { WebBuddyESLintIgnores } from './ignores.js';
14
+ export default createWebBuddyESLintConfig();
15
+ export function createWebBuddyESLintConfig(onChain) {
16
+ let chain = createWebBuddyESLintConfigChain();
17
+ if (onChain)
18
+ chain = onChain(chain);
19
+ return defineConfig(...chain);
20
+ }
21
+ export function createWebBuddyESLintConfigChain() {
22
+ return [
23
+ ...createWebBuddyESLintConfigGeneralChain(),
24
+ ...WebBuddyESLintJSON,
25
+ WebBuddyESLintTypeScript,
26
+ WebBuddyESLintVue,
27
+ ...WebBuddyESLintFrameworkSpecificConfigForMercurio,
28
+ WebBuddyESLintYAML,
29
+ ];
30
+ }
31
+ function createWebBuddyESLintConfigGeneralChain() {
32
+ return [
33
+ { ignores: WebBuddyESLintIgnores },
34
+ {
35
+ plugins: {
36
+ '@stylistic': epStylistic,
37
+ 'prettier': epPrettier,
38
+ 'import-x': epImportX,
39
+ },
40
+ settings: {
41
+ 'import-x/resolver': { typescript: true },
42
+ },
43
+ },
44
+ {
45
+ // todo manage?
46
+ files: ['**/*.{js,cjs,mjs,jsx}'],
47
+ languageOptions: {
48
+ globals: {
49
+ ...globals.browser,
50
+ ...globals.node,
51
+ ...globals.jest,
52
+ },
53
+ },
54
+ },
55
+ epJS.configs.recommended,
56
+ {
57
+ rules: {
58
+ 'prettier/prettier': 'error',
59
+ ...WebBuddyESLintRulesShared,
60
+ },
61
+ },
62
+ ];
63
+ }
@@ -0,0 +1,2 @@
1
+ import type { ESLintConfigChain } from '../types.js';
2
+ export declare const WebBuddyESLintJSON: ESLintConfigChain;
@@ -0,0 +1,20 @@
1
+ import epJSONC from 'eslint-plugin-jsonc';
2
+ import { WebBuddyESLintJSONCRules, WebBuddyESLintJSONRules } from './config.json.rules.js';
3
+ import { WebBuddyESLintRulesShared } from './config.shared.rules.js';
4
+ export const WebBuddyESLintJSON = [
5
+ {
6
+ files: ['**/*.{json,jsonc,json5}'],
7
+ extends: [epJSONC.configs['flat/all'], epJSONC.configs['flat/prettier']],
8
+ rules: {
9
+ ...WebBuddyESLintRulesShared,
10
+ ...WebBuddyESLintJSONRules,
11
+ },
12
+ },
13
+ {
14
+ files: ['**/*.{jsonc,json5}', 'tsconfig.json', 'tsconfig.*.json'],
15
+ rules: {
16
+ ...WebBuddyESLintRulesShared,
17
+ ...WebBuddyESLintJSONCRules,
18
+ },
19
+ },
20
+ ];
@@ -0,0 +1,3 @@
1
+ import type { ESLintRuleSet } from '../types.js';
2
+ export declare const WebBuddyESLintJSONRules: ESLintRuleSet;
3
+ export declare const WebBuddyESLintJSONCRules: ESLintRuleSet;
@@ -0,0 +1,9 @@
1
+ export const WebBuddyESLintJSONRules = {
2
+ 'jsonc/sort-keys': 'off',
3
+ 'jsonc/key-name-casing': 'off',
4
+ };
5
+ export const WebBuddyESLintJSONCRules = {
6
+ ...WebBuddyESLintJSONRules,
7
+ 'jsonc/no-comments': 'off',
8
+ 'jsonc/comma-dangle': ['error', 'never'],
9
+ };
@@ -0,0 +1,3 @@
1
+ import type { ESLintRuleSet } from '../types.js';
2
+ export declare const WebBuddyESLintVueExtraFileExtensions: readonly [".vue"];
3
+ export declare const WebBuddyESLintRulesShared: ESLintRuleSet;
@@ -0,0 +1,70 @@
1
+ export const WebBuddyESLintVueExtraFileExtensions = ['.vue'];
2
+ export const WebBuddyESLintRulesShared = {
3
+ 'semi': 'error',
4
+ 'object-shorthand': ['error', 'properties'],
5
+ 'spaced-comment': ['error', 'always', { block: { balanced: true } }],
6
+ //
7
+ 'one-var': ['error', 'never'],
8
+ 'no-multi-spaces': 'error',
9
+ 'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
10
+ 'object-curly-spacing': ['error', 'always'],
11
+ 'quotes': [
12
+ 'error',
13
+ 'single',
14
+ {
15
+ allowTemplateLiterals: true,
16
+ avoidEscape: true,
17
+ },
18
+ ],
19
+ 'no-restricted-imports': [
20
+ 'error',
21
+ {
22
+ paths: [
23
+ {
24
+ name: 'lodash',
25
+ message: 'NEVER IMPORT lodash. Use ONLY DIRECT lodash-es/<SOME-TOOL>',
26
+ },
27
+ {
28
+ name: 'lodash-es',
29
+ message: 'NEVER IMPORT lodash-es. Use ONLY lodash-es/<SOME-TOOL>',
30
+ },
31
+ ],
32
+ },
33
+ ],
34
+ 'no-new-wrappers': 'error',
35
+ 'quote-props': ['error', 'consistent-as-needed'],
36
+ 'no-return-await': 'error',
37
+ 'key-spacing': 'error',
38
+ 'block-spacing': 'error',
39
+ 'semi-spacing': 'error',
40
+ 'keyword-spacing': 'error',
41
+ 'space-before-blocks': 'error',
42
+ 'brace-style': 'error',
43
+ 'arrow-spacing': 'error',
44
+ //
45
+ 'import-x/no-named-as-default-member': 'off',
46
+ 'import-x/newline-after-import': 'error',
47
+ 'import-x/no-duplicates': 'error',
48
+ 'import-x/order': [
49
+ 'error',
50
+ {
51
+ 'newlines-between': 'never',
52
+ 'alphabetize': {
53
+ order: 'asc',
54
+ caseInsensitive: false,
55
+ },
56
+ 'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
57
+ },
58
+ ],
59
+ 'no-restricted-syntax': [
60
+ 'error',
61
+ {
62
+ selector: "BinaryExpression[operator='==='][right.type='Identifier'][right.name='undefined']",
63
+ message: 'Do not compare directly to undefined. Use == null instead.',
64
+ },
65
+ {
66
+ selector: "BinaryExpression[operator='==='][left.type='Identifier'][left.name='undefined']",
67
+ message: 'Do not compare directly to undefined. Use == null instead.',
68
+ },
69
+ ],
70
+ };
@@ -0,0 +1,2 @@
1
+ import type { ESLintConfigChainElement } from '../types.js';
2
+ export declare const WebBuddyESLintTypeScript: ESLintConfigChainElement;
@@ -0,0 +1,42 @@
1
+ import epJS from '@eslint/js';
2
+ import epDecoratorPosition from 'eslint-plugin-decorator-position/config/recommended';
3
+ import { importX as epImportX } from 'eslint-plugin-import-x';
4
+ import epTS from 'typescript-eslint';
5
+ import { WebBuddyESLintRulesShared, WebBuddyESLintVueExtraFileExtensions, } from './config.shared.rules.js';
6
+ import { WebBuddyESLintTypeScriptRules } from './config.typescript.rules.js';
7
+ export const WebBuddyESLintTypeScript = {
8
+ files: ['**/*.{ts,mts,tsx}'],
9
+ extends: [
10
+ epJS.configs.recommended,
11
+ //
12
+ epImportX.flatConfigs.recommended,
13
+ epImportX.flatConfigs.typescript,
14
+ //
15
+ ...epTS.configs.strictTypeChecked,
16
+ ...epTS.configs.stylisticTypeChecked,
17
+ //
18
+ epDecoratorPosition,
19
+ ],
20
+ languageOptions: {
21
+ ecmaVersion: 'latest',
22
+ sourceType: 'module',
23
+ parser: epTS.parser,
24
+ parserOptions: {
25
+ projectService: {
26
+ allowDefaultProject: [
27
+ 'jest-setup.js',
28
+ 'jest-setup.mjs',
29
+ 'jest-setup.ts',
30
+ '*.jest-setup.js',
31
+ '*.jest-setup.ts',
32
+ '*.jest-setup.mjs',
33
+ ],
34
+ },
35
+ extraFileExtensions: WebBuddyESLintVueExtraFileExtensions,
36
+ },
37
+ },
38
+ rules: {
39
+ ...WebBuddyESLintRulesShared,
40
+ ...WebBuddyESLintTypeScriptRules,
41
+ },
42
+ };
@@ -0,0 +1,2 @@
1
+ import type { ESLintRuleSet } from '../types.js';
2
+ export declare const WebBuddyESLintTypeScriptRules: ESLintRuleSet;
@@ -0,0 +1,149 @@
1
+ import { WebBuddyStricterMode } from '../stricter-mode.js';
2
+ /*
3
+ TODO!
4
+
5
+ https://github.com/typescript-eslint/typescript-eslint/issues/8700
6
+ https://typescript-eslint.io/rules/ban-types/
7
+ https://typescript-eslint.io/rules/no-empty-object-type/
8
+
9
+ https://typescript-eslint.io/rules/no-unnecessary-type-assertion/
10
+
11
+ https://eslint.vuejs.org/rules/script-indent
12
+
13
+ */
14
+ export const WebBuddyESLintTypeScriptRules = {
15
+ '@typescript-eslint/prefer-nullish-coalescing': 'warn',
16
+ '@typescript-eslint/no-deprecated': 'warn',
17
+ '@typescript-eslint/no-empty-object-type': 'off', // harmful
18
+ '@typescript-eslint/consistent-indexed-object-style': 'off', // harmful
19
+ '@typescript-eslint/no-inferrable-types': 'off', // harmful
20
+ '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
21
+ 'decorator-position/decorator-position': ['error', { properties: 'above', methods: 'above' }],
22
+ '@typescript-eslint/no-unnecessary-type-parameters': 'off', // odd
23
+ '@typescript-eslint/no-unnecessary-condition': 'off', // odd
24
+ '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
25
+ '@typescript-eslint/no-restricted-types': [
26
+ 'warn',
27
+ {
28
+ types: {
29
+ Record: {
30
+ message: 'Avoid using the Record type as it may pose some risks. Instead, consider using the @tsofist/stem: PRec/Rec type (Your Stem. With LOVE).',
31
+ suggest: ['PRec', 'Rec'],
32
+ },
33
+ },
34
+ },
35
+ ],
36
+ '@typescript-eslint/ban-ts-comment': [
37
+ 'error',
38
+ {
39
+ 'minimumDescriptionLength': 7,
40
+ 'ts-expect-error': 'allow-with-description',
41
+ 'ts-nocheck': 'allow-with-description',
42
+ 'ts-ignore': true,
43
+ 'ts-check': false,
44
+ },
45
+ ],
46
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
47
+ '@typescript-eslint/no-explicit-any': 'off',
48
+ '@typescript-eslint/no-non-null-assertion': 'off',
49
+ '@typescript-eslint/no-this-alias': 'error',
50
+ '@typescript-eslint/return-await': 'off',
51
+ '@typescript-eslint/no-floating-promises': 'error',
52
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off', // harmful
53
+ '@typescript-eslint/no-misused-new': 'error',
54
+ '@typescript-eslint/no-misused-promises': 'off',
55
+ '@typescript-eslint/no-array-constructor': 'error',
56
+ '@typescript-eslint/no-useless-constructor': 'error',
57
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
58
+ '@typescript-eslint/consistent-type-assertions': 'error',
59
+ '@stylistic/semi': ['error', 'always'],
60
+ '@stylistic/member-delimiter-style': [
61
+ 'error',
62
+ {
63
+ multiline: { delimiter: 'semi', requireLast: true },
64
+ singleline: { delimiter: 'semi', requireLast: false },
65
+ },
66
+ ],
67
+ '@stylistic/space-before-function-paren': [
68
+ 'warn',
69
+ {
70
+ anonymous: 'always',
71
+ named: 'never',
72
+ asyncArrow: 'always',
73
+ },
74
+ ],
75
+ '@typescript-eslint/no-meaningless-void-operator': 'error',
76
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
77
+ '@typescript-eslint/method-signature-style': ['error', 'property'],
78
+ 'lines-between-class-members': 'off',
79
+ '@stylistic/lines-between-class-members': [
80
+ 'error',
81
+ 'always',
82
+ { exceptAfterSingleLine: true, exceptAfterOverload: true },
83
+ ],
84
+ 'indent': 'off',
85
+ '@typescript-eslint/indent': 'off', // by prettier
86
+ 'no-unused-vars': 'off',
87
+ '@typescript-eslint/no-unused-vars': 'off', // by tsc
88
+ 'no-useless-assignment': 'off', // by tsc
89
+ 'no-trailing-spaces': 'off',
90
+ '@stylistic/space-in-parens': 'error',
91
+ '@stylistic/function-call-spacing': 'error',
92
+ '@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
93
+ '@typescript-eslint/no-invalid-void-type': [
94
+ 'error',
95
+ {
96
+ allowAsThisParameter: true,
97
+ allowInGenericTypeArguments: true,
98
+ },
99
+ ],
100
+ '@typescript-eslint/no-confusing-void-expression': [
101
+ 'warn',
102
+ {
103
+ ignoreArrowShorthand: true,
104
+ ignoreVoidOperator: true,
105
+ },
106
+ ],
107
+ '@typescript-eslint/restrict-plus-operands': [
108
+ 'error',
109
+ {
110
+ allowAny: false,
111
+ allowBoolean: false,
112
+ allowNullish: false,
113
+ allowNumberAndString: false,
114
+ allowRegExp: false,
115
+ },
116
+ ],
117
+ '@typescript-eslint/restrict-template-expressions': [
118
+ 'error',
119
+ {
120
+ allowAny: false,
121
+ allowNullish: false,
122
+ allowRegExp: false,
123
+ allowNumber: true,
124
+ allowBoolean: true,
125
+ allowNever: true,
126
+ },
127
+ ],
128
+ '@typescript-eslint/no-extraneous-class': [
129
+ 'error',
130
+ { allowWithDecorator: true, allowStaticOnly: true },
131
+ ],
132
+ '@typescript-eslint/no-wrapper-object-types': 'error',
133
+ '@typescript-eslint/unified-signatures': 'off', // odd
134
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off', // odd
135
+ '@typescript-eslint/no-duplicate-type-constituents': 'off', // odd
136
+ '@typescript-eslint/no-dynamic-delete': 'off', // fine in general
137
+ '@typescript-eslint/no-unsafe-assignment': 'off', // by tsc
138
+ '@typescript-eslint/no-unsafe-call': 'off', // odd
139
+ '@typescript-eslint/no-unsafe-argument': 'off', // strict
140
+ '@typescript-eslint/no-unsafe-member-access': 'off', // strict
141
+ '@typescript-eslint/no-unsafe-return': 'off', // strict
142
+ };
143
+ if (WebBuddyStricterMode) {
144
+ Object.assign(WebBuddyESLintTypeScriptRules, {
145
+ '@typescript-eslint/no-unsafe-argument': 'error',
146
+ '@typescript-eslint/no-unsafe-return': 'error',
147
+ '@typescript-eslint/no-unsafe-member-access': 'off', // odd
148
+ });
149
+ }
@@ -0,0 +1,5 @@
1
+ import type { ESLintConfigChainElement } from '../types.js';
2
+ /**
3
+ * @see https://github.com/oxc-project/oxc/issues/15761 TODO: oxc migration blocker
4
+ */
5
+ export declare const WebBuddyESLintVue: ESLintConfigChainElement;
@@ -0,0 +1,46 @@
1
+ import epJS from '@eslint/js';
2
+ import epDecoratorPosition from 'eslint-plugin-decorator-position/config/recommended';
3
+ import { importX as epImportX } from 'eslint-plugin-import-x';
4
+ import epVue from 'eslint-plugin-vue';
5
+ import globals from 'globals';
6
+ import epTS from 'typescript-eslint';
7
+ import { WebBuddyESLintRulesShared, WebBuddyESLintVueExtraFileExtensions, } from './config.shared.rules.js';
8
+ import { WebBuddyESLintTypeScriptRules } from './config.typescript.rules.js';
9
+ import { WebBuddyESLintVueRules } from './config.vue.rules.js';
10
+ /**
11
+ * @see https://github.com/oxc-project/oxc/issues/15761 TODO: oxc migration blocker
12
+ */
13
+ export const WebBuddyESLintVue = {
14
+ files: ['**/*.vue'],
15
+ extends: [
16
+ epJS.configs.recommended,
17
+ //
18
+ epImportX.flatConfigs.recommended,
19
+ epImportX.flatConfigs.typescript,
20
+ //
21
+ ...epTS.configs.strictTypeChecked,
22
+ ...epTS.configs.stylisticTypeChecked,
23
+ //
24
+ epDecoratorPosition,
25
+ //
26
+ ...epVue.configs['flat/recommended'],
27
+ ],
28
+ languageOptions: {
29
+ ecmaVersion: 'latest',
30
+ sourceType: 'module',
31
+ globals: {
32
+ // todo others?
33
+ ...globals.browser,
34
+ },
35
+ parserOptions: {
36
+ parser: epTS.parser,
37
+ projectService: true,
38
+ extraFileExtensions: WebBuddyESLintVueExtraFileExtensions,
39
+ },
40
+ },
41
+ rules: {
42
+ ...WebBuddyESLintRulesShared,
43
+ ...WebBuddyESLintTypeScriptRules,
44
+ ...WebBuddyESLintVueRules,
45
+ },
46
+ };
@@ -0,0 +1,5 @@
1
+ import type { ESLintRuleSet } from '../types.js';
2
+ /**
3
+ * @see https://github.com/oxc-project/oxc/issues/15761 TODO: oxc migration blocker
4
+ */
5
+ export declare const WebBuddyESLintVueRules: ESLintRuleSet;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @see https://github.com/oxc-project/oxc/issues/15761 TODO: oxc migration blocker
3
+ */
4
+ export const WebBuddyESLintVueRules = {
5
+ 'prettier/prettier': 'off', // !
6
+ //
7
+ 'vue/multi-word-component-names': 'off',
8
+ 'vue/html-closing-bracket-newline': ['error'],
9
+ 'indent': 'off',
10
+ '@typescript-eslint/indent': 'off',
11
+ 'vue/html-comment-indent': ['error', 0],
12
+ 'vue/html-indent': [
13
+ 'error',
14
+ 4,
15
+ {
16
+ alignAttributesVertically: true,
17
+ baseIndent: 1,
18
+ closeBracket: 0,
19
+ },
20
+ ],
21
+ 'vue/script-indent': [
22
+ 'error',
23
+ 4,
24
+ {
25
+ baseIndent: 1,
26
+ switchCase: 1,
27
+ },
28
+ ],
29
+ 'vue/max-attributes-per-line': [
30
+ 'error',
31
+ {
32
+ singleline: 3,
33
+ multiline: 1,
34
+ },
35
+ ],
36
+ 'vue/object-curly-spacing': ['error', 'always'],
37
+ 'vue/valid-v-for': 'warn',
38
+ 'vue/component-api-style': ['error', ['script-setup', 'composition']],
39
+ 'vue/no-reserved-component-names': 'off',
40
+ 'vue/attributes-order': [
41
+ 'error',
42
+ {
43
+ alphabetical: true,
44
+ order: [
45
+ 'DEFINITION',
46
+ 'LIST_RENDERING',
47
+ 'CONDITIONALS',
48
+ 'RENDER_MODIFIERS',
49
+ 'GLOBAL',
50
+ ['UNIQUE', 'SLOT'],
51
+ 'TWO_WAY_BINDING',
52
+ 'OTHER_DIRECTIVES',
53
+ 'OTHER_ATTR',
54
+ 'EVENTS',
55
+ 'CONTENT',
56
+ ],
57
+ },
58
+ ],
59
+ 'vue/attribute-hyphenation': ['error', 'always'],
60
+ '@typescript-eslint/no-unnecessary-type-arguments': 'off', // odd
61
+ };
@@ -0,0 +1,2 @@
1
+ import type { ESLintConfigChainElement } from '../types.js';
2
+ export declare const WebBuddyESLintYAML: ESLintConfigChainElement;
@@ -0,0 +1,13 @@
1
+ import { configs } from 'eslint-plugin-yml';
2
+ import * as parser from 'yaml-eslint-parser';
3
+ import { WebBuddyESLintRulesShared } from './config.shared.rules.js';
4
+ import { WebBuddyESLintYAMLRules } from './config.yaml.rules.js';
5
+ export const WebBuddyESLintYAML = {
6
+ files: ['**/*.{yaml,yml}'],
7
+ languageOptions: { parser },
8
+ extends: [configs['flat/standard'], configs['flat/prettier']],
9
+ rules: {
10
+ ...WebBuddyESLintRulesShared,
11
+ ...WebBuddyESLintYAMLRules,
12
+ },
13
+ };
@@ -0,0 +1,2 @@
1
+ import type { ESLintRuleSet } from '../types.js';
2
+ export declare const WebBuddyESLintYAMLRules: ESLintRuleSet;
@@ -0,0 +1,8 @@
1
+ export const WebBuddyESLintYAMLRules = {
2
+ 'spaced-comment': 'off',
3
+ //
4
+ 'yml/plain-scalar': ['error', 'always'],
5
+ 'yml/indent': 'off',
6
+ 'yml/quotes': ['error', { avoidEscape: true, prefer: 'single' }],
7
+ 'yml/block-sequence-hyphen-indicator-newline': ['error', 'never', { nestedHyphen: 'never' }],
8
+ };
@@ -0,0 +1 @@
1
+ export declare const WebBuddyESLintIgnores: string[];
@@ -0,0 +1,40 @@
1
+ export const WebBuddyESLintIgnores = [
2
+ //
3
+ 'package*.json',
4
+ //
5
+ '*.scss',
6
+ '*.css',
7
+ '*.pcss',
8
+ '*.postcss',
9
+ '*.html',
10
+ '*.htm',
11
+ '!.*.yml',
12
+ '!.*.yaml',
13
+ '!.*.json',
14
+ //
15
+ '**/*.tmp.*',
16
+ '**/*.private.*',
17
+ '**/*.tmp/',
18
+ '**/*.private/',
19
+ //
20
+ '.husky/_/',
21
+ //
22
+ './.cache/',
23
+ './.*-cache/',
24
+ //
25
+ './.coverage/',
26
+ //
27
+ './dist/',
28
+ './lib/',
29
+ '**/node_modules/',
30
+ '**/vendor/',
31
+ //
32
+ '.iml',
33
+ '.idea/',
34
+ '.vscode/',
35
+ '.history/',
36
+ //
37
+ './spec/*.schema*.json',
38
+ './spec/*.openapi.json',
39
+ './spec/*.dbml.json',
40
+ ];
@@ -0,0 +1,39 @@
1
+ export declare const WebBuddyPrettierConfig: {
2
+ arrowParens: string;
3
+ printWidth: number;
4
+ quoteProps: string;
5
+ singleQuote: boolean;
6
+ endOfLine: string;
7
+ tabWidth: number;
8
+ trailingComma: string;
9
+ bracketSpacing: boolean;
10
+ vueIndentScriptAndStyle: boolean;
11
+ bracketSameLine: boolean;
12
+ singleAttributePerLine: boolean;
13
+ overrides: ({
14
+ files: string;
15
+ options: {
16
+ singleQuote: boolean;
17
+ tabWidth: number;
18
+ trailingComma?: undefined;
19
+ };
20
+ parser?: undefined;
21
+ } | {
22
+ files: string;
23
+ parser: string;
24
+ options: {
25
+ tabWidth: number;
26
+ singleQuote?: undefined;
27
+ trailingComma?: undefined;
28
+ };
29
+ } | {
30
+ files: string;
31
+ parser: string;
32
+ options: {
33
+ tabWidth: number;
34
+ trailingComma: string;
35
+ singleQuote?: undefined;
36
+ };
37
+ })[];
38
+ };
39
+ export default WebBuddyPrettierConfig;
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export const WebBuddyPrettierConfig = {
2
2
  arrowParens: 'always',
3
3
  printWidth: 100,
4
4
  quoteProps: 'consistent',
@@ -10,7 +10,6 @@ module.exports = {
10
10
  vueIndentScriptAndStyle: true,
11
11
  bracketSameLine: true,
12
12
  singleAttributePerLine: false,
13
-
14
13
  overrides: [
15
14
  {
16
15
  files: '*.{html,htm}',
@@ -27,11 +26,13 @@ module.exports = {
27
26
  },
28
27
  },
29
28
  {
30
- files: '*.json',
29
+ files: '*.{json,jsonc,json5}',
31
30
  parser: 'json',
32
31
  options: {
33
32
  tabWidth: 2,
33
+ trailingComma: 'none',
34
34
  },
35
35
  },
36
36
  ],
37
37
  };
38
+ export default WebBuddyPrettierConfig;