@application-kit/lint-config 0.6.0 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @application-kit/lint-config
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e9411eb: Спеки-гейты продукта переехали в пакеты: спека теперь — вызов помощника с параметрами продукта, а нарушение приходит ошибкой со списком.
8
+
9
+ `ui/testing`: `assertTokensDeclared`. `kafka/testing` (новый вход): `assertConsumerTopicsConsistent`. `authorization/testing` (новый вход): `assertAbilityRegistryConsistent`. `nestjs-vite/static-assets-gate` (новый вход, отдельно от `/testing`, чтобы спеки с фейком рендерера не грузили `vite`): `assertStaticAssetsLayout`. `lint-config` разрешает импорт нового входа `nestjs-vite/static-assets-gate`.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [e9411eb]
14
+ - @application-kit/ui@0.9.0
15
+
16
+ ## 0.6.1
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [06ce168]
21
+ - @application-kit/ui@0.8.0
22
+
3
23
  ## 0.6.0
4
24
 
5
25
  ### Minor Changes
package/README.md CHANGED
@@ -18,6 +18,7 @@ Peer-зависимости: `eslint`, `@libs-for-dev/eslint-rules`. Пакет
18
18
  | Вход | Для чего | Тянет |
19
19
  |------|----------|-------|
20
20
  | `@application-kit/lint-config` | `defineApplicationEslintConfig`, `defineRestrictedImportBlocks`, `ApplicationEslintConfigOptionsInterface` | `@libs-for-dev/eslint-rules`, `@application-kit/ui/lint` |
21
+ | `@application-kit/lint-config/translated-files` | `defineTranslatedFilesConfig`, `TranslatedFilesConfigInterface` | `@intlify/eslint-plugin-vue-i18n` (optional peer) |
21
22
 
22
23
  ## ESLint
23
24
 
@@ -26,7 +27,19 @@ import { defineApplicationEslintConfig } from '@application-kit/lint-config'
26
27
 
27
28
  export default [
28
29
  ...defineApplicationEslintConfig({ roleDictionary: '@/libs/shared/role', shellModule: 'client' }),
29
- { ignores: ['docs/', 'ops/static/'] },
30
+ { ignores: ['generated/'] },
31
+ ]
32
+ ```
33
+
34
+ Запрет литералов в переведённых экранах — отдельный вход: плагин `@intlify/eslint-plugin-vue-i18n` (с его peer
35
+ `yaml-eslint-parser`) — optional peer, и продукту без i18n он не нужен.
36
+
37
+ ```ts
38
+ import { defineTranslatedFilesConfig } from '@application-kit/lint-config/translated-files'
39
+
40
+ export default [
41
+ ...defineApplicationEslintConfig({ roleDictionary: '@/libs/shared/role', shellModule: 'client' }),
42
+ defineTranslatedFilesConfig(TRANSLATED_FILES),
30
43
  ]
31
44
  ```
32
45
 
@@ -12,6 +12,8 @@ const APPLICATION_KIT_ENTRIES = [
12
12
  '@application-kit/i18n/server',
13
13
  '@application-kit/i18n/vue',
14
14
  '@application-kit/kafka/event-contract',
15
+ '@application-kit/lint-config/translated-files',
16
+ '@application-kit/nestjs-vite/static-assets-gate',
15
17
  '@application-kit/observability/*',
16
18
  '@application-kit/observability/health/*',
17
19
  '@application-kit/observability/logging/*',
@@ -37,6 +39,19 @@ const STACK_CONFIG = [
37
39
  configs.typescript,
38
40
  configs.vitest,
39
41
  configs.vue,
42
+ {
43
+ ignores: [
44
+ '.claude/',
45
+ '.{stryker-cache,vitest-module-cache,vitest-reports}/',
46
+ 'coverage/',
47
+ 'docs/',
48
+ 'ops/docker/',
49
+ 'ops/static/',
50
+ 'reports/',
51
+ 'tasks/',
52
+ 'var/',
53
+ ],
54
+ },
40
55
  { linterOptions: { reportUnusedDisableDirectives: 'error' } },
41
56
  {
42
57
  plugins: { ...configs.packageJson.plugins },
@@ -48,7 +63,10 @@ const STACK_CONFIG = [
48
63
  { rules: { '@typescript-eslint/consistent-type-definitions': 'off' } },
49
64
  {
50
65
  files: ['**/*.cjs', '**/*.cts', '**/*.js', '**/*.mjs', '**/*.mts', '**/*.ts', '**/*.vue'],
51
- rules: { 'unicorn/comment-content': ['error', { replacements: { '\\burl\\b': false } }] },
66
+ rules: {
67
+ 'unicorn/comment-content': ['error', { replacements: { '\\burl\\b': false } }],
68
+ 'unicorn/prefer-temporal': 'off',
69
+ },
52
70
  },
53
71
  {
54
72
  files: ['**/*.cts', '**/*.mts', '**/*.ts'],
@@ -0,0 +1,10 @@
1
+ import type { Linter } from 'eslint';
2
+ import vueI18n from '@intlify/eslint-plugin-vue-i18n';
3
+ declare const PLUGIN_NAME = "@intlify/vue-i18n";
4
+ export interface TranslatedFilesConfigInterface {
5
+ files: string[];
6
+ plugins: Record<typeof PLUGIN_NAME, typeof vueI18n>;
7
+ rules: Linter.RulesRecord;
8
+ }
9
+ export declare const defineTranslatedFilesConfig: (files: readonly string[]) => TranslatedFilesConfigInterface;
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import vueI18n from '@intlify/eslint-plugin-vue-i18n';
2
+ const PLUGIN_NAME = '@intlify/vue-i18n';
3
+ const TRANSLATABLE_ATTRIBUTES = [
4
+ 'alt',
5
+ 'aria-label',
6
+ 'aria-placeholder',
7
+ 'aria-roledescription',
8
+ 'aria-valuetext',
9
+ 'placeholder',
10
+ 'title',
11
+ ];
12
+ export const defineTranslatedFilesConfig = (files) => ({
13
+ files: [...files],
14
+ plugins: { [PLUGIN_NAME]: vueI18n },
15
+ rules: {
16
+ [`${PLUGIN_NAME}/no-raw-text`]: ['error', { attributes: { '/.+/': TRANSLATABLE_ATTRIBUTES } }],
17
+ },
18
+ });
@@ -0,0 +1 @@
1
+ export * from './define-translated-files-config.js';
@@ -0,0 +1 @@
1
+ export * from './define-translated-files-config.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@application-kit/lint-config",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Пресет ESLint приложения на пакетах @application-kit: flat-config с границами слоёв, разрешёнными подпутями пакетов и запретами UI-вендора",
5
5
  "keywords": [
6
6
  "eslint-config",
@@ -27,7 +27,13 @@
27
27
  "default": "./dist/index.js"
28
28
  }
29
29
  },
30
- "./package.json": "./package.json"
30
+ "./package.json": "./package.json",
31
+ "./translated-files": {
32
+ "import": {
33
+ "types": "./dist/translated-files/index.d.ts",
34
+ "default": "./dist/translated-files/index.js"
35
+ }
36
+ }
31
37
  },
32
38
  "main": "./dist/index.js",
33
39
  "module": "./dist/index.js",
@@ -36,15 +42,16 @@
36
42
  "dist"
37
43
  ],
38
44
  "scripts": {
39
- "build": "rm -rf ./dist && node ../../scripts/barrels.mjs create ./src && tsc --project tsconfig.build.json && node ../../scripts/barrels.mjs clean ./src",
45
+ "build": "rm -rf ./dist && node ../../scripts/barrels.mjs create ./src --entry-only=translated-files && tsc --project tsconfig.build.json && node ../../scripts/barrels.mjs clean ./src",
40
46
  "lint:tsc": "tsc --noEmit --pretty --project .",
41
47
  "test:mutation": "stryker run",
42
48
  "test:unit": "vitest run"
43
49
  },
44
50
  "dependencies": {
45
- "@application-kit/ui": "^0.7.0"
51
+ "@application-kit/ui": "^0.9.0"
46
52
  },
47
53
  "devDependencies": {
54
+ "@intlify/eslint-plugin-vue-i18n": "^4.5.1",
48
55
  "@libs-for-dev/eslint-rules": "3.4.0",
49
56
  "@stryker-mutator/core": "^10.0.0",
50
57
  "@stryker-mutator/vitest-runner": "^10.0.0",
@@ -52,12 +59,19 @@
52
59
  "eslint": "^10.8.1",
53
60
  "minimatch": "^10.2.5",
54
61
  "typescript": "^6.0.3",
55
- "vitest": "^4.1.11"
62
+ "vitest": "^4.1.11",
63
+ "yaml-eslint-parser": "^2.0.0"
56
64
  },
57
65
  "peerDependencies": {
66
+ "@intlify/eslint-plugin-vue-i18n": "^4.0.0",
58
67
  "@libs-for-dev/eslint-rules": "^3.3.0",
59
68
  "eslint": "^10.0.0"
60
69
  },
70
+ "peerDependenciesMeta": {
71
+ "@intlify/eslint-plugin-vue-i18n": {
72
+ "optional": true
73
+ }
74
+ },
61
75
  "engines": {
62
76
  "node": ">=24"
63
77
  },