Skip to content

Commit

Permalink
chore: use lodash kebaCase instead of decamelize
Browse files Browse the repository at this point in the history
  • Loading branch information
kagawagao committed Nov 3, 2021
1 parent 03b5aba commit ae6b87f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
19 changes: 0 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -81,7 +81,6 @@
"canvas": "^2.6.1",
"conventional-changelog-cli": "^2.1.0",
"cross-env": "^7.0.2",
"decamelize": "^6.0.0",
"diff-run": "^1.0.4",
"eslint": "^8.0.0",
"eslint-config-prettier": "^8.0.0",
Expand Down
13 changes: 3 additions & 10 deletions scripts/sync.ts
Expand Up @@ -3,7 +3,7 @@ import path from 'path'
import fs from 'fs'
import { promisify } from 'util'
import { ESLint } from 'eslint'
import decamelize from 'decamelize'
import { kebabCase } from 'lodash'
import eslintConfig from '../.eslintrc.js'

const mkdir = promisify(fs.mkdir)
Expand All @@ -29,12 +29,7 @@ Object.entries(g2plot).forEach(([chartName, module]: [string, any]) => {
if (module.prototype instanceof Plot && chartName !== 'P') {
if (
!fs.existsSync(
path.resolve(
plotDir,
`${decamelize(chartName, {
separator: '-',
})}/index.tsx`
)
path.resolve(plotDir, `${kebabCase(chartName)}/index.tsx`)
)
) {
newCharts.push(chartName)
Expand All @@ -56,9 +51,7 @@ const lintAndFixFileContent = async (fileContent: string, filePath: string) => {
const getChartConfig = (chart: string) => {
return {
cmpName: `${chart}Chart`,
cmpPath: decamelize(chart, {
separator: '-',
}),
cmpPath: kebabCase(chart),
}
}

Expand Down

1 comment on commit ae6b87f

@vercel
Copy link

@vercel vercel bot commented on ae6b87f Nov 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.