Skip to content

Commit

Permalink
fix: crlf to lf
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidKk committed Feb 21, 2024
1 parent 3fcf139 commit 0a50591
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
17 changes: 10 additions & 7 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
/** @type {import('prettier').Config} */
module.exports = {
/** 一行的字符数, 如果超过会进行换行 */
/** Compatible with Windows */
endOfLine: 'lf',
/** The number of characters per line. If exceeded, a newline will be inserted. */
printWidth: 180,
/** 一个tab代表几个空格数 */
/** The number of spaces per tab. */
tabWidth: 2,
/** 是否使用tab进行缩进 */
/** Whether to use tabs for indentation. */
useTabs: false,
/** 字符串是否使用单引号 */
/** Whether to use single quotes for strings. */
singleQuote: true,
/** 行位是否使用分号 */
/** Whether to use semicolons at the end of lines. */
semi: false,
/** 是否使用尾逗号 */
/** Whether to use trailing commas. */
trailingComma: 'es5',
/** 对象大括号直接是否有空格 */
/** Whether to have spaces inside object braces. */
bracketSpacing: true,
}
3 changes: 2 additions & 1 deletion @cli/tidy-cli/src/actions/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export const tidyDeps = async (options?: TidyDepsOptions) => {
*/

if (missDependencies || missDevDependencies) {
await fs.writeFile(pkgJson, JSON.stringify(source, null, 2))
const content = JSON.stringify(source, null, 2)
await fs.writeFile(pkgJson, content)
}

if (missDependencies) {
Expand Down
6 changes: 5 additions & 1 deletion @feature/feature-readme/src/helper/dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path'

Check warning on line 1 in @feature/feature-readme/src/helper/dependencies.ts

View check run for this annotation

Codecov / codecov/patch

@feature/feature-readme/src/helper/dependencies.ts#L1

Added line #L1 was not covered by tests
import { mapPathsToOrbitTree, stringifyOrbitTree } from '@dumlj/util-lib'
import type { Context, TreeProject } from '../types'

Expand Down Expand Up @@ -49,7 +50,10 @@ export function dependencies(context: Context) {
}

const { location, isPrivate } = project
const contentHTML = `<a is="dumlj-link" data-project="${encodeURI(JSON.stringify(project))}" ${url ? `href="${url}/tree/main/${location}"` : ''}>${name}</a>`
const posixLocation = location.split(path.sep).join('/')
const projectString = encodeURI(JSON.stringify({ ...project, location: posixLocation }))

Check warning on line 54 in @feature/feature-readme/src/helper/dependencies.ts

View check run for this annotation

Codecov / codecov/patch

@feature/feature-readme/src/helper/dependencies.ts#L52-L54

Added lines #L52 - L54 were not covered by tests
const hrefAttr = url ? `href="${url}/tree/main/${posixLocation}"` : ''
const contentHTML = `<a is="dumlj-link" data-project="${projectString}" ${hrefAttr}>${name}</a>`

Check warning on line 56 in @feature/feature-readme/src/helper/dependencies.ts

View check run for this annotation

Codecov / codecov/patch

@feature/feature-readme/src/helper/dependencies.ts#L56

Added line #L56 was not covered by tests
const extraHTML = isPrivate ? '<sup><small><i>PRIVATE</i></small></sup>' : ''
return `${orbit} ${contentHTML}${extraHTML}`
})
Expand Down
4 changes: 3 additions & 1 deletion @lib/util-lib/__tests__/finder/findWorkspaceProject.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ describe('finder/findWorkspaceProject', () => {
pattern: ['packages/*'],
cwd: '',
})
).rejects.toThrow(`The project name package-a is duplicated in the workspace.\n - ${path.join('packages/package-b/package.json')}\n - ${path.join('packages/package-a/package.json')}`)
).rejects.toThrow(
`The project name package-a is duplicated in the workspace.\n - ${path.join('packages/package-b/package.json')}\n - ${path.join('packages/package-a/package.json')}`
)
})
})
8 changes: 5 additions & 3 deletions @webpack-plugin/cdn-upload-webpack-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ export class CdnUploadWebpackPlugin extends SeedWebpackPlugin {
compiler.hooks.thisCompilation.tap(this.pluginName, (compilation) => {
compilation.hooks.afterProcessAssets.tap(this.pluginName, (compilationAssets) => {
const entries = Object.entries(compilationAssets)
const assets = !Array.isArray(this.exclude) ? entries : entries.filter(([filePath]) => {
return !micromatch.isMatch(filePath, this.exclude!, { dot: true })
})
const assets = !Array.isArray(this.exclude)
? entries
: entries.filter(([filePath]) => {
return !micromatch.isMatch(filePath, this.exclude!, { dot: true })
})

if (!clients.length) {
if (this.verbose) {
Expand Down

0 comments on commit 0a50591

Please sign in to comment.