@alexlit/lint-kit 172.0.0 → 173.0.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/package.json +3 -3
- package/packages/config-stylelint/package.json +9 -9
- package/scripts/i.sh +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/LICENSE +0 -21
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/README.md +0 -54
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.d.ts +0 -23
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.js +0 -25
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.d.ts +0 -35
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.js +0 -35
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.d.ts +0 -1194
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.js +0 -39
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.d.ts +0 -29
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.js +0 -29
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.d.ts +0 -2532
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.js +0 -62
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.js +0 -247
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.js +0 -85
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.js +0 -41
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.js +0 -36
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.js +0 -94
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.js +0 -42
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.js +0 -33
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.js +0 -271
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.js +0 -105
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.js +0 -137
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.js +0 -44
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.js +0 -264
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.js +0 -111
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.js +0 -575
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.js +0 -198
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.js +0 -456
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.js +0 -50
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.js +0 -108
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.js +0 -58
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.js +0 -65
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.js +0 -186
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.d.ts +0 -216
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.js +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.d.ts +0 -5
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.js +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.d.ts +0 -6
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.js +0 -22
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.d.ts +0 -7
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.js +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.d.ts +0 -8
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.js +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.d.ts +0 -38
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.js +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.d.ts +0 -32
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.js +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.js +0 -11
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.d.ts +0 -10
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.js +0 -27
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.d.ts +0 -10
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.js +0 -101
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.d.ts +0 -13
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.js +0 -160
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.js +0 -49
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.d.ts +0 -3
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.js +0 -35
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.d.ts +0 -6
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.js +0 -10
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.js +0 -9
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.d.ts +0 -15
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.js +0 -154
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.d.ts +0 -43
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.js +0 -234
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.d.ts +0 -25
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.js +0 -446
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.js +0 -27
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.d.ts +0 -54
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.js +0 -187
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.d.ts +0 -8
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.js +0 -40
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.d.ts +0 -5
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.js +0 -18
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.d.ts +0 -6
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.js +0 -31
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.d.ts +0 -28
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.js +0 -279
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.js +0 -11
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.js +0 -46
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.d.ts +0 -4
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.js +0 -18
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.d.ts +0 -3
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.js +0 -42
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.js +0 -54
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.d.ts +0 -1
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.js +0 -32
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.d.ts +0 -4
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.js +0 -32
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.d.ts +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.js +0 -21
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.d.ts +0 -1
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.js +0 -16
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.d.ts +0 -10
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.js +0 -32
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.d.ts +0 -9
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.js +0 -75
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/globals.json +0 -3345
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.d.ts +0 -3452
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.js +0 -2
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/license +0 -9
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/package.json +0 -117
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/readme.md +0 -42
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/package.json +0 -147
- package/packages/config-eslint/node_modules/glob/LICENSE +0 -15
- package/packages/config-eslint/node_modules/glob/README.md +0 -1265
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.d.ts +0 -388
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.js +0 -247
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.d.ts +0 -14
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.js +0 -27
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.d.ts +0 -24
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.js +0 -119
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.d.ts +0 -97
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.js +0 -68
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/package.json +0 -3
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.d.ts +0 -76
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.js +0 -219
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.d.ts +0 -59
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.js +0 -301
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.d.ts +0 -97
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.js +0 -387
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.d.mts +0 -3
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.d.mts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.mjs +0 -346
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.mjs.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.d.ts +0 -388
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.js +0 -243
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.d.ts +0 -14
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.js +0 -23
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.d.ts +0 -24
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.js +0 -115
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/index.d.ts +0 -97
- package/packages/config-eslint/node_modules/glob/dist/esm/index.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/index.js +0 -55
- package/packages/config-eslint/node_modules/glob/dist/esm/index.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/package.json +0 -3
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.d.ts +0 -76
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.js +0 -215
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.d.ts +0 -59
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.js +0 -294
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.d.ts +0 -97
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.d.ts.map +0 -1
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.js +0 -381
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.js.map +0 -1
- package/packages/config-eslint/node_modules/glob/package.json +0 -99
- package/packages/config-eslint/node_modules/ignore/LICENSE-MIT +0 -21
- package/packages/config-eslint/node_modules/ignore/README.md +0 -452
- package/packages/config-eslint/node_modules/ignore/index.d.ts +0 -81
- package/packages/config-eslint/node_modules/ignore/index.js +0 -784
- package/packages/config-eslint/node_modules/ignore/legacy.js +0 -681
- package/packages/config-eslint/node_modules/ignore/package.json +0 -87
- package/packages/config-eslint/node_modules/synckit/LICENSE +0 -21
- package/packages/config-eslint/node_modules/synckit/README.md +0 -245
- package/packages/config-eslint/node_modules/synckit/index.d.cts +0 -3
- package/packages/config-eslint/node_modules/synckit/lib/index.cjs +0 -590
- package/packages/config-eslint/node_modules/synckit/lib/index.d.ts +0 -43
- package/packages/config-eslint/node_modules/synckit/lib/index.js +0 -476
- package/packages/config-eslint/node_modules/synckit/lib/index.js.map +0 -1
- package/packages/config-eslint/node_modules/synckit/lib/types.d.ts +0 -40
- package/packages/config-eslint/node_modules/synckit/lib/types.js +0 -2
- package/packages/config-eslint/node_modules/synckit/lib/types.js.map +0 -1
- package/packages/config-eslint/node_modules/synckit/package.json +0 -46
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const vue_eslint_parser_1 = require("vue-eslint-parser");
|
|
3
|
-
const jsonc_eslint_parser_1 = require("jsonc-eslint-parser");
|
|
4
|
-
const index_1 = require("../utils/index");
|
|
5
|
-
const casing_1 = require("../utils/casing");
|
|
6
|
-
const rule_1 = require("../utils/rule");
|
|
7
|
-
const regexp_1 = require("../utils/regexp");
|
|
8
|
-
const compat_1 = require("../utils/compat");
|
|
9
|
-
function getFixQuote(quotes, code) {
|
|
10
|
-
if (!code.includes('\n')) {
|
|
11
|
-
for (const q of ["'", '"']) {
|
|
12
|
-
if (!quotes.has(q) && !code.includes(q)) {
|
|
13
|
-
return q;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
if (!quotes.has('`') && !code.includes('`')) {
|
|
18
|
-
return '`';
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const hasOnlyWhitespace = (value) => /^[\r\n\s\t\f\v]+$/.test(value);
|
|
23
|
-
const INNER_START_OFFSET = '<template>'.length;
|
|
24
|
-
function getTargetAttrs(tagName, config) {
|
|
25
|
-
const result = [];
|
|
26
|
-
for (const { name, attrs } of config.attributes) {
|
|
27
|
-
name.lastIndex = 0;
|
|
28
|
-
if (name.test(tagName)) {
|
|
29
|
-
result.push(...attrs);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if ((0, casing_1.isKebabCase)(tagName)) {
|
|
33
|
-
result.push(...getTargetAttrs((0, casing_1.pascalCase)(tagName), config));
|
|
34
|
-
}
|
|
35
|
-
return new Set(result);
|
|
36
|
-
}
|
|
37
|
-
function calculateRange(node, base) {
|
|
38
|
-
const range = node.range;
|
|
39
|
-
if (!base) {
|
|
40
|
-
return range;
|
|
41
|
-
}
|
|
42
|
-
const offset = base.range[0] + 1 - INNER_START_OFFSET;
|
|
43
|
-
return [offset + range[0], offset + range[1]];
|
|
44
|
-
}
|
|
45
|
-
function calculateLoc(node, base, context) {
|
|
46
|
-
if (!base) {
|
|
47
|
-
return node.loc;
|
|
48
|
-
}
|
|
49
|
-
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
50
|
-
const range = calculateRange(node, base);
|
|
51
|
-
return {
|
|
52
|
-
start: sourceCode.getLocFromIndex(range[0]),
|
|
53
|
-
end: sourceCode.getLocFromIndex(range[1])
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function testValue(value, config) {
|
|
57
|
-
if (typeof value === 'string') {
|
|
58
|
-
return (hasOnlyWhitespace(value) ||
|
|
59
|
-
config.ignorePattern.test(value.trim()) ||
|
|
60
|
-
config.ignoreText.includes(value.trim()));
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function checkVAttributeDirective(context, node, config, baseNode, scope) {
|
|
67
|
-
const attrNode = node.parent;
|
|
68
|
-
if (attrNode.key && attrNode.key.type === 'VDirectiveKey') {
|
|
69
|
-
if ((attrNode.key.name === 'text' ||
|
|
70
|
-
attrNode.key.name.name === 'text') &&
|
|
71
|
-
node.expression) {
|
|
72
|
-
checkExpressionContainerText(context, node.expression, config, baseNode, scope);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function checkVExpressionContainer(context, node, config, baseNode, scope) {
|
|
77
|
-
if (!node.expression) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (node.parent && node.parent.type === 'VElement') {
|
|
81
|
-
checkExpressionContainerText(context, node.expression, config, baseNode, scope);
|
|
82
|
-
}
|
|
83
|
-
else if (node.parent &&
|
|
84
|
-
node.parent.type === 'VAttribute' &&
|
|
85
|
-
node.parent.directive) {
|
|
86
|
-
checkVAttributeDirective(context, node, config, baseNode, scope);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function checkExpressionContainerText(context, expression, config, baseNode, scope) {
|
|
90
|
-
if ((0, index_1.isStaticLiteral)(expression)) {
|
|
91
|
-
checkLiteral(context, expression, config, baseNode, scope);
|
|
92
|
-
}
|
|
93
|
-
else if (expression.type === 'ConditionalExpression') {
|
|
94
|
-
const targets = [expression.consequent, expression.alternate];
|
|
95
|
-
targets.forEach(target => {
|
|
96
|
-
if ((0, index_1.isStaticLiteral)(target)) {
|
|
97
|
-
checkLiteral(context, target, config, baseNode, scope);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function checkLiteral(context, literal, config, baseNode, scope) {
|
|
103
|
-
const value = (0, index_1.getStaticLiteralValue)(literal);
|
|
104
|
-
if (testValue(value, config)) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const loc = calculateLoc(literal, baseNode, context);
|
|
108
|
-
context.report({
|
|
109
|
-
loc,
|
|
110
|
-
message: `raw text '${value}' is used`,
|
|
111
|
-
suggest: buildSuggest()
|
|
112
|
-
});
|
|
113
|
-
function buildSuggest() {
|
|
114
|
-
if (scope === 'template-option') {
|
|
115
|
-
if (!withoutEscape(context, baseNode)) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else if (scope !== 'template') {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
const replaceRange = calculateRange(literal, baseNode);
|
|
123
|
-
const suggest = [];
|
|
124
|
-
for (const key of extractMessageKeys(context, `${value}`)) {
|
|
125
|
-
suggest.push({
|
|
126
|
-
desc: `Replace to "$t('${key}')".`,
|
|
127
|
-
fix(fixer) {
|
|
128
|
-
return fixer.replaceTextRange(replaceRange, `$t('${key}')`);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const i18nBlocks = getFixableI18nBlocks(context, `${value}`);
|
|
133
|
-
if (i18nBlocks) {
|
|
134
|
-
suggest.push({
|
|
135
|
-
desc: "Add the resource to the '<i18n>' block.",
|
|
136
|
-
fix(fixer) {
|
|
137
|
-
return generateFixAddI18nBlock(context, fixer, i18nBlocks, `${value}`, [
|
|
138
|
-
fixer.insertTextBeforeRange(replaceRange, '$t('),
|
|
139
|
-
fixer.insertTextAfterRange(replaceRange, ')')
|
|
140
|
-
]);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
return suggest;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
function checkVAttribute(context, attribute, config, baseNode, scope) {
|
|
148
|
-
if (!attribute.value) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const literal = attribute.value;
|
|
152
|
-
const value = literal.value;
|
|
153
|
-
if (testValue(value, config)) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const loc = calculateLoc(literal, baseNode, context);
|
|
157
|
-
context.report({
|
|
158
|
-
loc,
|
|
159
|
-
message: `raw text '${value}' is used`,
|
|
160
|
-
suggest: buildSuggest()
|
|
161
|
-
});
|
|
162
|
-
function buildSuggest() {
|
|
163
|
-
if (scope === 'template-option') {
|
|
164
|
-
if (!withoutEscape(context, baseNode)) {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
else if (scope !== 'template') {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
const literalRange = calculateRange(literal, baseNode);
|
|
172
|
-
const replaceRange = [literalRange[0] + 1, literalRange[1] - 1];
|
|
173
|
-
const keyRange = calculateRange(attribute.key, baseNode);
|
|
174
|
-
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
175
|
-
const attrQuote = sourceCode.text[literalRange[0]];
|
|
176
|
-
const quotes = new Set(attrQuote);
|
|
177
|
-
if (baseNode) {
|
|
178
|
-
const baseQuote = sourceCode.text[baseNode.range[0]];
|
|
179
|
-
quotes.add(baseQuote);
|
|
180
|
-
}
|
|
181
|
-
const suggest = [];
|
|
182
|
-
for (const key of extractMessageKeys(context, `${value}`)) {
|
|
183
|
-
const quote = getFixQuote(quotes, key);
|
|
184
|
-
if (quote) {
|
|
185
|
-
suggest.push({
|
|
186
|
-
desc: `Replace to "$t('${key}')".`,
|
|
187
|
-
fix(fixer) {
|
|
188
|
-
return [
|
|
189
|
-
fixer.insertTextBeforeRange(keyRange, ':'),
|
|
190
|
-
fixer.replaceTextRange(replaceRange, `$t(${quote}${key}${quote})`)
|
|
191
|
-
];
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
const i18nBlocks = getFixableI18nBlocks(context, `${value}`);
|
|
197
|
-
const quote = getFixQuote(quotes, sourceCode.text.slice(...replaceRange));
|
|
198
|
-
if (i18nBlocks && quote) {
|
|
199
|
-
suggest.push({
|
|
200
|
-
desc: "Add the resource to the '<i18n>' block.",
|
|
201
|
-
fix(fixer) {
|
|
202
|
-
return generateFixAddI18nBlock(context, fixer, i18nBlocks, `${value}`, [
|
|
203
|
-
fixer.insertTextBeforeRange(keyRange, ':'),
|
|
204
|
-
fixer.insertTextBeforeRange(replaceRange, `$t(${quote}`),
|
|
205
|
-
fixer.insertTextAfterRange(replaceRange, `${quote})`)
|
|
206
|
-
]);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
return suggest;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function checkText(context, textNode, config, baseNode, scope) {
|
|
214
|
-
const value = textNode.value;
|
|
215
|
-
if (testValue(value, config)) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
const loc = calculateLoc(textNode, baseNode, context);
|
|
219
|
-
context.report({
|
|
220
|
-
loc,
|
|
221
|
-
message: `raw text '${value}' is used`,
|
|
222
|
-
suggest: buildSuggest()
|
|
223
|
-
});
|
|
224
|
-
function buildSuggest() {
|
|
225
|
-
if (scope === 'template-option') {
|
|
226
|
-
if (!withoutEscape(context, baseNode)) {
|
|
227
|
-
return null;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
const replaceRange = calculateRange(textNode, baseNode);
|
|
231
|
-
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
232
|
-
const quotes = new Set();
|
|
233
|
-
if (baseNode) {
|
|
234
|
-
const baseQuote = sourceCode.text[baseNode.range[0]];
|
|
235
|
-
quotes.add(baseQuote);
|
|
236
|
-
}
|
|
237
|
-
const suggest = [];
|
|
238
|
-
for (const key of extractMessageKeys(context, value)) {
|
|
239
|
-
const quote = getFixQuote(quotes, key);
|
|
240
|
-
if (quote) {
|
|
241
|
-
const before = `${scope === 'jsx' ? '{' : '{{'}$t(${quote}`;
|
|
242
|
-
const after = `${quote})${scope === 'jsx' ? '}' : '}}'}`;
|
|
243
|
-
suggest.push({
|
|
244
|
-
desc: `Replace to "${before}${key}${after}".`,
|
|
245
|
-
fix(fixer) {
|
|
246
|
-
return fixer.replaceTextRange(replaceRange, before + key + after);
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
const i18nBlocks = getFixableI18nBlocks(context, `${value}`);
|
|
252
|
-
const quote = getFixQuote(quotes, sourceCode.text.slice(...replaceRange));
|
|
253
|
-
if (i18nBlocks && quote) {
|
|
254
|
-
const before = `${scope === 'jsx' ? '{' : '{{'}$t(${quote}`;
|
|
255
|
-
const after = `${quote})${scope === 'jsx' ? '}' : '}}'}`;
|
|
256
|
-
suggest.push({
|
|
257
|
-
desc: "Add the resource to the '<i18n>' block.",
|
|
258
|
-
fix(fixer) {
|
|
259
|
-
return generateFixAddI18nBlock(context, fixer, i18nBlocks, `${value}`, [
|
|
260
|
-
fixer.insertTextBeforeRange(replaceRange, before),
|
|
261
|
-
fixer.insertTextAfterRange(replaceRange, after)
|
|
262
|
-
]);
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
return suggest;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
function findVariable(variables, name) {
|
|
270
|
-
return variables.find(variable => variable.name === name);
|
|
271
|
-
}
|
|
272
|
-
function getComponentTemplateValueNode(context, node) {
|
|
273
|
-
const templateNode = node.properties.find((p) => p.type === 'Property' &&
|
|
274
|
-
p.key.type === 'Identifier' &&
|
|
275
|
-
p.key.name === 'template');
|
|
276
|
-
if (templateNode) {
|
|
277
|
-
if ((0, index_1.isStaticLiteral)(templateNode.value)) {
|
|
278
|
-
return templateNode.value;
|
|
279
|
-
}
|
|
280
|
-
else if (templateNode.value.type === 'Identifier') {
|
|
281
|
-
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
282
|
-
const templateVariable = findVariable(sourceCode.getScope(node).variables, templateNode.value.name);
|
|
283
|
-
if (templateVariable) {
|
|
284
|
-
const varDeclNode = templateVariable.defs[0]
|
|
285
|
-
.node;
|
|
286
|
-
if (varDeclNode.init) {
|
|
287
|
-
if ((0, index_1.isStaticLiteral)(varDeclNode.init)) {
|
|
288
|
-
return varDeclNode.init;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
function getComponentTemplateNode(node) {
|
|
297
|
-
return (0, vue_eslint_parser_1.parse)(`<template>${(0, index_1.getStaticLiteralValue)(node)}</template>`, {})
|
|
298
|
-
.templateBody;
|
|
299
|
-
}
|
|
300
|
-
function withoutEscape(context, baseNode) {
|
|
301
|
-
if (!baseNode) {
|
|
302
|
-
return false;
|
|
303
|
-
}
|
|
304
|
-
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
305
|
-
const sourceText = sourceCode.getText(baseNode).slice(1, -1);
|
|
306
|
-
const templateText = `${(0, index_1.getStaticLiteralValue)(baseNode)}`;
|
|
307
|
-
return sourceText === templateText;
|
|
308
|
-
}
|
|
309
|
-
function getFixableI18nBlocks(context, newKey) {
|
|
310
|
-
var _a, _b;
|
|
311
|
-
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
312
|
-
const df = (_b = (_a = sourceCode.parserServices).getDocumentFragment) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
313
|
-
if (!df) {
|
|
314
|
-
return null;
|
|
315
|
-
}
|
|
316
|
-
const i18nBlocks = [];
|
|
317
|
-
for (const i18n of df.children.filter(index_1.isI18nBlock)) {
|
|
318
|
-
const attrs = (0, index_1.getStaticAttributes)(i18n);
|
|
319
|
-
if (attrs.src != null ||
|
|
320
|
-
(attrs.lang != null && attrs.lang !== 'json' && attrs.lang !== 'json5')) {
|
|
321
|
-
return null;
|
|
322
|
-
}
|
|
323
|
-
const textNode = i18n.children[0];
|
|
324
|
-
const sourceString = textNode != null && textNode.type === 'VText' && textNode.value;
|
|
325
|
-
if (!sourceString) {
|
|
326
|
-
return null;
|
|
327
|
-
}
|
|
328
|
-
try {
|
|
329
|
-
const ast = (0, jsonc_eslint_parser_1.parseJSON)(sourceString);
|
|
330
|
-
const root = ast.body[0].expression;
|
|
331
|
-
if (root.type !== 'JSONObjectExpression') {
|
|
332
|
-
return null;
|
|
333
|
-
}
|
|
334
|
-
const objects = [];
|
|
335
|
-
if (attrs.locale) {
|
|
336
|
-
objects.push(root);
|
|
337
|
-
}
|
|
338
|
-
else {
|
|
339
|
-
for (const prop of root.properties) {
|
|
340
|
-
if (prop.value.type !== 'JSONObjectExpression') {
|
|
341
|
-
return null;
|
|
342
|
-
}
|
|
343
|
-
objects.push(prop.value);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
for (const objNode of objects) {
|
|
347
|
-
if (objNode.properties.some(prop => {
|
|
348
|
-
const keyValue = `${(0, jsonc_eslint_parser_1.getStaticJSONValue)(prop.key)}`;
|
|
349
|
-
return keyValue === newKey;
|
|
350
|
-
})) {
|
|
351
|
-
return null;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
const offset = textNode.range[0];
|
|
355
|
-
const getIndex = (index) => offset + index;
|
|
356
|
-
i18nBlocks.push({
|
|
357
|
-
attrs,
|
|
358
|
-
i18n,
|
|
359
|
-
objects,
|
|
360
|
-
offsets: {
|
|
361
|
-
getLoc: (index) => {
|
|
362
|
-
return sourceCode.getLocFromIndex(getIndex(index));
|
|
363
|
-
},
|
|
364
|
-
getIndex
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
catch (_c) {
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
return i18nBlocks;
|
|
373
|
-
}
|
|
374
|
-
function* generateFixAddI18nBlock(context, fixer, i18nBlocks, resource, replaceFixes) {
|
|
375
|
-
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
376
|
-
const text = JSON.stringify(resource);
|
|
377
|
-
const df = sourceCode.parserServices.getDocumentFragment();
|
|
378
|
-
const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore();
|
|
379
|
-
if (!i18nBlocks.length) {
|
|
380
|
-
let baseToken = df.children.find(index_1.isVElement);
|
|
381
|
-
let beforeToken = tokenStore.getTokenBefore(baseToken, {
|
|
382
|
-
includeComments: true
|
|
383
|
-
});
|
|
384
|
-
while (beforeToken && beforeToken.type === 'HTMLComment') {
|
|
385
|
-
baseToken = beforeToken;
|
|
386
|
-
beforeToken = tokenStore.getTokenBefore(beforeToken, {
|
|
387
|
-
includeComments: true
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
yield fixer.insertTextBeforeRange(baseToken.range, `<i18n>\n{\n "en": {\n ${text}: ${text}\n }\n}\n</i18n>\n\n`);
|
|
391
|
-
yield* replaceFixes;
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
const replaceFix = replaceFixes[0];
|
|
395
|
-
const after = i18nBlocks.find(e => replaceFix.range[1] < e.i18n.range[0]);
|
|
396
|
-
for (const { i18n, offsets, objects } of i18nBlocks) {
|
|
397
|
-
if (after && after.i18n === i18n) {
|
|
398
|
-
yield* replaceFixes;
|
|
399
|
-
}
|
|
400
|
-
for (const objectNode of objects) {
|
|
401
|
-
const first = objectNode.properties[0];
|
|
402
|
-
let indent = `${/^\s*/.exec(sourceCode.lines[offsets.getLoc(objectNode.range[0]).line - 1])[0]} `;
|
|
403
|
-
let next = '';
|
|
404
|
-
if (first) {
|
|
405
|
-
if (objectNode.loc.start.line === first.loc.start.line) {
|
|
406
|
-
next = `,\n${indent}`;
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
indent = /^\s*/.exec(sourceCode.lines[offsets.getLoc(first.range[0]).line - 1])[0];
|
|
410
|
-
next = ',';
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
yield fixer.insertTextAfterRange([
|
|
414
|
-
offsets.getIndex(objectNode.range[0]),
|
|
415
|
-
offsets.getIndex(objectNode.range[0] + 1)
|
|
416
|
-
], `\n${indent}${text}: ${text}${next}`);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
if (after == null) {
|
|
420
|
-
yield* replaceFixes;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
function extractMessageKeys(context, targetValue) {
|
|
424
|
-
const keys = new Set();
|
|
425
|
-
const localeMessages = (0, index_1.getLocaleMessages)(context, {
|
|
426
|
-
ignoreMissingSettingsError: true
|
|
427
|
-
});
|
|
428
|
-
for (const localeMessage of localeMessages.localeMessages) {
|
|
429
|
-
for (const locale of localeMessage.locales) {
|
|
430
|
-
const messages = localeMessage.getMessagesFromLocale(locale);
|
|
431
|
-
for (const key of extractMessageKeysFromObject(messages, [])) {
|
|
432
|
-
keys.add(key);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
return [...keys].sort();
|
|
437
|
-
function* extractMessageKeysFromObject(messages, paths) {
|
|
438
|
-
for (const key of Object.keys(messages)) {
|
|
439
|
-
const value = messages[key];
|
|
440
|
-
if (value == null) {
|
|
441
|
-
continue;
|
|
442
|
-
}
|
|
443
|
-
if (typeof value !== 'object') {
|
|
444
|
-
if (targetValue === value) {
|
|
445
|
-
yield [...paths, key].join('.');
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
else {
|
|
449
|
-
yield* extractMessageKeysFromObject(value, [...paths, key]);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
function parseTargetAttrs(options) {
|
|
455
|
-
const regexps = [];
|
|
456
|
-
for (const tagName of Object.keys(options)) {
|
|
457
|
-
const attrs = new Set(options[tagName]);
|
|
458
|
-
regexps.push({
|
|
459
|
-
name: (0, regexp_1.toRegExp)(tagName),
|
|
460
|
-
attrs
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
return regexps;
|
|
464
|
-
}
|
|
465
|
-
function create(context) {
|
|
466
|
-
const options = context.options[0] || {};
|
|
467
|
-
const config = {
|
|
468
|
-
attributes: [],
|
|
469
|
-
ignorePattern: /^$/,
|
|
470
|
-
ignoreNodes: [],
|
|
471
|
-
ignoreText: []
|
|
472
|
-
};
|
|
473
|
-
if (options.ignorePattern) {
|
|
474
|
-
config.ignorePattern = new RegExp(options.ignorePattern, 'u');
|
|
475
|
-
}
|
|
476
|
-
if (options.ignoreNodes) {
|
|
477
|
-
config.ignoreNodes = options.ignoreNodes;
|
|
478
|
-
}
|
|
479
|
-
if (options.ignoreText) {
|
|
480
|
-
config.ignoreText = options.ignoreText;
|
|
481
|
-
}
|
|
482
|
-
if (options.attributes) {
|
|
483
|
-
config.attributes = parseTargetAttrs(options.attributes);
|
|
484
|
-
}
|
|
485
|
-
const templateVisitor = {
|
|
486
|
-
VExpressionContainer(node, baseNode = null, scope = 'template') {
|
|
487
|
-
checkVExpressionContainer(context, node, config, baseNode, scope);
|
|
488
|
-
},
|
|
489
|
-
VAttribute(node, baseNode = null, scope = 'template') {
|
|
490
|
-
if (node.directive) {
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
const tagName = node.parent.parent.rawName;
|
|
494
|
-
const attrName = node.key.name;
|
|
495
|
-
if (!getTargetAttrs(tagName, config).has(attrName)) {
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
checkVAttribute(context, node, config, baseNode, scope);
|
|
499
|
-
},
|
|
500
|
-
VText(node, baseNode = null, scope = 'template') {
|
|
501
|
-
if (config.ignoreNodes.includes(node.parent.name)) {
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
checkText(context, node, config, baseNode, scope);
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
return (0, index_1.defineTemplateBodyVisitor)(context, templateVisitor, {
|
|
508
|
-
ObjectExpression(node) {
|
|
509
|
-
const valueNode = getComponentTemplateValueNode(context, node);
|
|
510
|
-
if (!valueNode) {
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
if ((0, index_1.getVueObjectType)(context, node) == null ||
|
|
514
|
-
(valueNode.type === 'Literal' && valueNode.value == null)) {
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
const templateNode = getComponentTemplateNode(valueNode);
|
|
518
|
-
vue_eslint_parser_1.AST.traverseNodes(templateNode, {
|
|
519
|
-
enterNode(node) {
|
|
520
|
-
const visitor = templateVisitor[node.type];
|
|
521
|
-
if (visitor) {
|
|
522
|
-
visitor(node, valueNode, 'template-option');
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
leaveNode() {
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
},
|
|
529
|
-
JSXText(node) {
|
|
530
|
-
checkText(context, node, config, null, 'jsx');
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
module.exports = (0, rule_1.createRule)({
|
|
535
|
-
meta: {
|
|
536
|
-
type: 'suggestion',
|
|
537
|
-
docs: {
|
|
538
|
-
description: 'disallow to string literal in template or JSX',
|
|
539
|
-
category: 'Recommended',
|
|
540
|
-
url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-raw-text.html',
|
|
541
|
-
recommended: true
|
|
542
|
-
},
|
|
543
|
-
fixable: null,
|
|
544
|
-
hasSuggestions: true,
|
|
545
|
-
schema: [
|
|
546
|
-
{
|
|
547
|
-
type: 'object',
|
|
548
|
-
properties: {
|
|
549
|
-
attributes: {
|
|
550
|
-
type: 'object',
|
|
551
|
-
patternProperties: {
|
|
552
|
-
'^(?:\\S+|/.*/[a-z]*)$': {
|
|
553
|
-
type: 'array',
|
|
554
|
-
items: { type: 'string' },
|
|
555
|
-
uniqueItems: true
|
|
556
|
-
}
|
|
557
|
-
},
|
|
558
|
-
additionalProperties: false
|
|
559
|
-
},
|
|
560
|
-
ignoreNodes: {
|
|
561
|
-
type: 'array'
|
|
562
|
-
},
|
|
563
|
-
ignorePattern: {
|
|
564
|
-
type: 'string'
|
|
565
|
-
},
|
|
566
|
-
ignoreText: {
|
|
567
|
-
type: 'array'
|
|
568
|
-
}
|
|
569
|
-
},
|
|
570
|
-
additionalProperties: false
|
|
571
|
-
}
|
|
572
|
-
]
|
|
573
|
-
},
|
|
574
|
-
create
|
|
575
|
-
});
|