@tsofist/web-buddy 2.0.0-next.1 → 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.
package/.editorconfig CHANGED
@@ -18,6 +18,8 @@ tab_width = 2
18
18
  # Markdown
19
19
  [*.{md,markdown}]
20
20
  trim_trailing_whitespace = false
21
+ indent_size = 2
22
+ tab_width = 2
21
23
 
22
24
  # Makefile
23
25
  [Makefile]
@@ -25,6 +27,23 @@ indent_style = tab
25
27
  indent_size = 4
26
28
  tab_width = 4
27
29
 
30
+ [*.{sh,bat}]
31
+ indent_size = 2
32
+ tab_width = 2
33
+
34
+ [*.{conf,ini}]
35
+ indent_size = 4
36
+ tab_width = 4
37
+
38
+ [*.http]
39
+ indent_size = 4
40
+ tab_width = 4
41
+
42
+ # https://docs.ollama.com/modelfile
43
+ [{Containerfile,Dockerfile,Modelfile}]
44
+ indent_size = 2
45
+ tab_width = 2
46
+
28
47
  # Classic web
29
48
  [*.{html,pcss,postcss,css,scss,sass}]
30
49
  indent_size = 4
@@ -1,4 +1,4 @@
1
- import type { WebBuddyESLintConfig } from '../types.js';
1
+ import type { ESLintConfigChain, WebBuddyESLintConfig } from '../types.js';
2
2
  declare const _default: readonly {
3
3
  readonly name?: string | undefined;
4
4
  readonly basePath?: string | undefined;
@@ -1197,4 +1197,5 @@ declare const _default: readonly {
1197
1197
  } | undefined;
1198
1198
  }[];
1199
1199
  export default _default;
1200
- export declare function createWebBuddyESLintConfig(): WebBuddyESLintConfig;
1200
+ export declare function createWebBuddyESLintConfig(onChain?: (chain: ESLintConfigChain) => ESLintConfigChain): WebBuddyESLintConfig;
1201
+ export declare function createWebBuddyESLintConfigChain(): ESLintConfigChain;
@@ -3,6 +3,7 @@ import epStylistic from '@stylistic/eslint-plugin';
3
3
  import { defineConfig } from 'eslint/config';
4
4
  import { importX as epImportX } from 'eslint-plugin-import-x';
5
5
  import epPrettier from 'eslint-plugin-prettier';
6
+ import globals from 'globals';
6
7
  import { WebBuddyESLintFrameworkSpecificConfigForMercurio } from './config.fws-mercurio.js';
7
8
  import { WebBuddyESLintJSON } from './config.json.js';
8
9
  import { WebBuddyESLintRulesShared } from './config.shared.rules.js';
@@ -11,8 +12,21 @@ import { WebBuddyESLintVue } from './config.vue.js';
11
12
  import { WebBuddyESLintYAML } from './config.yaml.js';
12
13
  import { WebBuddyESLintIgnores } from './ignores.js';
13
14
  export default createWebBuddyESLintConfig();
14
- export function createWebBuddyESLintConfig() {
15
- return defineConfig(...createWebBuddyESLintConfigGeneralChain(), ...WebBuddyESLintJSON, WebBuddyESLintTypeScript, WebBuddyESLintVue, ...WebBuddyESLintFrameworkSpecificConfigForMercurio, WebBuddyESLintYAML);
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
+ ];
16
30
  }
17
31
  function createWebBuddyESLintConfigGeneralChain() {
18
32
  return [
@@ -27,6 +41,17 @@ function createWebBuddyESLintConfigGeneralChain() {
27
41
  'import-x/resolver': { typescript: true },
28
42
  },
29
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
+ },
30
55
  epJS.configs.recommended,
31
56
  {
32
57
  rules: {
@@ -1,5 +1,6 @@
1
1
  export const WebBuddyESLintVueExtraFileExtensions = ['.vue'];
2
2
  export const WebBuddyESLintRulesShared = {
3
+ 'semi': 'error',
3
4
  'object-shorthand': ['error', 'properties'],
4
5
  'spaced-comment': ['error', 'always', { block: { balanced: true } }],
5
6
  //
@@ -55,4 +56,15 @@ export const WebBuddyESLintRulesShared = {
55
56
  'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
56
57
  },
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
+ ],
58
70
  };
@@ -22,7 +22,16 @@ export const WebBuddyESLintTypeScript = {
22
22
  sourceType: 'module',
23
23
  parser: epTS.parser,
24
24
  parserOptions: {
25
- projectService: true,
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
+ },
26
35
  extraFileExtensions: WebBuddyESLintVueExtraFileExtensions,
27
36
  },
28
37
  },
@@ -12,6 +12,9 @@ https://eslint.vuejs.org/rules/script-indent
12
12
 
13
13
  */
14
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
15
18
  '@typescript-eslint/consistent-indexed-object-style': 'off', // harmful
16
19
  '@typescript-eslint/no-inferrable-types': 'off', // harmful
17
20
  '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
@@ -46,14 +49,13 @@ export const WebBuddyESLintTypeScriptRules = {
46
49
  '@typescript-eslint/no-this-alias': 'error',
47
50
  '@typescript-eslint/return-await': 'off',
48
51
  '@typescript-eslint/no-floating-promises': 'error',
49
- '@typescript-eslint/no-unnecessary-type-assertion': 'error',
52
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off', // harmful
50
53
  '@typescript-eslint/no-misused-new': 'error',
51
54
  '@typescript-eslint/no-misused-promises': 'off',
52
55
  '@typescript-eslint/no-array-constructor': 'error',
53
56
  '@typescript-eslint/no-useless-constructor': 'error',
54
57
  '@typescript-eslint/adjacent-overload-signatures': 'error',
55
58
  '@typescript-eslint/consistent-type-assertions': 'error',
56
- 'semi': 'error',
57
59
  '@stylistic/semi': ['error', 'always'],
58
60
  '@stylistic/member-delimiter-style': [
59
61
  'error',
@@ -83,6 +85,7 @@ export const WebBuddyESLintTypeScriptRules = {
83
85
  '@typescript-eslint/indent': 'off', // by prettier
84
86
  'no-unused-vars': 'off',
85
87
  '@typescript-eslint/no-unused-vars': 'off', // by tsc
88
+ 'no-useless-assignment': 'off', // by tsc
86
89
  'no-trailing-spaces': 'off',
87
90
  '@stylistic/space-in-parens': 'error',
88
91
  '@stylistic/function-call-spacing': 'error',
@@ -28,7 +28,10 @@ export const WebBuddyESLintVue = {
28
28
  languageOptions: {
29
29
  ecmaVersion: 'latest',
30
30
  sourceType: 'module',
31
- globals: globals.browser, // todo others?
31
+ globals: {
32
+ // todo others?
33
+ ...globals.browser,
34
+ },
32
35
  parserOptions: {
33
36
  parser: epTS.parser,
34
37
  projectService: true,
@@ -1,4 +1,6 @@
1
1
  export const WebBuddyESLintYAMLRules = {
2
+ 'spaced-comment': 'off',
3
+ //
2
4
  'yml/plain-scalar': ['error', 'always'],
3
5
  'yml/indent': 'off',
4
6
  'yml/quotes': ['error', { avoidEscape: true, prefer: 'single' }],
@@ -12,14 +12,16 @@ export const WebBuddyESLintIgnores = [
12
12
  '!.*.yaml',
13
13
  '!.*.json',
14
14
  //
15
- '*.tmp.*',
16
- '*.private.*',
17
- '*.tmp/',
18
- '*.private/',
15
+ '**/*.tmp.*',
16
+ '**/*.private.*',
17
+ '**/*.tmp/',
18
+ '**/*.private/',
19
19
  //
20
20
  '.husky/_/',
21
+ //
21
22
  './.cache/',
22
23
  './.*-cache/',
24
+ //
23
25
  './.coverage/',
24
26
  //
25
27
  './dist/',
@@ -13,7 +13,6 @@
13
13
  "noUnusedParameters": true,
14
14
  "resolveJsonModule": true,
15
15
  "strict": true,
16
- "useDefineForClassFields": true,
17
- "verbatimModuleSyntax": true
16
+ "useDefineForClassFields": true
18
17
  }
19
18
  }
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "extends": "./config.base.json",
3
3
  "compilerOptions": {
4
- "isolatedModules": true
4
+ "isolatedModules": true,
5
+ "verbatimModuleSyntax": false
5
6
  },
6
7
  "vueCompilerOptions": {
7
- "strictTemplates": true,
8
- "allowImplicitTemplateReturnType": false
8
+ "allowImplicitTemplateReturnType": false,
9
+ "strictTemplates": true
9
10
  }
10
11
  }
package/lib/types.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { defineConfig } from 'eslint/config';
3
3
  export type WebBuddyESLintConfig = RO<ReturnType<ESLintDefineConfig>>;
4
4
  export type ESLintRuleSet = Record<string, Linter.RuleEntry>;
5
5
  export type ESLintConfigChainElement = Parameters<ESLintDefineConfig>[number];
6
- export type ESLintConfigChain = readonly ESLintConfigChainElement[];
6
+ export type ESLintConfigChain = ESLintConfigChainElement[];
7
7
  export type StylelintRuleSet = {
8
8
  [rule in string]: null | boolean | [boolean, object];
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsofist/web-buddy",
3
- "version": "2.0.0-next.1",
3
+ "version": "2.0.0-next.10",
4
4
  "description": "Configuration basics for Linters, TypeScript, Semantic Release and others",
5
5
  "type": "module",
6
6
  "author": "Andrew Berdnikov <tsofistgudmen@gmail.com>",
@@ -21,41 +21,40 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@eslint/js": "^10.0.1",
24
- "@semantic-release/git": "^10.0.1",
25
- "@semantic-release/github": "^12.0.6",
26
- "@semantic-release/gitlab": "^13.3.2",
24
+ "@semantic-release/git": "^11.0.1",
25
+ "@semantic-release/github": "^12.0.9",
26
+ "@semantic-release/gitlab": "^13.3.3",
27
27
  "@semantic-release/npm": "^13.1.5",
28
28
  "@stylistic/eslint-plugin": "^5.10.0",
29
29
  "@vue/eslint-config-prettier": "^10.2.0",
30
- "@vue/eslint-config-typescript": "^14.7.0",
31
- "eslint": "^10.3.0",
32
- "eslint-import-resolver-typescript": "^4.4.4",
33
- "eslint-plugin-decorator-position": "^6.1.0",
34
- "eslint-plugin-import-x": "^4.16.2",
35
- "eslint-plugin-jsonc": "^3.1.2",
36
- "eslint-plugin-prettier": "^5.5.5",
37
- "eslint-plugin-vue": "^10.9.1",
38
- "eslint-plugin-yml": "^3.3.2",
39
- "globals": "^17.6.0",
30
+ "@vue/eslint-config-typescript": "^14.9.0",
31
+ "eslint": "^10.8.1",
32
+ "eslint-import-resolver-typescript": "^4.4.5",
33
+ "eslint-plugin-decorator-position": "^6.1.1",
34
+ "eslint-plugin-import-x": "^4.17.1",
35
+ "eslint-plugin-jsonc": "^3.4.1",
36
+ "eslint-plugin-prettier": "^5.5.6",
37
+ "eslint-plugin-vue": "^10.10.0",
38
+ "eslint-plugin-yml": "^3.8.1",
39
+ "globals": "^17.11.0",
40
40
  "husky": "^9.1.7",
41
- "npm": "^11.14.0",
42
- "postcss-html": "^1.8.1",
43
- "prettier": "^3.8.3",
44
- "semantic-release": "^25.0.3",
45
- "stylelint": "^17.11.0",
41
+ "postcss-html": "^2.0.0",
42
+ "prettier": "^3.9.6",
43
+ "semantic-release": "^25.0.9",
44
+ "stylelint": "^17.14.1",
46
45
  "stylelint-config-recommended-scss": "^17.0.1",
47
46
  "stylelint-config-standard": "^40.0.0",
48
47
  "stylelint-config-standard-scss": "^17.0.0",
49
- "stylelint-config-standard-vue": "^1.0.0",
48
+ "stylelint-config-standard-vue": "^2.0.0",
50
49
  "stylelint-order": "^8.1.1",
51
50
  "stylelint-prettier": "^5.0.3",
52
- "stylelint-scss": "^7.0.0",
51
+ "stylelint-scss": "^7.2.0",
53
52
  "typescript": "~6.0.3",
54
- "typescript-eslint": "^8.59.2",
55
- "yaml-eslint-parser": "^2.0.0"
53
+ "typescript-eslint": "^8.67.0",
54
+ "yaml-eslint-parser": "^2.1.0"
56
55
  },
57
56
  "devDependencies": {
58
- "@types/node": "^22.19.17",
57
+ "@types/node": "^22.20.0",
59
58
  "tslib": "^2.8.1"
60
59
  },
61
60
  "files": [
@@ -69,7 +68,7 @@
69
68
  "access": "public"
70
69
  },
71
70
  "engines": {
72
- "node": ">=22"
71
+ "node": ">=22.12"
73
72
  },
74
73
  "release": {
75
74
  "extends": "./lib/semantic-release/config.github.js"