diff --git a/.changeset/light-cows-wonder.md b/.changeset/light-cows-wonder.md new file mode 100644 index 00000000..c57555a3 --- /dev/null +++ b/.changeset/light-cows-wonder.md @@ -0,0 +1,5 @@ +--- +"@intlify/eslint-plugin-vue-i18n": major +--- + +feat!: update recommended config diff --git a/docs/rules/index.md b/docs/rules/index.md index 621b2273..93c5d881 100644 --- a/docs/rules/index.md +++ b/docs/rules/index.md @@ -8,17 +8,17 @@ | Rule ID | Description | | |:--------|:------------|:---| -| [@intlify/vue-i18n/no-deprecated-i18n-component](./no-deprecated-i18n-component.html) | disallow using deprecated `` components (in Vue I18n 9.0.0+) | :black_nib: | -| [@intlify/vue-i18n/no-deprecated-i18n-place-attr](./no-deprecated-i18n-place-attr.html) | disallow using deprecated `place` attribute (Removed in Vue I18n 9.0.0+) | | -| [@intlify/vue-i18n/no-deprecated-i18n-places-prop](./no-deprecated-i18n-places-prop.html) | disallow using deprecated `places` prop (Removed in Vue I18n 9.0.0+) | | -| [@intlify/vue-i18n/no-deprecated-modulo-syntax](./no-deprecated-modulo-syntax.html) | enforce modulo interpolation to be named interpolation | :black_nib: | +| [@intlify/vue-i18n/no-deprecated-i18n-component](./no-deprecated-i18n-component.html) | disallow using deprecated `` components (in Vue I18n 9.0.0+) | :star::black_nib: | +| [@intlify/vue-i18n/no-deprecated-i18n-place-attr](./no-deprecated-i18n-place-attr.html) | disallow using deprecated `place` attribute (Removed in Vue I18n 9.0.0+) | :star: | +| [@intlify/vue-i18n/no-deprecated-i18n-places-prop](./no-deprecated-i18n-places-prop.html) | disallow using deprecated `places` prop (Removed in Vue I18n 9.0.0+) | :star: | +| [@intlify/vue-i18n/no-deprecated-modulo-syntax](./no-deprecated-modulo-syntax.html) | enforce modulo interpolation to be named interpolation | :star::black_nib: | | [@intlify/vue-i18n/no-deprecated-tc](./no-deprecated-tc.html) | disallow using deprecated `tc` or `$tc` (Deprecated in Vue I18n 10.0.0, removed fully in Vue I18n 11.0.0) | :star: | | [@intlify/vue-i18n/no-html-messages](./no-html-messages.html) | disallow use HTML localization messages | :star: | -| [@intlify/vue-i18n/no-i18n-t-path-prop](./no-i18n-t-path-prop.html) | disallow using `path` prop with `` | :black_nib: | +| [@intlify/vue-i18n/no-i18n-t-path-prop](./no-i18n-t-path-prop.html) | disallow using `path` prop with `` | :star::black_nib: | | [@intlify/vue-i18n/no-missing-keys](./no-missing-keys.html) | disallow missing locale message key at localization methods | :star: | | [@intlify/vue-i18n/no-raw-text](./no-raw-text.html) | disallow to string literal in template or JSX | :star: | | [@intlify/vue-i18n/no-v-html](./no-v-html.html) | disallow use of localization methods on v-html to prevent XSS attack | :star: | -| [@intlify/vue-i18n/valid-message-syntax](./valid-message-syntax.html) | disallow invalid message syntax | | +| [@intlify/vue-i18n/valid-message-syntax](./valid-message-syntax.html) | disallow invalid message syntax | :star: | ## Best Practices diff --git a/docs/rules/no-deprecated-i18n-component.md b/docs/rules/no-deprecated-i18n-component.md index a90e6e77..c13d8949 100644 --- a/docs/rules/no-deprecated-i18n-component.md +++ b/docs/rules/no-deprecated-i18n-component.md @@ -8,6 +8,7 @@ since: v0.11.0 > disallow using deprecated `` components (in Vue I18n 9.0.0+) +- :star: The `"extends": "plugin:@intlify/vue-i18n/recommended"` or `*.configs["flat/recommended"]` property in a configuration file enables this rule. - :black_nib:️ The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule. If you are migrating from Vue I18n v8 to v9, the `` component should be replaced with the `` component. diff --git a/docs/rules/no-deprecated-i18n-place-attr.md b/docs/rules/no-deprecated-i18n-place-attr.md index 443f3e05..9932521e 100644 --- a/docs/rules/no-deprecated-i18n-place-attr.md +++ b/docs/rules/no-deprecated-i18n-place-attr.md @@ -8,6 +8,8 @@ since: v0.11.0 > disallow using deprecated `place` attribute (Removed in Vue I18n 9.0.0+) +- :star: The `"extends": "plugin:@intlify/vue-i18n/recommended"` or `*.configs["flat/recommended"]` property in a configuration file enables this rule. + If you are migrating from Vue I18n v8 to v9, the `place` attribute should be replaced with the `v-slot`. ## :book: Rule Details diff --git a/docs/rules/no-deprecated-i18n-places-prop.md b/docs/rules/no-deprecated-i18n-places-prop.md index c78ef518..9f089042 100644 --- a/docs/rules/no-deprecated-i18n-places-prop.md +++ b/docs/rules/no-deprecated-i18n-places-prop.md @@ -8,6 +8,8 @@ since: v0.11.0 > disallow using deprecated `places` prop (Removed in Vue I18n 9.0.0+) +- :star: The `"extends": "plugin:@intlify/vue-i18n/recommended"` or `*.configs["flat/recommended"]` property in a configuration file enables this rule. + If you are migrating from Vue I18n v8 to v9, the `places` prop should be replaced with the `v-slot`. ## :book: Rule Details diff --git a/docs/rules/no-deprecated-modulo-syntax.md b/docs/rules/no-deprecated-modulo-syntax.md index 61941f24..74db47f5 100644 --- a/docs/rules/no-deprecated-modulo-syntax.md +++ b/docs/rules/no-deprecated-modulo-syntax.md @@ -8,6 +8,7 @@ since: v3.0.0 > enforce modulo interpolation to be named interpolation +- :star: The `"extends": "plugin:@intlify/vue-i18n/recommended"` or `*.configs["flat/recommended"]` property in a configuration file enables this rule. - :black_nib:️ The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule. This rule enforces modulo interpolation to be named interpolation diff --git a/docs/rules/no-i18n-t-path-prop.md b/docs/rules/no-i18n-t-path-prop.md index 7f24b9a5..b543fc7e 100644 --- a/docs/rules/no-i18n-t-path-prop.md +++ b/docs/rules/no-i18n-t-path-prop.md @@ -8,6 +8,7 @@ since: v0.11.0 > disallow using `path` prop with `` +- :star: The `"extends": "plugin:@intlify/vue-i18n/recommended"` or `*.configs["flat/recommended"]` property in a configuration file enables this rule. - :black_nib:️ The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule. You cannot use `path` prop with `` component. Perhaps it's an old habit mistake. diff --git a/docs/rules/valid-message-syntax.md b/docs/rules/valid-message-syntax.md index c89cfdaf..17df5f1b 100644 --- a/docs/rules/valid-message-syntax.md +++ b/docs/rules/valid-message-syntax.md @@ -8,6 +8,8 @@ since: v0.10.0 > disallow invalid message syntax +- :star: The `"extends": "plugin:@intlify/vue-i18n/recommended"` or `*.configs["flat/recommended"]` property in a configuration file enables this rule. + This rule warns invalid message syntax. This rule is useful localization leaks with incorrect message syntax. diff --git a/lib/configs/flat/recommended.ts b/lib/configs/flat/recommended.ts index f209b04a..f1e538af 100644 --- a/lib/configs/flat/recommended.ts +++ b/lib/configs/flat/recommended.ts @@ -19,11 +19,17 @@ export = [ { name: '@intlify/vue-i18n:recommended:rules', rules: { + '@intlify/vue-i18n/no-deprecated-i18n-component': 'warn', + '@intlify/vue-i18n/no-deprecated-i18n-place-attr': 'warn', + '@intlify/vue-i18n/no-deprecated-i18n-places-prop': 'warn', + '@intlify/vue-i18n/no-deprecated-modulo-syntax': 'warn', '@intlify/vue-i18n/no-deprecated-tc': 'warn', '@intlify/vue-i18n/no-html-messages': 'warn', + '@intlify/vue-i18n/no-i18n-t-path-prop': 'warn', '@intlify/vue-i18n/no-missing-keys': 'warn', '@intlify/vue-i18n/no-raw-text': 'warn', - '@intlify/vue-i18n/no-v-html': 'warn' + '@intlify/vue-i18n/no-v-html': 'warn', + '@intlify/vue-i18n/valid-message-syntax': 'warn' } } ] diff --git a/lib/configs/recommended.ts b/lib/configs/recommended.ts index eac4ec4a..ababfea3 100644 --- a/lib/configs/recommended.ts +++ b/lib/configs/recommended.ts @@ -13,10 +13,16 @@ export = { es6: true }, rules: { + '@intlify/vue-i18n/no-deprecated-i18n-component': 'warn', + '@intlify/vue-i18n/no-deprecated-i18n-place-attr': 'warn', + '@intlify/vue-i18n/no-deprecated-i18n-places-prop': 'warn', + '@intlify/vue-i18n/no-deprecated-modulo-syntax': 'warn', '@intlify/vue-i18n/no-deprecated-tc': 'warn', '@intlify/vue-i18n/no-html-messages': 'warn', + '@intlify/vue-i18n/no-i18n-t-path-prop': 'warn', '@intlify/vue-i18n/no-missing-keys': 'warn', '@intlify/vue-i18n/no-raw-text': 'warn', - '@intlify/vue-i18n/no-v-html': 'warn' + '@intlify/vue-i18n/no-v-html': 'warn', + '@intlify/vue-i18n/valid-message-syntax': 'warn' } } diff --git a/lib/rules/no-deprecated-i18n-component.ts b/lib/rules/no-deprecated-i18n-component.ts index 6743c9a1..465bd457 100644 --- a/lib/rules/no-deprecated-i18n-component.ts +++ b/lib/rules/no-deprecated-i18n-component.ts @@ -92,7 +92,7 @@ export = createRule({ 'disallow using deprecated `` components (in Vue I18n 9.0.0+)', category: 'Recommended', url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-deprecated-i18n-component.html', - recommended: false + recommended: true }, fixable: 'code', schema: [], diff --git a/lib/rules/no-deprecated-i18n-place-attr.ts b/lib/rules/no-deprecated-i18n-place-attr.ts index 78c111f0..f250b1a2 100644 --- a/lib/rules/no-deprecated-i18n-place-attr.ts +++ b/lib/rules/no-deprecated-i18n-place-attr.ts @@ -41,7 +41,7 @@ export = createRule({ 'disallow using deprecated `place` attribute (Removed in Vue I18n 9.0.0+)', category: 'Recommended', url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-deprecated-i18n-place-attr.html', - recommended: false + recommended: true }, fixable: null, schema: [], diff --git a/lib/rules/no-deprecated-i18n-places-prop.ts b/lib/rules/no-deprecated-i18n-places-prop.ts index 795161b3..b763d309 100644 --- a/lib/rules/no-deprecated-i18n-places-prop.ts +++ b/lib/rules/no-deprecated-i18n-places-prop.ts @@ -36,7 +36,7 @@ export = createRule({ 'disallow using deprecated `places` prop (Removed in Vue I18n 9.0.0+)', category: 'Recommended', url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-deprecated-i18n-places-prop.html', - recommended: false + recommended: true }, fixable: null, schema: [], diff --git a/lib/rules/no-deprecated-modulo-syntax.ts b/lib/rules/no-deprecated-modulo-syntax.ts index 6ba42155..59e237ff 100644 --- a/lib/rules/no-deprecated-modulo-syntax.ts +++ b/lib/rules/no-deprecated-modulo-syntax.ts @@ -123,7 +123,7 @@ export = createRule({ description: 'enforce modulo interpolation to be named interpolation', category: 'Recommended', url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-deprecated-modulo-syntax.html', - recommended: false + recommended: true }, fixable: 'code', schema: [] diff --git a/lib/rules/no-i18n-t-path-prop.ts b/lib/rules/no-i18n-t-path-prop.ts index 0d4cbd49..e5682b84 100644 --- a/lib/rules/no-i18n-t-path-prop.ts +++ b/lib/rules/no-i18n-t-path-prop.ts @@ -42,7 +42,7 @@ export = createRule({ description: 'disallow using `path` prop with ``', category: 'Recommended', url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-i18n-t-path-prop.html', - recommended: false + recommended: true }, fixable: 'code', schema: [], diff --git a/lib/rules/valid-message-syntax.ts b/lib/rules/valid-message-syntax.ts index 32eef98b..372098c3 100644 --- a/lib/rules/valid-message-syntax.ts +++ b/lib/rules/valid-message-syntax.ts @@ -208,8 +208,7 @@ export = createRule({ description: 'disallow invalid message syntax', category: 'Recommended', url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/valid-message-syntax.html', - // TODO To avoid breaking changes, include it in the configuration at the time of version upgrade. - recommended: false + recommended: true }, fixable: null, schema: [