@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.
- package/README.md +8 -5
- package/dist/index.cjs +1082 -0
- package/dist/index.d.cts +63 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +1057 -22
- package/package.json +39 -40
- package/dist/config.js +0 -27
- package/dist/configs/import-order/index.js +0 -20
- package/dist/configs/import-order/recommended.js +0 -28
- package/dist/configs/import-order/with-newlines-and-type-group.js +0 -28
- package/dist/configs/import-order/with-newlines.js +0 -28
- package/dist/configs/import-order/with-type-group.js +0 -28
- package/dist/configs/recommended.js +0 -11
- package/dist/configs/rules.js +0 -11
- package/dist/lib/feature-sliced/extract-feature-sliced-parts.js +0 -18
- package/dist/lib/feature-sliced/extract-layer.js +0 -21
- package/dist/lib/feature-sliced/extract-paths-info.js +0 -59
- package/dist/lib/feature-sliced/extract-segment.js +0 -18
- package/dist/lib/feature-sliced/extract-slice.js +0 -10
- package/dist/lib/feature-sliced/index.js +0 -10
- package/dist/lib/feature-sliced/layers.js +0 -16
- package/dist/lib/feature-sliced/validate-extracted-feature-sliced-parts.js +0 -29
- package/dist/lib/path/convert-to-absolute.js +0 -18
- package/dist/lib/path/index.js +0 -9
- package/dist/lib/path/is-path-relative.js +0 -7
- package/dist/lib/path/join-path.js +0 -12
- package/dist/lib/path/normalize-path.js +0 -19
- package/dist/lib/rule/create-rule.js +0 -7
- package/dist/lib/rule/extract-current-file-path.js +0 -11
- package/dist/lib/rule/extract-cwd.js +0 -13
- package/dist/lib/rule/extract-node-path.js +0 -13
- package/dist/lib/rule/extract-paths.js +0 -21
- package/dist/lib/rule/extract-rule-options.js +0 -7
- package/dist/lib/rule/get-source-range-without-quotes.js +0 -7
- package/dist/lib/rule/has-path.js +0 -11
- package/dist/lib/rule/index.js +0 -27
- package/dist/lib/rule/is-ignored-current-file.js +0 -12
- package/dist/lib/rule/is-ignored-target.js +0 -12
- package/dist/lib/rule/is-ignored.js +0 -12
- package/dist/lib/rule/is-node-type.js +0 -16
- package/dist/lib/rule/models.js +0 -2
- package/dist/lib/shared/get-by-reg-exp.js +0 -12
- package/dist/lib/shared/index.js +0 -11
- package/dist/lib/shared/is-null.js +0 -7
- package/dist/lib/shared/is-object.js +0 -7
- package/dist/lib/shared/is-undefined.js +0 -7
- package/dist/rules/absolute-relative/config.js +0 -2
- package/dist/rules/absolute-relative/index.js +0 -51
- package/dist/rules/absolute-relative/model/errors.js +0 -17
- package/dist/rules/absolute-relative/model/index.js +0 -5
- package/dist/rules/absolute-relative/model/should-be-absolute.js +0 -16
- package/dist/rules/absolute-relative/model/should-be-relative.js +0 -21
- package/dist/rules/absolute-relative/model/validate-and-report.js +0 -24
- package/dist/rules/layers-slices/config.js +0 -2
- package/dist/rules/layers-slices/index.js +0 -55
- package/dist/rules/layers-slices/model/errors.js +0 -22
- package/dist/rules/layers-slices/model/index.js +0 -5
- package/dist/rules/layers-slices/model/is-not-suitable-for-validation.js +0 -17
- package/dist/rules/layers-slices/model/specifiers/extract-import-specifiers.js +0 -8
- package/dist/rules/layers-slices/model/specifiers/has-errors-at-all-specifiers.js +0 -9
- package/dist/rules/layers-slices/model/specifiers/index.js +0 -7
- package/dist/rules/layers-slices/model/specifiers/validate-specifiers.js +0 -8
- package/dist/rules/layers-slices/model/validate-and-report.js +0 -46
- package/dist/rules/layers-slices/model/validate-node/index.js +0 -16
- package/dist/rules/layers-slices/model/validate-node/valid-by-layer-order.js +0 -10
- package/dist/rules/layers-slices/model/validate-node/valid-by-type-import.js +0 -9
- package/dist/rules/public-api/config.js +0 -2
- package/dist/rules/public-api/index.js +0 -65
- package/dist/rules/public-api/model/convert-to-public-api.js +0 -24
- package/dist/rules/public-api/model/errors.js +0 -34
- package/dist/rules/public-api/model/index.js +0 -5
- package/dist/rules/public-api/model/is-index-file.js +0 -7
- package/dist/rules/public-api/model/is-layer-public-api.js +0 -23
- package/dist/rules/public-api/model/is-segments-public-api.js +0 -11
- package/dist/rules/public-api/model/is-slice-public-api.js +0 -7
- package/dist/rules/public-api/model/should-be-from-public-api.js +0 -21
- package/dist/rules/public-api/model/validate-and-report-program.js +0 -15
- package/dist/rules/public-api/model/validate-and-report.js +0 -18
package/dist/index.d.cts
ADDED
|
@@ -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 };
|
package/dist/index.d.ts
ADDED
|
@@ -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 };
|