@alexlit/lint-kit 167.2.0 → 167.4.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/package.json +1 -1
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/LICENSE +21 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/README.md +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.d.ts +23 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.js +25 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.d.ts +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.js +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.d.ts +1194 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.js +39 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.d.ts +29 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.js +29 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.d.ts +2532 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.js +62 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.js +247 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.js +85 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.js +41 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.js +36 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.js +94 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.js +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.js +33 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.js +271 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.js +105 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.js +137 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.js +44 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.js +264 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.js +111 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.js +575 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.js +198 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.js +456 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.js +50 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.js +108 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.js +58 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.js +65 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.js +186 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.d.ts +216 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.d.ts +5 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.js +22 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.d.ts +7 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.d.ts +8 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.d.ts +38 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.d.ts +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.js +11 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.js +27 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.js +101 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.d.ts +13 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.js +160 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.js +49 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.d.ts +3 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.js +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.js +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.js +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.d.ts +15 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.js +154 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.d.ts +43 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.js +234 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.d.ts +25 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.js +446 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.js +27 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.d.ts +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.js +187 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.d.ts +8 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.js +40 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.d.ts +5 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.js +18 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.js +31 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.d.ts +28 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.js +279 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.js +11 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.js +46 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.d.ts +4 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.js +18 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.d.ts +3 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.js +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.js +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.d.ts +1 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.d.ts +4 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.js +21 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.d.ts +1 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.js +16 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.d.ts +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.js +75 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/globals.json +3345 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.d.ts +3452 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/license +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/package.json +117 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/readme.md +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/package.json +147 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/LICENSE +21 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/README.md +332 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.d.ts +667 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js +6642 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js.map +1 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/package.json +100 -0
- package/packages/config-eslint/package.json +5 -5
- package/packages/config-eslint/plugins/unicorn.js +2 -0
- package/packages/config-prettier/package.json +3 -3
- package/packages/config-stylelint/package.json +3 -3
package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { AST as JSONAST } from 'jsonc-eslint-parser';
|
|
2
|
+
import type { AST as YAMLAST } from 'yaml-eslint-parser';
|
|
3
|
+
import type { AST as VAST } from 'vue-eslint-parser';
|
|
4
|
+
import type { JSONSchema4 } from 'json-schema';
|
|
5
|
+
import type { VueParserServices } from './vue-parser-services';
|
|
6
|
+
import type { TokenStore } from './types';
|
|
7
|
+
import type { SettingsVueI18nLocaleDir } from './settings';
|
|
8
|
+
import type { RuleListener } from './vue-parser-services';
|
|
9
|
+
export interface Position {
|
|
10
|
+
line: number;
|
|
11
|
+
column: number;
|
|
12
|
+
}
|
|
13
|
+
export type Range = [number, number];
|
|
14
|
+
export interface SourceLocation {
|
|
15
|
+
start: Position;
|
|
16
|
+
end: Position;
|
|
17
|
+
}
|
|
18
|
+
export interface MaybeNode {
|
|
19
|
+
type: string;
|
|
20
|
+
range: Range;
|
|
21
|
+
loc: SourceLocation;
|
|
22
|
+
}
|
|
23
|
+
export interface MaybeToken extends MaybeNode {
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
export interface RuleContext {
|
|
27
|
+
id: string;
|
|
28
|
+
options: any[];
|
|
29
|
+
settings: {
|
|
30
|
+
'vue-i18n'?: {
|
|
31
|
+
localeDir?: SettingsVueI18nLocaleDir;
|
|
32
|
+
messageSyntaxVersion?: string;
|
|
33
|
+
cwd?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
parserPath: string;
|
|
37
|
+
report(descriptor: ReportDescriptor): void;
|
|
38
|
+
getCwd?: () => string;
|
|
39
|
+
}
|
|
40
|
+
interface ReportDescriptorOptionsBase {
|
|
41
|
+
data?: {
|
|
42
|
+
[key: string]: string;
|
|
43
|
+
};
|
|
44
|
+
fix?: null | ((fixer: RuleFixer) => null | Fix | IterableIterator<Fix> | Fix[]);
|
|
45
|
+
}
|
|
46
|
+
type SuggestionDescriptorMessage = {
|
|
47
|
+
desc: string;
|
|
48
|
+
} | {
|
|
49
|
+
messageId: string;
|
|
50
|
+
};
|
|
51
|
+
export type SuggestionReportDescriptor = SuggestionDescriptorMessage & ReportDescriptorOptionsBase;
|
|
52
|
+
interface ReportDescriptorOptions extends ReportDescriptorOptionsBase {
|
|
53
|
+
suggest?: SuggestionReportDescriptor[] | null;
|
|
54
|
+
}
|
|
55
|
+
type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions;
|
|
56
|
+
type ReportDescriptorMessage = {
|
|
57
|
+
message: string;
|
|
58
|
+
} | {
|
|
59
|
+
messageId: string;
|
|
60
|
+
};
|
|
61
|
+
type ReportDescriptorLocation = {
|
|
62
|
+
node: MaybeNode;
|
|
63
|
+
} | {
|
|
64
|
+
loc: SourceLocation | {
|
|
65
|
+
line: number;
|
|
66
|
+
column: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export interface RuleFixer {
|
|
70
|
+
insertTextAfter(nodeOrToken: MaybeNode, text: string): Fix;
|
|
71
|
+
insertTextAfterRange(range: Range, text: string): Fix;
|
|
72
|
+
insertTextBefore(nodeOrToken: MaybeNode, text: string): Fix;
|
|
73
|
+
insertTextBeforeRange(range: Range, text: string): Fix;
|
|
74
|
+
remove(nodeOrToken: MaybeNode): Fix;
|
|
75
|
+
removeRange(range: Range): Fix;
|
|
76
|
+
replaceText(nodeOrToken: MaybeNode, text: string): Fix;
|
|
77
|
+
replaceTextRange(range: Range, text: string): Fix;
|
|
78
|
+
}
|
|
79
|
+
export interface Fix {
|
|
80
|
+
range: Range;
|
|
81
|
+
text: string;
|
|
82
|
+
}
|
|
83
|
+
export type FilterPredicate = (tokenOrComment: MaybeToken) => boolean;
|
|
84
|
+
export type CursorWithSkipOptions = number | FilterPredicate | {
|
|
85
|
+
includeComments?: boolean;
|
|
86
|
+
filter?: FilterPredicate;
|
|
87
|
+
skip?: number;
|
|
88
|
+
};
|
|
89
|
+
export type CursorWithCountOptions = number | FilterPredicate | {
|
|
90
|
+
includeComments?: boolean;
|
|
91
|
+
filter?: FilterPredicate;
|
|
92
|
+
count?: number;
|
|
93
|
+
};
|
|
94
|
+
export interface SourceCode extends TokenStore {
|
|
95
|
+
text: string;
|
|
96
|
+
ast: VAST.ESLintProgram | JSONAST.JSONProgram | YAMLAST.YAMLProgram;
|
|
97
|
+
lines: string[];
|
|
98
|
+
hasBOM: boolean;
|
|
99
|
+
scopeManager: ScopeManager;
|
|
100
|
+
visitorKeys: VisitorKeys;
|
|
101
|
+
parserServices: {
|
|
102
|
+
isYAML?: true;
|
|
103
|
+
isJSON?: true;
|
|
104
|
+
} & VueParserServices;
|
|
105
|
+
getScope(node: MaybeNode): Scope;
|
|
106
|
+
getText(node?: MaybeNode, beforeCount?: number, afterCount?: number): string;
|
|
107
|
+
getLines(): string[];
|
|
108
|
+
getAllComments(): MaybeToken[];
|
|
109
|
+
getComments(node: MaybeNode): {
|
|
110
|
+
leading: MaybeToken[];
|
|
111
|
+
trailing: MaybeToken[];
|
|
112
|
+
};
|
|
113
|
+
getJSDocComment(node: MaybeNode): MaybeToken | null;
|
|
114
|
+
getNodeByRangeIndex(index: number): MaybeNode;
|
|
115
|
+
isSpaceBetweenTokens(first: MaybeToken, second: MaybeToken): boolean;
|
|
116
|
+
getLocFromIndex(index: number): Position;
|
|
117
|
+
getIndexFromLoc(location: Position): number;
|
|
118
|
+
}
|
|
119
|
+
export interface ScopeManager {
|
|
120
|
+
scopes: Scope[];
|
|
121
|
+
globalScope: Scope | null;
|
|
122
|
+
acquire(node: VAST.ESLintNode | VAST.ESLintProgram, inner?: boolean): Scope | null;
|
|
123
|
+
getDeclaredVariables(node: VAST.ESLintNode): Variable[];
|
|
124
|
+
}
|
|
125
|
+
export interface Scope {
|
|
126
|
+
type: 'block' | 'catch' | 'class' | 'for' | 'function' | 'function-expression-name' | 'global' | 'module' | 'switch' | 'with' | 'TDZ';
|
|
127
|
+
isStrict: boolean;
|
|
128
|
+
upper: Scope | null;
|
|
129
|
+
childScopes: Scope[];
|
|
130
|
+
variableScope: Scope;
|
|
131
|
+
block: VAST.ESLintNode;
|
|
132
|
+
variables: Variable[];
|
|
133
|
+
set: Map<string, Variable>;
|
|
134
|
+
references: Reference[];
|
|
135
|
+
through: Reference[];
|
|
136
|
+
functionExpressionScope: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface Variable {
|
|
139
|
+
name: string;
|
|
140
|
+
identifiers: VAST.ESLintIdentifier[];
|
|
141
|
+
references: Reference[];
|
|
142
|
+
defs: Definition[];
|
|
143
|
+
}
|
|
144
|
+
export interface Reference {
|
|
145
|
+
identifier: VAST.ESLintIdentifier;
|
|
146
|
+
from: Scope;
|
|
147
|
+
resolved: Variable | null;
|
|
148
|
+
writeExpr: VAST.ESLintNode | null;
|
|
149
|
+
init: boolean;
|
|
150
|
+
isWrite(): boolean;
|
|
151
|
+
isRead(): boolean;
|
|
152
|
+
isWriteOnly(): boolean;
|
|
153
|
+
isReadOnly(): boolean;
|
|
154
|
+
isReadWrite(): boolean;
|
|
155
|
+
}
|
|
156
|
+
export type DefinitionType = {
|
|
157
|
+
type: 'CatchClause';
|
|
158
|
+
node: VAST.ESLintCatchClause;
|
|
159
|
+
parent: null;
|
|
160
|
+
} | {
|
|
161
|
+
type: 'ClassName';
|
|
162
|
+
node: VAST.ESLintClassDeclaration | VAST.ESLintClassExpression;
|
|
163
|
+
parent: null;
|
|
164
|
+
} | {
|
|
165
|
+
type: 'FunctionName';
|
|
166
|
+
node: VAST.ESLintFunctionDeclaration | VAST.ESLintFunctionExpression;
|
|
167
|
+
parent: null;
|
|
168
|
+
} | {
|
|
169
|
+
type: 'ImplicitGlobalVariable';
|
|
170
|
+
node: VAST.ESLintProgram;
|
|
171
|
+
parent: null;
|
|
172
|
+
} | {
|
|
173
|
+
type: 'ImportBinding';
|
|
174
|
+
node: VAST.ESLintImportSpecifier | VAST.ESLintImportDefaultSpecifier | VAST.ESLintImportNamespaceSpecifier;
|
|
175
|
+
parent: VAST.ESLintImportDeclaration;
|
|
176
|
+
} | {
|
|
177
|
+
type: 'Parameter';
|
|
178
|
+
node: VAST.ESLintFunctionDeclaration | VAST.ESLintFunctionExpression | VAST.ESLintArrowFunctionExpression;
|
|
179
|
+
parent: null;
|
|
180
|
+
} | {
|
|
181
|
+
type: 'TDZ';
|
|
182
|
+
node: any;
|
|
183
|
+
parent: null;
|
|
184
|
+
} | {
|
|
185
|
+
type: 'Variable';
|
|
186
|
+
node: VAST.ESLintVariableDeclarator;
|
|
187
|
+
parent: VAST.ESLintVariableDeclaration;
|
|
188
|
+
};
|
|
189
|
+
export type Definition = DefinitionType & {
|
|
190
|
+
name: VAST.ESLintIdentifier;
|
|
191
|
+
};
|
|
192
|
+
export interface VisitorKeys {
|
|
193
|
+
[type: string]: string[];
|
|
194
|
+
}
|
|
195
|
+
export type RuleModule = {
|
|
196
|
+
create(context: RuleContext): RuleListener;
|
|
197
|
+
meta: RuleMetaData;
|
|
198
|
+
};
|
|
199
|
+
export interface RuleMetaData {
|
|
200
|
+
docs: {
|
|
201
|
+
description: string;
|
|
202
|
+
category: 'Recommended' | 'Best Practices' | 'Stylistic Issues';
|
|
203
|
+
recommended?: boolean;
|
|
204
|
+
replacedBy?: string[];
|
|
205
|
+
url: string;
|
|
206
|
+
};
|
|
207
|
+
messages?: {
|
|
208
|
+
[messageId: string]: string;
|
|
209
|
+
};
|
|
210
|
+
fixable: 'code' | 'whitespace' | null;
|
|
211
|
+
schema: JSONSchema4[];
|
|
212
|
+
hasSuggestions?: true;
|
|
213
|
+
deprecated?: boolean;
|
|
214
|
+
type: 'problem' | 'suggestion' | 'layout';
|
|
215
|
+
}
|
|
216
|
+
export {};
|
package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type I18nLocaleMessageValue = string | null | undefined | number | boolean | symbol | bigint | I18nLocaleMessageDictionary;
|
|
2
|
+
export type I18nLocaleMessageDictionary = {
|
|
3
|
+
[property: string]: I18nLocaleMessageValue;
|
|
4
|
+
[property: number]: I18nLocaleMessageValue;
|
|
5
|
+
};
|
package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./eslint"), exports);
|
|
19
|
+
__exportStar(require("./vue-parser-services"), exports);
|
|
20
|
+
__exportStar(require("./i18n"), exports);
|
|
21
|
+
__exportStar(require("./settings"), exports);
|
|
22
|
+
__exportStar(require("./nodes"), exports);
|
package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type LocaleKeyType = 'file' | 'path' | 'key';
|
|
2
|
+
export type SettingsVueI18nLocaleDir = SettingsVueI18nLocaleDirGlob | SettingsVueI18nLocaleDirObject | (SettingsVueI18nLocaleDirGlob | SettingsVueI18nLocaleDirObject)[];
|
|
3
|
+
export type SettingsVueI18nLocaleDirGlob = string;
|
|
4
|
+
export interface SettingsVueI18nLocaleDirObject {
|
|
5
|
+
pattern: string;
|
|
6
|
+
localeKey: LocaleKeyType;
|
|
7
|
+
localePattern?: string | RegExp;
|
|
8
|
+
}
|
package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { MaybeToken, MaybeNode, CursorWithSkipOptions, CursorWithCountOptions } from './eslint';
|
|
2
|
+
export interface TokenStore {
|
|
3
|
+
getTokenByRangeStart(offset: number, options?: {
|
|
4
|
+
includeComments: boolean;
|
|
5
|
+
}): MaybeToken | null;
|
|
6
|
+
getFirstToken(node: MaybeNode): MaybeToken;
|
|
7
|
+
getFirstToken(node: MaybeNode, options: number): MaybeToken;
|
|
8
|
+
getFirstToken(node: MaybeNode, options: CursorWithSkipOptions): MaybeToken | null;
|
|
9
|
+
getLastToken(node: MaybeNode): MaybeToken;
|
|
10
|
+
getLastToken(node: MaybeNode, options: number): MaybeToken;
|
|
11
|
+
getLastToken(node: MaybeNode, options: CursorWithSkipOptions): MaybeToken | null;
|
|
12
|
+
getTokenBefore(node: MaybeNode): MaybeToken;
|
|
13
|
+
getTokenBefore(node: MaybeNode, options: number): MaybeToken;
|
|
14
|
+
getTokenBefore(node: MaybeNode, options: {
|
|
15
|
+
includeComments: boolean;
|
|
16
|
+
}): MaybeToken;
|
|
17
|
+
getTokenBefore(node: MaybeNode, options: CursorWithSkipOptions): MaybeToken | null;
|
|
18
|
+
getTokenAfter(node: MaybeNode): MaybeToken;
|
|
19
|
+
getTokenAfter(node: MaybeNode, options: number): MaybeToken;
|
|
20
|
+
getTokenAfter(node: MaybeNode, options: {
|
|
21
|
+
includeComments: boolean;
|
|
22
|
+
}): MaybeToken;
|
|
23
|
+
getTokenAfter(node: MaybeNode, options: CursorWithSkipOptions): MaybeToken | null;
|
|
24
|
+
getFirstTokenBetween(left: MaybeNode, right: MaybeNode, options?: CursorWithSkipOptions): MaybeToken | null;
|
|
25
|
+
getLastTokenBetween(left: MaybeNode, right: MaybeNode, options?: CursorWithSkipOptions): MaybeToken | null;
|
|
26
|
+
getFirstTokens(node: MaybeNode, options?: CursorWithCountOptions): MaybeToken[];
|
|
27
|
+
getLastTokens(node: MaybeNode, options?: CursorWithCountOptions): MaybeToken[];
|
|
28
|
+
getTokensBefore(node: MaybeNode, options?: CursorWithCountOptions): MaybeToken[];
|
|
29
|
+
getTokensAfter(node: MaybeNode, options?: CursorWithCountOptions): MaybeToken[];
|
|
30
|
+
getFirstTokensBetween(left: MaybeNode, right: MaybeNode, options?: CursorWithCountOptions): MaybeToken[];
|
|
31
|
+
getLastTokensBetween(left: MaybeNode, right: MaybeNode, options?: CursorWithCountOptions): MaybeToken[];
|
|
32
|
+
getTokens(node: MaybeNode, beforeCount?: CursorWithCountOptions, afterCount?: number): MaybeToken[];
|
|
33
|
+
getTokensBetween(left: MaybeNode, right: MaybeNode, padding?: CursorWithCountOptions): MaybeToken[];
|
|
34
|
+
commentsExistBetween(left: MaybeNode, right: MaybeNode): boolean;
|
|
35
|
+
getCommentsBefore(nodeOrToken: MaybeNode): MaybeToken[];
|
|
36
|
+
getCommentsAfter(nodeOrToken: MaybeNode): MaybeToken[];
|
|
37
|
+
getCommentsInside(node: MaybeNode): MaybeToken[];
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import type { RuleContext, SourceCode } from './eslint';
|
|
3
|
+
import type { AST as VAST } from 'vue-eslint-parser';
|
|
4
|
+
import type { TokenStore } from './types';
|
|
5
|
+
import type { VElement } from 'vue-eslint-parser/ast/index';
|
|
6
|
+
export interface TemplateListener {
|
|
7
|
+
[key: string]: ((node: never) => void) | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface RuleListener {
|
|
10
|
+
onCodePathStart?(codePath: Rule.CodePath, node: never): void;
|
|
11
|
+
onCodePathEnd?(codePath: Rule.CodePath, node: never): void;
|
|
12
|
+
onCodePathSegmentStart?(segment: Rule.CodePathSegment, node: never): void;
|
|
13
|
+
onCodePathSegmentEnd?(segment: Rule.CodePathSegment, node: never): void;
|
|
14
|
+
onCodePathSegmentLoop?(fromSegment: Rule.CodePathSegment, toSegment: Rule.CodePathSegment, node: never): void;
|
|
15
|
+
[key: string]: ((node: never) => void) | ((codePath: Rule.CodePath, node: never) => void) | ((segment: Rule.CodePathSegment, node: never) => void) | ((fromSegment: Rule.CodePathSegment, toSegment: Rule.CodePathSegment, node: never) => void) | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface VueParserServices {
|
|
18
|
+
getTemplateBodyTokenStore: () => TokenStore;
|
|
19
|
+
defineTemplateBodyVisitor?: (templateBodyVisitor: TemplateListener, scriptVisitor?: RuleListener) => RuleListener;
|
|
20
|
+
defineCustomBlocksVisitor?: (context: RuleContext, parser: {
|
|
21
|
+
parseForESLint: (code: string, options: any) => any;
|
|
22
|
+
}, rule: {
|
|
23
|
+
target: string | string[] | ((lang: string | null, customBlock: VAST.VElement) => boolean);
|
|
24
|
+
create: CustomBlockVisitorFactory;
|
|
25
|
+
}, scriptVisitor?: RuleListener) => RuleListener;
|
|
26
|
+
getDocumentFragment?: () => VAST.VDocumentFragment | null;
|
|
27
|
+
}
|
|
28
|
+
export type CustomBlockVisitorFactory = (context: RuleContext & {
|
|
29
|
+
parserServices: SourceCode['parserServices'] & {
|
|
30
|
+
customBlock: VElement;
|
|
31
|
+
};
|
|
32
|
+
}) => RuleListener;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineCacheFunction = void 0;
|
|
4
|
+
const cache_loader_1 = require("./cache-loader");
|
|
5
|
+
function defineCacheFunction(fn) {
|
|
6
|
+
const loader = new cache_loader_1.CacheLoader(fn, Infinity);
|
|
7
|
+
return (...args) => {
|
|
8
|
+
return loader.get(...args);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
exports.defineCacheFunction = defineCacheFunction;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type LoadData<A extends any[], R> = (...args: A) => R;
|
|
2
|
+
export declare class CacheLoader<A extends any[], R> {
|
|
3
|
+
private loader;
|
|
4
|
+
private timeout;
|
|
5
|
+
private _cacheTime;
|
|
6
|
+
private _cacheKey;
|
|
7
|
+
private _cache;
|
|
8
|
+
constructor(loader: LoadData<A, R>, timeout?: number | (() => number));
|
|
9
|
+
get(...args: A): R;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CacheLoader = void 0;
|
|
4
|
+
const default_timeouts_1 = require("./default-timeouts");
|
|
5
|
+
class CacheLoader {
|
|
6
|
+
constructor(loader, timeout = () => default_timeouts_1.CACHE_LOADER) {
|
|
7
|
+
this._cacheKey = null;
|
|
8
|
+
this._cache = null;
|
|
9
|
+
this.loader = loader;
|
|
10
|
+
this.timeout = timeout;
|
|
11
|
+
this._cacheTime = Number.MIN_SAFE_INTEGER;
|
|
12
|
+
}
|
|
13
|
+
get(...args) {
|
|
14
|
+
const key = JSON.stringify(args);
|
|
15
|
+
const now = Date.now();
|
|
16
|
+
if (this._cacheKey === key) {
|
|
17
|
+
const timeout = typeof this.timeout === 'function' ? this.timeout() : this.timeout;
|
|
18
|
+
if (this._cacheTime + timeout > now) {
|
|
19
|
+
return this._cache;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
this._cacheKey = key;
|
|
23
|
+
this._cacheTime = now;
|
|
24
|
+
return (this._cache = this.loader(...args));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.CacheLoader = CacheLoader;
|
package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function isKebabCase(str: string): boolean;
|
|
2
|
+
export declare function isSnakeCase(str: string): boolean;
|
|
3
|
+
export declare function isCamelCase(str: string): boolean;
|
|
4
|
+
export declare function isLowerCase(str: string): boolean;
|
|
5
|
+
export declare function isPascalCase(str: string): boolean;
|
|
6
|
+
export declare function isScreamingSnakeCase(str: string): boolean;
|
|
7
|
+
export declare function camelCase(str: string): string;
|
|
8
|
+
export declare function pascalCase(str: string): string;
|
|
9
|
+
export declare const allowedCaseOptions: readonly ["camelCase", "kebab-case", "lowercase", "PascalCase", "snake_case", "SCREAMING_SNAKE_CASE"];
|
|
10
|
+
export declare function getCasingChecker(name: (typeof allowedCaseOptions)[number]): (str: string) => boolean;
|
package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCasingChecker = exports.allowedCaseOptions = exports.pascalCase = exports.camelCase = exports.isScreamingSnakeCase = exports.isPascalCase = exports.isLowerCase = exports.isCamelCase = exports.isSnakeCase = exports.isKebabCase = void 0;
|
|
4
|
+
function capitalize(str) {
|
|
5
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
6
|
+
}
|
|
7
|
+
function hasSymbols(str) {
|
|
8
|
+
return /[!"#%&'()*+,./:;<=>?@[\\\]^`{|}]/u.exec(str);
|
|
9
|
+
}
|
|
10
|
+
function hasUpper(str) {
|
|
11
|
+
return /[A-Z]/u.exec(str);
|
|
12
|
+
}
|
|
13
|
+
function hasLower(str) {
|
|
14
|
+
return /[a-z]/u.test(str);
|
|
15
|
+
}
|
|
16
|
+
function isKebabCase(str) {
|
|
17
|
+
if (hasUpper(str) ||
|
|
18
|
+
hasSymbols(str) ||
|
|
19
|
+
/^\d/u.exec(str) ||
|
|
20
|
+
/^-/u.exec(str) ||
|
|
21
|
+
/_|--|\s/u.exec(str)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
exports.isKebabCase = isKebabCase;
|
|
27
|
+
function isSnakeCase(str) {
|
|
28
|
+
if (hasUpper(str) ||
|
|
29
|
+
hasSymbols(str) ||
|
|
30
|
+
/^\d/u.exec(str) ||
|
|
31
|
+
/-|__|\s/u.exec(str)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
exports.isSnakeCase = isSnakeCase;
|
|
37
|
+
function isCamelCase(str) {
|
|
38
|
+
if (hasSymbols(str) ||
|
|
39
|
+
/^[A-Z\d]/u.exec(str) ||
|
|
40
|
+
/-|_|\s/u.exec(str)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
exports.isCamelCase = isCamelCase;
|
|
46
|
+
function isLowerCase(str) {
|
|
47
|
+
if (hasSymbols(str) ||
|
|
48
|
+
hasUpper(str) ||
|
|
49
|
+
/-|_|\s/u.exec(str)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
exports.isLowerCase = isLowerCase;
|
|
55
|
+
function isPascalCase(str) {
|
|
56
|
+
if (hasSymbols(str) ||
|
|
57
|
+
/^[a-z\d]/u.exec(str) ||
|
|
58
|
+
/-|_|\s/u.exec(str)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
exports.isPascalCase = isPascalCase;
|
|
64
|
+
function isScreamingSnakeCase(str) {
|
|
65
|
+
if (hasLower(str) || hasSymbols(str) || /-|__|\s/u.test(str)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
exports.isScreamingSnakeCase = isScreamingSnakeCase;
|
|
71
|
+
const checkersMap = {
|
|
72
|
+
'kebab-case': isKebabCase,
|
|
73
|
+
snake_case: isSnakeCase,
|
|
74
|
+
camelCase: isCamelCase,
|
|
75
|
+
lowercase: isLowerCase,
|
|
76
|
+
PascalCase: isPascalCase,
|
|
77
|
+
SCREAMING_SNAKE_CASE: isScreamingSnakeCase
|
|
78
|
+
};
|
|
79
|
+
function camelCase(str) {
|
|
80
|
+
if (isPascalCase(str)) {
|
|
81
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
82
|
+
}
|
|
83
|
+
return str.replace(/[-_](\w)/gu, (_, c) => (c ? c.toUpperCase() : ''));
|
|
84
|
+
}
|
|
85
|
+
exports.camelCase = camelCase;
|
|
86
|
+
function pascalCase(str) {
|
|
87
|
+
return capitalize(camelCase(str));
|
|
88
|
+
}
|
|
89
|
+
exports.pascalCase = pascalCase;
|
|
90
|
+
exports.allowedCaseOptions = [
|
|
91
|
+
'camelCase',
|
|
92
|
+
'kebab-case',
|
|
93
|
+
'lowercase',
|
|
94
|
+
'PascalCase',
|
|
95
|
+
'snake_case',
|
|
96
|
+
'SCREAMING_SNAKE_CASE'
|
|
97
|
+
];
|
|
98
|
+
function getCasingChecker(name) {
|
|
99
|
+
return checkersMap[name] || isPascalCase;
|
|
100
|
+
}
|
|
101
|
+
exports.getCasingChecker = getCasingChecker;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AST as VAST } from 'vue-eslint-parser';
|
|
2
|
+
import { ResourceLoader } from './resource-loader';
|
|
3
|
+
import type { RuleContext, VisitorKeys } from '../types';
|
|
4
|
+
export declare function collectKeysFromAST(node: VAST.ESLintProgram, visitorKeys?: VisitorKeys): string[];
|
|
5
|
+
declare class UsedKeysCache {
|
|
6
|
+
private _targetFilesLoader;
|
|
7
|
+
private _collectKeyResourcesFromFiles;
|
|
8
|
+
constructor();
|
|
9
|
+
collectKeysFromFiles(files: string[], extensions: string[], context: RuleContext): string[];
|
|
10
|
+
_getKeyResources(context: RuleContext, files: string[], extensions: string[]): ResourceLoader<string[]>[];
|
|
11
|
+
}
|
|
12
|
+
export declare const usedKeysCache: UsedKeysCache;
|
|
13
|
+
export {};
|