@conarti/eslint-plugin-feature-sliced 1.0.5 → 2.0.0-rc.1

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 (78) hide show
  1. package/README.md +8 -5
  2. package/dist/index.cjs +1082 -0
  3. package/dist/index.d.cts +63 -0
  4. package/dist/index.d.ts +63 -0
  5. package/dist/index.js +1057 -22
  6. package/package.json +39 -40
  7. package/dist/config.js +0 -27
  8. package/dist/configs/import-order/index.js +0 -20
  9. package/dist/configs/import-order/recommended.js +0 -28
  10. package/dist/configs/import-order/with-newlines-and-type-group.js +0 -28
  11. package/dist/configs/import-order/with-newlines.js +0 -28
  12. package/dist/configs/import-order/with-type-group.js +0 -28
  13. package/dist/configs/recommended.js +0 -11
  14. package/dist/configs/rules.js +0 -11
  15. package/dist/lib/feature-sliced/extract-feature-sliced-parts.js +0 -18
  16. package/dist/lib/feature-sliced/extract-layer.js +0 -21
  17. package/dist/lib/feature-sliced/extract-paths-info.js +0 -59
  18. package/dist/lib/feature-sliced/extract-segment.js +0 -18
  19. package/dist/lib/feature-sliced/extract-slice.js +0 -10
  20. package/dist/lib/feature-sliced/index.js +0 -10
  21. package/dist/lib/feature-sliced/layers.js +0 -16
  22. package/dist/lib/feature-sliced/validate-extracted-feature-sliced-parts.js +0 -29
  23. package/dist/lib/path/convert-to-absolute.js +0 -18
  24. package/dist/lib/path/index.js +0 -9
  25. package/dist/lib/path/is-path-relative.js +0 -7
  26. package/dist/lib/path/join-path.js +0 -12
  27. package/dist/lib/path/normalize-path.js +0 -19
  28. package/dist/lib/rule/create-rule.js +0 -7
  29. package/dist/lib/rule/extract-current-file-path.js +0 -11
  30. package/dist/lib/rule/extract-cwd.js +0 -13
  31. package/dist/lib/rule/extract-node-path.js +0 -13
  32. package/dist/lib/rule/extract-paths.js +0 -21
  33. package/dist/lib/rule/extract-rule-options.js +0 -7
  34. package/dist/lib/rule/get-source-range-without-quotes.js +0 -7
  35. package/dist/lib/rule/has-path.js +0 -11
  36. package/dist/lib/rule/index.js +0 -27
  37. package/dist/lib/rule/is-ignored-current-file.js +0 -12
  38. package/dist/lib/rule/is-ignored-target.js +0 -12
  39. package/dist/lib/rule/is-ignored.js +0 -12
  40. package/dist/lib/rule/is-node-type.js +0 -16
  41. package/dist/lib/rule/models.js +0 -2
  42. package/dist/lib/shared/get-by-reg-exp.js +0 -12
  43. package/dist/lib/shared/index.js +0 -11
  44. package/dist/lib/shared/is-null.js +0 -7
  45. package/dist/lib/shared/is-object.js +0 -7
  46. package/dist/lib/shared/is-undefined.js +0 -7
  47. package/dist/rules/absolute-relative/config.js +0 -2
  48. package/dist/rules/absolute-relative/index.js +0 -51
  49. package/dist/rules/absolute-relative/model/errors.js +0 -17
  50. package/dist/rules/absolute-relative/model/index.js +0 -5
  51. package/dist/rules/absolute-relative/model/should-be-absolute.js +0 -16
  52. package/dist/rules/absolute-relative/model/should-be-relative.js +0 -21
  53. package/dist/rules/absolute-relative/model/validate-and-report.js +0 -24
  54. package/dist/rules/layers-slices/config.js +0 -2
  55. package/dist/rules/layers-slices/index.js +0 -55
  56. package/dist/rules/layers-slices/model/errors.js +0 -22
  57. package/dist/rules/layers-slices/model/index.js +0 -5
  58. package/dist/rules/layers-slices/model/is-not-suitable-for-validation.js +0 -17
  59. package/dist/rules/layers-slices/model/specifiers/extract-import-specifiers.js +0 -8
  60. package/dist/rules/layers-slices/model/specifiers/has-errors-at-all-specifiers.js +0 -9
  61. package/dist/rules/layers-slices/model/specifiers/index.js +0 -7
  62. package/dist/rules/layers-slices/model/specifiers/validate-specifiers.js +0 -8
  63. package/dist/rules/layers-slices/model/validate-and-report.js +0 -46
  64. package/dist/rules/layers-slices/model/validate-node/index.js +0 -16
  65. package/dist/rules/layers-slices/model/validate-node/valid-by-layer-order.js +0 -10
  66. package/dist/rules/layers-slices/model/validate-node/valid-by-type-import.js +0 -9
  67. package/dist/rules/public-api/config.js +0 -2
  68. package/dist/rules/public-api/index.js +0 -65
  69. package/dist/rules/public-api/model/convert-to-public-api.js +0 -24
  70. package/dist/rules/public-api/model/errors.js +0 -34
  71. package/dist/rules/public-api/model/index.js +0 -5
  72. package/dist/rules/public-api/model/is-index-file.js +0 -7
  73. package/dist/rules/public-api/model/is-layer-public-api.js +0 -23
  74. package/dist/rules/public-api/model/is-segments-public-api.js +0 -11
  75. package/dist/rules/public-api/model/is-slice-public-api.js +0 -7
  76. package/dist/rules/public-api/model/should-be-from-public-api.js +0 -21
  77. package/dist/rules/public-api/model/validate-and-report-program.js +0 -15
  78. package/dist/rules/public-api/model/validate-and-report.js +0 -18
@@ -0,0 +1,63 @@
1
+ import { Linter } from 'eslint';
2
+
3
+ type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord>, 'plugins'> & {
4
+ /**
5
+ * An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
6
+ *
7
+ * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
8
+ */
9
+ plugins?: Record<string, any>;
10
+ };
11
+ type ImportOrderConfigName = 'recommended' | 'with-newlines' | 'with-newlines-and-type-group' | 'with-type-group';
12
+
13
+ declare const enum VALIDATION_LEVEL {
14
+ SEGMENTS = "segments",
15
+ SLICES = "slices"
16
+ }
17
+
18
+ interface AbsoluteRelativeOptions {
19
+ /**
20
+ * Disable the rule in certain files
21
+ */
22
+ ignoreInFilesPatterns: string[];
23
+ }
24
+ interface LayersSlicesOptions {
25
+ /**
26
+ * Ignore cross-imports of types
27
+ * @default true
28
+ */
29
+ allowTypeImports: boolean;
30
+ /**
31
+ * Ignore certain import paths (import foo from '<path-to-ignore>')
32
+ */
33
+ ignorePatterns: string[];
34
+ /**
35
+ * Disable the rule in certain files
36
+ */
37
+ ignoreInFilesPatterns: string[];
38
+ }
39
+ interface PublicApiOptions {
40
+ /**
41
+ * Adjusts the depth.
42
+ * 'slices' will check for presence 'index' file at the slice level only,
43
+ * 'segments' at the slice and its segments level
44
+ * Default is 'slices', but 'segments' is recommended
45
+ * @default 'slices'
46
+ */
47
+ level: VALIDATION_LEVEL;
48
+ /**
49
+ * Disable the rule in certain files
50
+ */
51
+ ignoreInFilesPatterns: string[];
52
+ }
53
+ interface ESLintPluginFeatureSlicedRuleOptions {
54
+ absoluteRelative?: false | AbsoluteRelativeOptions;
55
+ layersSlices?: false | LayersSlicesOptions;
56
+ publicApi?: false | PublicApiOptions;
57
+ }
58
+ interface ESLintPluginFeatureSlicedOptions extends ESLintPluginFeatureSlicedRuleOptions {
59
+ sortImports?: false | ImportOrderConfigName;
60
+ }
61
+ declare function createPlugin(options?: ESLintPluginFeatureSlicedOptions): TypedFlatConfigItem;
62
+
63
+ export { createPlugin as default };
@@ -0,0 +1,63 @@
1
+ import { Linter } from 'eslint';
2
+
3
+ type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord>, 'plugins'> & {
4
+ /**
5
+ * An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
6
+ *
7
+ * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
8
+ */
9
+ plugins?: Record<string, any>;
10
+ };
11
+ type ImportOrderConfigName = 'recommended' | 'with-newlines' | 'with-newlines-and-type-group' | 'with-type-group';
12
+
13
+ declare const enum VALIDATION_LEVEL {
14
+ SEGMENTS = "segments",
15
+ SLICES = "slices"
16
+ }
17
+
18
+ interface AbsoluteRelativeOptions {
19
+ /**
20
+ * Disable the rule in certain files
21
+ */
22
+ ignoreInFilesPatterns: string[];
23
+ }
24
+ interface LayersSlicesOptions {
25
+ /**
26
+ * Ignore cross-imports of types
27
+ * @default true
28
+ */
29
+ allowTypeImports: boolean;
30
+ /**
31
+ * Ignore certain import paths (import foo from '<path-to-ignore>')
32
+ */
33
+ ignorePatterns: string[];
34
+ /**
35
+ * Disable the rule in certain files
36
+ */
37
+ ignoreInFilesPatterns: string[];
38
+ }
39
+ interface PublicApiOptions {
40
+ /**
41
+ * Adjusts the depth.
42
+ * 'slices' will check for presence 'index' file at the slice level only,
43
+ * 'segments' at the slice and its segments level
44
+ * Default is 'slices', but 'segments' is recommended
45
+ * @default 'slices'
46
+ */
47
+ level: VALIDATION_LEVEL;
48
+ /**
49
+ * Disable the rule in certain files
50
+ */
51
+ ignoreInFilesPatterns: string[];
52
+ }
53
+ interface ESLintPluginFeatureSlicedRuleOptions {
54
+ absoluteRelative?: false | AbsoluteRelativeOptions;
55
+ layersSlices?: false | LayersSlicesOptions;
56
+ publicApi?: false | PublicApiOptions;
57
+ }
58
+ interface ESLintPluginFeatureSlicedOptions extends ESLintPluginFeatureSlicedRuleOptions {
59
+ sortImports?: false | ImportOrderConfigName;
60
+ }
61
+ declare function createPlugin(options?: ESLintPluginFeatureSlicedOptions): TypedFlatConfigItem;
62
+
63
+ export { createPlugin as default };