Skip to content

Commit

Permalink
chore: fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jan 16, 2024
1 parent a311f0e commit 77687dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": [
"@changesets/changelog-github",
{
"repo": "@intlify/eslint-plugin-svelte"
"repo": "intlify/eslint-plugin-svelte"
}
],
"commit": false,
Expand Down
2 changes: 1 addition & 1 deletion .changeset/moody-adults-camp.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@intlify/eslint-plugin-svelte": minor
'@intlify/eslint-plugin-svelte': minor
---

Apply rule against root-level strings
16 changes: 3 additions & 13 deletions scripts/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
*/
import { readdirSync, existsSync } from 'fs'
import { basename, extname, join } from 'path'
import { CLIEngine } from 'eslint'
const linter = new CLIEngine({ fix: true })

function format(text: string, filename: string): string {
const lintResult = linter.executeOnText(text, filename)
return lintResult.results[0].output || text
}

/**
* Convert text to camelCase
Expand All @@ -28,8 +21,7 @@ function createIndex(dirPath: string, prefix = '', all = false): string {
file.endsWith('.ts') || existsSync(join(dirPath, file, 'index.ts'))
)
.map(file => basename(file, extname(file)))
return format(
`/** DON'T EDIT THIS FILE; was created by scripts. */
return `/** DON'T EDIT THIS FILE; was created by scripts. */
${tsFiles
.map(
id =>
Expand All @@ -40,9 +32,7 @@ ${tsFiles
export = {
${tsFiles.map(id => `'${prefix}${id}': ${camelCase(id)},`).join('\n ')}
}
`,
'input.ts'
)
`
}

export { createIndex, format }
export { createIndex }
8 changes: 2 additions & 6 deletions scripts/update-recommended-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
*/
import { resolve } from 'path'
import rules from './lib/rules'
import { format } from './lib/utils'
import { writeAndFormat } from './lib/write'

// recommended.ts
writeAndFormat(
resolve(__dirname, '../lib/configs/recommended.ts'),
format(
`/** DON'T EDIT THIS FILE; was created by scripts. */
`/** DON'T EDIT THIS FILE; was created by scripts. */
export = {
extends: [require.resolve('./base')],
parserOptions: {
Expand All @@ -32,7 +30,5 @@ export = {
.map(rule => `'${rule.id}': 'warn',`)
.join('\n ')}
},
}`,
resolve(__dirname, '../lib/configs/recommended.ts')
)
}`
)

0 comments on commit 77687dc

Please sign in to comment.