Skip to content

feat!: update recommended config #520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/light-cows-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@intlify/eslint-plugin-vue-i18n": major
---

feat!: update recommended config
12 changes: 6 additions & 6 deletions docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
<!--prettier-ignore-->
| Rule ID | Description | |
|:--------|:------------|:---|
| [@intlify/vue-i18n/<wbr>no-deprecated-i18n-component](./no-deprecated-i18n-component.html) | disallow using deprecated `<i18n>` components (in Vue I18n 9.0.0+) | :black_nib: |
| [@intlify/vue-i18n/<wbr>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/<wbr>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/<wbr>no-deprecated-modulo-syntax](./no-deprecated-modulo-syntax.html) | enforce modulo interpolation to be named interpolation | :black_nib: |
| [@intlify/vue-i18n/<wbr>no-deprecated-i18n-component](./no-deprecated-i18n-component.html) | disallow using deprecated `<i18n>` components (in Vue I18n 9.0.0+) | :star::black_nib: |
| [@intlify/vue-i18n/<wbr>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/<wbr>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/<wbr>no-deprecated-modulo-syntax](./no-deprecated-modulo-syntax.html) | enforce modulo interpolation to be named interpolation | :star::black_nib: |
| [@intlify/vue-i18n/<wbr>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/<wbr>no-html-messages](./no-html-messages.html) | disallow use HTML localization messages | :star: |
| [@intlify/vue-i18n/<wbr>no-i18n-t-path-prop](./no-i18n-t-path-prop.html) | disallow using `path` prop with `<i18n-t>` | :black_nib: |
| [@intlify/vue-i18n/<wbr>no-i18n-t-path-prop](./no-i18n-t-path-prop.html) | disallow using `path` prop with `<i18n-t>` | :star::black_nib: |
| [@intlify/vue-i18n/<wbr>no-missing-keys](./no-missing-keys.html) | disallow missing locale message key at localization methods | :star: |
| [@intlify/vue-i18n/<wbr>no-raw-text](./no-raw-text.html) | disallow to string literal in template or JSX | :star: |
| [@intlify/vue-i18n/<wbr>no-v-html](./no-v-html.html) | disallow use of localization methods on v-html to prevent XSS attack | :star: |
| [@intlify/vue-i18n/<wbr>valid-message-syntax](./valid-message-syntax.html) | disallow invalid message syntax | |
| [@intlify/vue-i18n/<wbr>valid-message-syntax](./valid-message-syntax.html) | disallow invalid message syntax | :star: |

## Best Practices

Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-deprecated-i18n-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ since: v0.11.0

> disallow using deprecated `<i18n>` 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 `<i18n>` component should be replaced with the `<i18n-t>` component.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-deprecated-i18n-place-attr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-deprecated-i18n-places-prop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-deprecated-modulo-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-i18n-t-path-prop.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ since: v0.11.0

> disallow using `path` prop with `<i18n-t>`

- :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 `<i18n-t>` component. Perhaps it's an old habit mistake.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/valid-message-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 7 additions & 1 deletion lib/configs/flat/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
]
8 changes: 7 additions & 1 deletion lib/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-i18n-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export = createRule({
'disallow using deprecated `<i18n>` 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: [],
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-i18n-place-attr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-i18n-places-prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-modulo-syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-i18n-t-path-prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export = createRule({
description: 'disallow using `path` prop with `<i18n-t>`',
category: 'Recommended',
url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-i18n-t-path-prop.html',
recommended: false
recommended: true
},
fixable: 'code',
schema: [],
Expand Down
3 changes: 1 addition & 2 deletions lib/rules/valid-message-syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
Loading