@craft-ng/dev-tools 0.1.1 → 0.1.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.
package/README.md CHANGED
@@ -26,3 +26,51 @@ export default [
26
26
  }
27
27
  ];
28
28
  ```
29
+
30
+ ```bash
31
+ const craftRules = require('@craft-ng/dev-tools/eslint-rules');
32
+
33
+ module.exports = defineConfig([
34
+ {
35
+ files: ['**/*.ts'],
36
+ extends: [
37
+ eslint.configs.recommended,
38
+ tseslint.configs.recommended,
39
+ tseslint.configs.stylistic,
40
+ angular.configs.tsRecommended,
41
+ ],
42
+ processor: angular.processInlineTemplates,
43
+ plugins: {
44
+ 'craft-ng': craftRules,
45
+ },
46
+ rules: {
47
+ '@angular-eslint/directive-selector': [
48
+ 'error',
49
+ {
50
+ type: 'attribute',
51
+ prefix: 'app',
52
+ style: 'camelCase',
53
+ },
54
+ ],
55
+ '@angular-eslint/component-selector': [
56
+ 'error',
57
+ {
58
+ type: 'element',
59
+ prefix: 'app',
60
+ style: 'kebab-case',
61
+ },
62
+ ],
63
+ '@typescript-eslint/consistent-type-definitions': 'off',
64
+ // Ajoutez vos règles craft-ng ici
65
+ 'craft-ng/brand-angular-deps-match': 'error',
66
+ 'craft-ng/no-angular-inject': 'error',
67
+ 'craft-ng/no-direct-angular-class-export': 'error',
68
+ },
69
+ },
70
+ {
71
+ files: ['**/*.html'],
72
+ extends: [angular.configs.templateRecommended, angular.configs.templateAccessibility],
73
+ rules: {},
74
+ },
75
+ ]);
76
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craft-ng/dev-tools",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Development tools for ng-craft: ESLint configs, ESLint rules, and codemods",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -10,7 +10,10 @@
10
10
  "types": "./src/index.d.ts",
11
11
  "default": "./src/index.js"
12
12
  },
13
- "./eslint-rules": "./src/eslint-rules/index.cjs",
13
+ "./eslint-rules": {
14
+ "types": "./src/eslint-rules/index.d.cts",
15
+ "default": "./src/eslint-rules/index.cjs"
16
+ },
14
17
  "./package.json": "./package.json"
15
18
  },
16
19
  "bin": {
@@ -22,7 +25,9 @@
22
25
  ],
23
26
  "dependencies": {
24
27
  "tslib": "^2.3.0",
25
- "ts-morph": "^24.0.0"
28
+ "ts-morph": "^24.0.0",
29
+ "ts-node": "^10.9.2",
30
+ "typescript": "^5.7.2"
26
31
  },
27
32
  "peerDependencies": {
28
33
  "@angular-eslint/eslint-plugin": ">=21.0.0",
@@ -8,7 +8,7 @@ const { Project } = require('ts-morph');
8
8
  const {
9
9
  analyzeSourceFileDependencies,
10
10
  readExistingDependencyGroups,
11
- } = require('../angular-brand-codemod.ts');
11
+ } = require('../scripts/angular-brand-codemod.ts');
12
12
 
13
13
  const projectCache = new Map();
14
14
 
@@ -0,0 +1,5 @@
1
+ import type { ESLint, Linter } from 'eslint';
2
+
3
+ declare const plugin: ESLint.Plugin;
4
+
5
+ export = plugin;
@@ -5,7 +5,7 @@ process.env.TS_NODE_PROJECT ??= path.resolve(__dirname, '../tsconfig.codemod.jso
5
5
  require('ts-node/register/transpile-only');
6
6
 
7
7
  const { Project, Node, SyntaxKind } = require('ts-morph');
8
- const { getAngularKind } = require('../angular-brand-codemod.ts');
8
+ const { getAngularKind } = require('../scripts/angular-brand-codemod.ts');
9
9
 
10
10
  const projectCache = new Map();
11
11