eslint-plugin-weld 0.0.1-test

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arswarog
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # WELD — Well-Encapsulated Layered Design
2
+
3
+ Подход к организации кода во frontend-приложениях и инструменты для его соблюдения.
4
+
5
+ ## Что это
6
+
7
+ WELD описывает, как разложить frontend-приложение по слоям и как провести границы между модулями
8
+ так, чтобы эти границы держались со временем. Ключевая идея — строгая инкапсуляция: модуль публикует
9
+ наружу узкий, осознанно спроектированный интерфейс, а всё остальное остаётся его внутренним делом.
10
+ Слои задают направление зависимостей, инкапсуляция не даёт им расползтись.
11
+
12
+ Правила такого рода почти невозможно удержать одними договорённостями в команде — поэтому
13
+ репозиторий содержит не только документацию подхода, но и ESLint-плагин, который проверяет
14
+ соблюдение правил автоматически.
15
+
16
+ ## Статус
17
+
18
+ Ранняя стадия. Документация пишется; ESLint-плагин опубликован как основа — пакет собирается,
19
+ подключается и проходит CI, но правил в нём пока нет. Правила и их именование могут меняться без
20
+ обратной совместимости.
21
+
22
+ ## ESLint-плагин
23
+
24
+ Пакет: [`eslint-plugin-weld`](https://www.npmjs.com/package/eslint-plugin-weld). Требует ESLint 9
25
+ или новее и flat config (`eslint.config.js`); поддерживается только ESM-подключение.
26
+
27
+ ```sh
28
+ yarn add -D eslint-plugin-weld
29
+ ```
30
+
31
+ ```js
32
+ // eslint.config.js
33
+ import weld from 'eslint-plugin-weld';
34
+
35
+ export default [weld.configs.recommended];
36
+ ```
37
+
38
+ Можно подключить и сам плагин, включая правила поштучно:
39
+
40
+ ```js
41
+ import weld from 'eslint-plugin-weld';
42
+
43
+ export default [
44
+ {
45
+ plugins: { weld },
46
+ rules: {
47
+ // правила появятся здесь по мере реализации
48
+ },
49
+ },
50
+ ];
51
+ ```
52
+
53
+ ## Разработка
54
+
55
+ Нужен Node 20.19+ и Yarn 4 (через corepack: `corepack enable`).
56
+
57
+ ```sh
58
+ yarn install # установка зависимостей
59
+ yarn verify # линт, форматирование, типы, тесты, сборка
60
+ yarn test:watch # тесты в watch-режиме
61
+ yarn build # сборка в dist/
62
+ yarn smoke [9|10] # сборка тарбола и проверка подключения в чистом проекте
63
+ ```
64
+
65
+ `yarn smoke` собирает пакет ровно так, как это сделает `npm publish`, ставит его во временный проект
66
+ и запускает там ESLint — это защита от «локально работает, из npm не подключается».
67
+
68
+ ## Лицензия
69
+
70
+ [MIT](LICENSE)
@@ -0,0 +1,61 @@
1
+ import { Linter } from 'eslint';
2
+
3
+ /**
4
+ * @fileoverview Shared types for ESLint Core.
5
+ */
6
+
7
+ /**
8
+ * The human readable severity level used in a configuration.
9
+ */
10
+ type SeverityName = "off" | "warn" | "error";
11
+ /**
12
+ * The numeric severity level for a rule.
13
+ *
14
+ * - `0` means off.
15
+ * - `1` means warn.
16
+ * - `2` means error.
17
+ */
18
+ type SeverityLevel = 0 | 1 | 2;
19
+ /**
20
+ * The severity of a rule in a configuration.
21
+ */
22
+ type Severity = SeverityName | SeverityLevel;
23
+ /**
24
+ * The configuration for a rule.
25
+ */
26
+ type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
27
+ /**
28
+ * A collection of rules and their configurations.
29
+ */
30
+ interface RulesConfig {
31
+ [key: string]: RuleConfig;
32
+ }
33
+
34
+ /**
35
+ * Реестр правил плагина.
36
+ *
37
+ * Пока пуст: плагин опубликован как основа, правила проверки импортов
38
+ * добавляются следующими релизами. Каждое новое правило регистрируется здесь
39
+ * и должно иметь парный раздел в документации подхода.
40
+ */
41
+ declare const rules: {};
42
+
43
+ declare const meta: {
44
+ name: string;
45
+ version: string;
46
+ };
47
+ /**
48
+ * Плагин WELD. Правил пока нет — это основа, на которую они будут добавляться.
49
+ */
50
+ declare const plugin: {
51
+ meta: {
52
+ name: string;
53
+ version: string;
54
+ };
55
+ rules: {};
56
+ configs: Record<string, Linter.Config>;
57
+ };
58
+
59
+ declare const configs: Record<string, Linter.Config<RulesConfig>>;
60
+
61
+ export { configs, plugin as default, meta, rules };
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ // src/rules/index.ts
2
+ var rules = {};
3
+
4
+ // src/version.ts
5
+ var version = "0.0.1-test" ;
6
+
7
+ // src/index.ts
8
+ var meta = {
9
+ name: "eslint-plugin-weld",
10
+ version
11
+ };
12
+ var plugin = {
13
+ meta,
14
+ rules,
15
+ configs: {}
16
+ };
17
+ var recommended = {
18
+ name: "weld/recommended",
19
+ plugins: { weld: plugin },
20
+ rules: {}
21
+ };
22
+ plugin.configs.recommended = recommended;
23
+ var configs = plugin.configs;
24
+ var index_default = plugin;
25
+
26
+ export { configs, index_default as default, meta, rules };
27
+ //# sourceMappingURL=index.js.map
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rules/index.ts","../src/version.ts","../src/index.ts"],"names":[],"mappings":";AASO,IAAM,QAAQ;;;ACLd,IAAM,OAAA,GACgC,YAAA,CAAqB;;;ACAlE,IAAM,IAAA,GAAO;AAAA,EACT,IAAA,EAAM,oBAAA;AAAA,EACN;AACJ;AAKA,IAAM,MAAA,GAAS;AAAA,EACX,IAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAS;AACb,CAAA;AAaA,IAAM,WAAA,GAA6B;AAAA,EAC/B,IAAA,EAAM,kBAAA;AAAA,EACN,OAAA,EAAS,EAAE,IAAA,EAAM,MAAA,EAAwB;AAAA,EACzC,OAAO;AACX,CAAA;AAEA,MAAA,CAAO,QAAQ,WAAA,GAAc,WAAA;AAGtB,IAAM,UAAU,MAAA,CAAO;AAE9B,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["import type { Rule } from 'eslint';\n\n/**\n * Реестр правил плагина.\n *\n * Пока пуст: плагин опубликован как основа, правила проверки импортов\n * добавляются следующими релизами. Каждое новое правило регистрируется здесь\n * и должно иметь парный раздел в документации подхода.\n */\nexport const rules = {} satisfies Record<string, Rule.RuleModule>;\n\nexport type RuleName = keyof typeof rules;\n","// Значение подставляется на сборке (см. tsup.config.ts). При запуске исходников\n// напрямую (тесты, ts-node) подмены не происходит — тогда используем заглушку.\ndeclare const __PLUGIN_VERSION__: string;\n\nexport const version: string =\n typeof __PLUGIN_VERSION__ === 'string' ? __PLUGIN_VERSION__ : '0.0.0-dev';\n","import type { ESLint, Linter } from 'eslint';\n\nimport { rules } from './rules/index.js';\nimport { version } from './version.js';\n\nconst meta = {\n name: 'eslint-plugin-weld',\n version,\n} satisfies ESLint.Plugin['meta'];\n\n/**\n * Плагин WELD. Правил пока нет — это основа, на которую они будут добавляться.\n */\nconst plugin = {\n meta,\n rules,\n configs: {} as Record<string, Linter.Config>,\n} satisfies ESLint.Plugin;\n\n/**\n * Рекомендуемый набор правил (flat config).\n *\n * Подключается как элемент массива в `eslint.config.js`:\n *\n * ```js\n * import weld from 'eslint-plugin-weld';\n *\n * export default [weld.configs.recommended];\n * ```\n */\nconst recommended: Linter.Config = {\n name: 'weld/recommended',\n plugins: { weld: plugin as ESLint.Plugin },\n rules: {},\n};\n\nplugin.configs.recommended = recommended;\n\nexport { meta, rules };\nexport const configs = plugin.configs;\n\nexport default plugin;\n"]}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "eslint-plugin-weld",
3
+ "version": "0.0.1-test",
4
+ "description": "ESLint-плагин для проверки правил WELD (Well-Encapsulated Layered Design)",
5
+ "keywords": [
6
+ "eslint",
7
+ "eslintplugin",
8
+ "eslint-plugin",
9
+ "weld",
10
+ "architecture",
11
+ "layers",
12
+ "encapsulation",
13
+ "imports"
14
+ ],
15
+ "homepage": "https://github.com/jt4d-lab/weld#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/jt4d-lab/weld/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/jt4d-lab/weld.git"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Arswarog",
25
+ "type": "module",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/index.js"
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "main": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
35
+ "files": [
36
+ "dist",
37
+ "README.md",
38
+ "LICENSE"
39
+ ],
40
+ "scripts": {
41
+ "build": "tsup",
42
+ "format": "prettier --write .",
43
+ "format:check": "prettier --check .",
44
+ "lint": "eslint .",
45
+ "prepack": "yarn build",
46
+ "smoke": "./scripts/smoke-test.sh",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest",
49
+ "typecheck": "tsc --noEmit",
50
+ "verify": "yarn lint && yarn format:check && yarn typecheck && yarn test && yarn build"
51
+ },
52
+ "devDependencies": {
53
+ "@eslint/js": "^10.0.0",
54
+ "@types/node": "^26.0.0",
55
+ "eslint": "^10.0.0",
56
+ "prettier": "^3.9.0",
57
+ "tsup": "^8.5.0",
58
+ "typescript": "^5.9.0",
59
+ "typescript-eslint": "^8.69.0",
60
+ "vitest": "^4.1.0"
61
+ },
62
+ "peerDependencies": {
63
+ "eslint": ">=9.0.0"
64
+ },
65
+ "packageManager": "yarn@4.10.3",
66
+ "engines": {
67
+ "node": ">=20.19.0"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public",
71
+ "provenance": true
72
+ }
73
+ }