Skip to content

Commit

Permalink
rename plugin fully :( v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lee committed Jan 30, 2023
1 parent 94f8e91 commit aeba951
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/.vuepress/components/eslint-code-block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export default {
const linter = (this.linter = new Linter({ cwd: '/path' }))
for (const ruleId of Object.keys(rules)) {
linter.defineRule(`@intlify/vue-i18n/${ruleId}`, rules[ruleId])
linter.defineRule(`vue-i18n-ex/${ruleId}`, rules[ruleId])
}
linter.defineParser('vue-eslint-parser', vueESLintParser)
linter.defineParser('jsonc-eslint-parser', jsoncESLintParser)
Expand Down
2 changes: 1 addition & 1 deletion lib/configs/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export = {
parser: require.resolve('vue-eslint-parser'),
plugins: ['@intlify/vue-i18n'],
plugins: ['vue-i18n-ex'],
overrides: [
{
files: ['*.json', '*.json5'],
Expand Down
8 changes: 4 additions & 4 deletions lib/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export = {
es6: true
},
rules: {
'@intlify/vue-i18n/no-html-messages': 'warn',
'@intlify/vue-i18n/no-missing-keys': 'warn',
'@intlify/vue-i18n/no-raw-text': 'warn',
'@intlify/vue-i18n/no-v-html': 'warn'
'vue-i18n-ex/no-html-messages': 'warn',
'vue-i18n-ex/no-missing-keys': 'warn',
'vue-i18n-ex/no-raw-text': 'warn',
'vue-i18n-ex/no-v-html': 'warn'
}
}
2 changes: 1 addition & 1 deletion lib/utils/collect-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function collectKeyResourcesFromFiles(fileNames: string[], cwd: string) {
debug('collectKeysFromFiles', fileNames)

const configArrayFactory = new CascadingConfigArrayFactory({
additionalPluginPool: new Map([['@intlify/vue-i18n', require('../index')]]),
additionalPluginPool: new Map([['vue-i18n-ex', require('../index')]]),
cwd,
getEslintRecommendedConfig() {
return require('../../files/empty.json')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-vue-i18n-ex",
"description": "ESLint plugin for Vue I18n - fork from v2.0.0 of @intify/eslint-plugin-vue-i18n",
"version": "2.0.2",
"version": "2.0.3",
"author": {
"name": "kazuya kawaguchi",
"email": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const rules: RuleInfo[] = readdirSync(resolve(__dirname, '../../lib/rules'))
// eslint-disable-next-line @typescript-eslint/no-var-requires
const meta = require(`../../lib/rules/${name}`).meta
return {
id: `@intlify/vue-i18n/${name}`,
id: `vue-i18n-ex/${name}`,
name,
category: String(meta.docs.category),
description: String(meta.docs.description),
Expand Down
8 changes: 4 additions & 4 deletions scripts/new-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ tester.run("${ruleId}", rule as never, {
fs.writeFileSync(
docFile,
`---
title: '@intlify/vue-i18n/${ruleId}'
title: 'vue-i18n-ex/${ruleId}'
description: description
---
# @intlify/vue-i18n/${ruleId}
# vue-i18n-ex/${ruleId}
> description
Expand All @@ -103,7 +103,7 @@ This rule reports ???.
\`\`\`vue
<script>
/* eslint @intlify/vue-i18n/${ruleId}: "error" */
/* eslint vue-i18n-ex/${ruleId}: "error" */
</script>
<!-- ✓ GOOD -->
Expand All @@ -119,7 +119,7 @@ This rule reports ???.
\`\`\`json
{
"@intlify/vue-i18n/${ruleId}": ["error", {
"vue-i18n-ex/${ruleId}": ["error", {
}]
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-docs-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function toTableRow(rule: RuleInfo) {
const mark = `${rule.recommended ? ':star:' : ''}${
rule.fixable ? ':black_nib:' : ''
}`
const link = `[@intlify/vue-i18n/<wbr>${rule.name}](./${rule.name}.html)`
const link = `[vue-i18n-ex/<wbr>${rule.name}](./${rule.name}.html)`
const description = rule.description || '(no description)'
return `| ${link} | ${description} | ${mark} |`
}
Expand All @@ -42,7 +42,7 @@ ${rules.map(toTableRow).join('\n')}
const filePath = resolve(__dirname, '../docs/rules/README.md')
const content = `# Available Rules
- :star: mark: the rule which is enabled by \`plugin:@intlify/vue-i18n/recommended\` preset.
- :star: mark: the rule which is enabled by \`plugin:vue-i18n-ex/recommended\` preset.
- :black_nib: mark: the rule which is fixable by \`eslint --fix\` command.
${withCategories.map(toCategorySection).join('\n')}
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-rule-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function updateRuleDocs({
}
} else if (rule.recommended) {
headerLines.push(
'- :star: The `"extends": "plugin:@intlify/vue-i18n/recommended"` property in a configuration file enables this rule.'
'- :star: The `"extends": "plugin:vue-i18n-ex/recommended"` property in a configuration file enables this rule.'
)
}

Expand Down
9 changes: 3 additions & 6 deletions tests-integrations/config-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = require('assert')

const TEST_CWD = path.join(__dirname, 'config-recommended')

describe('Integration with "plugin:@intlify/vue-i18n/recommended"', () => {
describe('Integration with "plugin:vue-i18n-ex/recommended"', () => {
let originalCwd

before(() => {
Expand All @@ -29,13 +29,10 @@ describe('Integration with "plugin:@intlify/vue-i18n/recommended"', () => {
assert.strictEqual(enJson.messages.length, 1)
assert.strictEqual(
enJson.messages[0].ruleId,
'@intlify/vue-i18n/no-html-messages'
'vue-i18n-ex/no-html-messages'
)
const aVue = results.find(r => path.basename(r.filePath) === 'a.vue')
assert.strictEqual(aVue.messages.length, 1)
assert.strictEqual(
aVue.messages[0].ruleId,
'@intlify/vue-i18n/no-missing-keys'
)
assert.strictEqual(aVue.messages[0].ruleId, 'vue-i18n-ex/no-missing-keys')
})
})
2 changes: 1 addition & 1 deletion tests-integrations/config-recommended/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
root: true,
extends: ['plugin:vue/recommended', 'plugin:@intlify/vue-i18n/recommended'],
extends: ['plugin:vue/recommended', 'plugin:vue-i18n-ex/recommended'],
rules: {
'vue/multi-word-component-names': 'off'
},
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/no-unused-keys/invalid/typescript/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
root: true,
extends: ['plugin:@intlify/vue-i18n/base'],
extends: ['plugin:vue-i18n-ex/base'],
parserOptions: {
parser: '@typescript-eslint/parser'
},
rules: {
'@intlify/vue-i18n/no-unused-keys': ["error", {
'vue-i18n-ex/no-unused-keys': ["error", {
"src": "./src",
"extensions": [".tsx", ".ts", ".vue"],
"enableFix": true,
Expand All @@ -22,11 +22,11 @@ module.exports = {
overrides: [
{
files: ['*.json', '*.json5'],
extends: ['plugin:@intlify/vue-i18n/base'],
extends: ['plugin:vue-i18n-ex/base'],
},
{
files: ['*.yaml', '*.yml'],
extends: ['plugin:@intlify/vue-i18n/base'],
extends: ['plugin:vue-i18n-ex/base'],
}
]
}

0 comments on commit aeba951

Please sign in to comment.