feat(code-changelog): init #356
Errors 231, Warnings 11
Found 231 errors and 11 warnings
Annotations
Check warning on line 32 in code/code-changelog/src/changelog.ts
github-actions / Lint
(no-console): Unexpected console statement.
Unexpected console statement.
Raw output
29 | lernaPackage: `${packageName}`,
30 | tagPrefix,
> 31 | debug: debug ? console.debug : undefined,
| ^
32 | preset: 'angular',
33 | append: true,
34 | releaseCount,
Check failure on line 47 in code/code-changelog/src/changelog.ts
github-actions / Lint
(no-return-await): Redundant use of `await` on a return value.
Redundant use of `await` on a return value.
Raw output
44 |
45 | if (file) {
> 46 | return await this.generateToFile(config, path)
| ^
47 | }
48 |
49 | return this.generateToStdOut(config)
Check failure on line 59 in code/code-changelog/src/changelog.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `any` typed value.
Unsafe call of a(n) `any` typed value.
Raw output
56 |
57 | changelogStream.on('data', (record) => {
> 58 | newChangelog += record.toString()
| ^
59 | })
60 |
61 | return newChangelog
Check failure on line 72 in code/code-changelog/src/changelog.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `any` typed value.
Unsafe call of a(n) `any` typed value.
Raw output
69 | const changelogStream = conventionalChangelog(config)
70 | changelogStream.on('data', (record) => {
> 71 | newChangelog += record.toString()
| ^
72 | })
73 |
74 | changelogStream.on('end', () => {
Check failure on line 79 in code/code-changelog/src/changelog.ts
github-actions / Lint
(n/no-sync): Unexpected sync method: 'readFileSync'.
Unexpected sync method: 'readFileSync'.
Raw output
76 |
77 | try {
> 78 | existingData = readFileSync(outFile, 'utf8')
| ^
79 | } catch (error) {
80 | if (error instanceof Error && 'code' in error && error.code !== 'ENOENT') throw error
81 | }
Check failure on line 88 in code/code-changelog/src/changelog.ts
github-actions / Lint
(n/no-sync): Unexpected sync method: 'writeFileSync'.
Unexpected sync method: 'writeFileSync'.
Raw output
85 | updatedData += `\n${existingData}`
86 | }
> 87 | writeFileSync(outFile, updatedData)
| ^
88 | })
89 |
90 | return ''
Check failure on line 6 in code/code-commit/src/commit.linter.ts
github-actions / Lint
(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.
All imports in the declaration are only used as types. Use `import type`.
Raw output
3 |
4 | import { RuleConfigSeverity } from '@commitlint/types'
> 5 | import { LintOutcome } from '@commitlint/types'
| ^
6 | import { QualifiedRules } from '@commitlint/types'
7 | import { format } from '@commitlint/format/lib/format.js'
8 | import commitlint from '@commitlint/lint'
Check failure on line 7 in code/code-commit/src/commit.linter.ts
github-actions / Lint
(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.
All imports in the declaration are only used as types. Use `import type`.
Raw output
4 | import { RuleConfigSeverity } from '@commitlint/types'
5 | import { LintOutcome } from '@commitlint/types'
> 6 | import { QualifiedRules } from '@commitlint/types'
| ^
7 | import { format } from '@commitlint/format/lib/format.js'
8 | import commitlint from '@commitlint/lint'
9 |
Check failure on line 49 in code/code-commit/src/commit.linter.ts
github-actions / Lint
(@typescript-eslint/no-shadow): 'options' is already declared in the upper scope on line 21 column 7.
'options' is already declared in the upper scope on line 21 column 7.
Raw output
46 | format(
47 | report: FormattableReport,
> 48 | options = {
| ^
49 | helpUrl: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
50 | }
51 | ): string {
Check failure on line 59 in code/code-commit/src/commit.linter.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
56 | * Prepares config, including scopes
57 | */
> 58 | private prepareConfig(rules: QualifiedRules) {
| ^
59 | const allowedScopes = []
60 |
61 | if (this.scopes) {
Check failure on line 59 in code/code-commit/src/commit.linter.ts
github-actions / Lint
(@typescript-eslint/no-shadow): 'rules' is already declared in the upper scope on line 10 column 10.
'rules' is already declared in the upper scope on line 10 column 10.
Raw output
56 | * Prepares config, including scopes
57 | */
> 58 | private prepareConfig(rules: QualifiedRules) {
| ^
59 | const allowedScopes = []
60 |
61 | if (this.scopes) {
Check failure on line 71 in code/code-commit/src/commit.linter.ts
github-actions / Lint
(no-param-reassign): Assignment to property of function parameter 'rules'.
Assignment to property of function parameter 'rules'.
Raw output
68 |
69 | const possibleScopeValuesArray = ['common', 'github', ...allowedScopes]
> 70 | rules['scope-enum'] = [RuleConfigSeverity.Error, 'always', possibleScopeValuesArray]
| ^
71 |
72 | return rules
73 | }
Check failure on line 58 in code/code-format/src/formatter.ts
github-actions / Lint
(@typescript-eslint/ban-ts-comment): Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 10 characters or longer.
Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 10 characters or longer.
Raw output
55 | ...config,
56 | filepath: filename,
> 57 | // @ts-expect-error any
| ^
58 | plugins: [estree, yaml, markdown, graphql, babel, typescript, plugin],
59 | })
60 |
Check failure on line 128 in code/code-lint/src/linter.ts
github-actions / Lint
(@typescript-eslint/array-type): Array type using 'ESLint.LintResult[]' is forbidden. Use 'Array<ESLint.LintResult>' instead.
Array type using 'ESLint.LintResult[]' is forbidden. Use 'Array<ESLint.LintResult>' instead.
Raw output
125 | }
126 |
> 127 | private async lintWithCache(files: Array<string> = []): Promise<ESLint.LintResult[]> {
| ^
128 | this.emit('start', { files })
129 |
130 | const results = await this.cacheLinter?.lintFiles(files)
Check failure on line 143 in code/code-lint/src/linter.ts
github-actions / Lint
(n/no-sync): Unexpected sync method: 'readFileSync'.
Unexpected sync method: 'readFileSync'.
Raw output
140 |
141 | private getProjectIgnorePatterns(): Array<string> {
> 142 | const content = readFileSync(join(this.cwd, 'package.json'), 'utf-8')
| ^
143 |
144 | const { linterIgnorePatterns = [] } = JSON.parse(content)
145 |
Check failure on line 147 in code/code-lint/src/linter.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-return): Unsafe return of a value of type `any`.
Unsafe return of a value of type `any`.
Raw output
144 | const { linterIgnorePatterns = [] } = JSON.parse(content)
145 |
> 146 | return linterIgnorePatterns
| ^
147 | }
148 | }
149 |
Check failure on line 4 in code/code-pack/src/index.ts
github-actions / Lint
(@typescript-eslint/consistent-type-exports): All exports in the declaration are only used as types. Use `export type`.
All exports in the declaration are only used as types. Use `export type`.
Raw output
1 | import * as tagUtils from './tag.utils.js'
2 |
> 3 | export * from './pack.interfaces.js'
| ^
4 | export * from './tag.utils.js'
5 | export * from './pack.js'
6 |
Check failure on line 2 in code/code-pack/src/pack.interfaces.ts
github-actions / Lint
(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.
All imports in the declaration are only used as types. Use `import type`.
Raw output
> 1 | import { PortablePath } from '@yarnpkg/fslib'
| ^
2 |
3 | export interface PackOptions {
4 | workspace: string
Check warning on line 74 in code/code-pack/src/pack.ts
github-actions / Lint
(no-console): Unexpected console statement.
Unexpected console statement.
Raw output
71 | await xfs.writeFilePromise(descriptorPath, stringify(descriptor))
72 |
> 73 | console.debug('project.toml', readFileSync(descriptorPath, 'utf8'))
| ^
74 |
75 | const args = [
76 | 'build',
Check failure on line 74 in code/code-pack/src/pack.ts
github-actions / Lint
(n/no-sync): Unexpected sync method: 'readFileSync'.
Unexpected sync method: 'readFileSync'.
Raw output
71 | await xfs.writeFilePromise(descriptorPath, stringify(descriptor))
72 |
> 73 | console.debug('project.toml', readFileSync(descriptorPath, 'utf8'))
| ^
74 |
75 | const args = [
76 | 'build',
Check warning on line 100 in code/code-pack/src/pack.ts
github-actions / Lint
(no-console): Unexpected console statement.
Unexpected console statement.
Raw output
97 | }
98 |
> 99 | console.debug(`Packing with args:`, args)
| ^
100 |
101 | await installPack({ cwd, context })
102 |
Check failure on line 5 in code/code-pack/src/pack.utils.ts
github-actions / Lint
(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.
All imports in the declaration are only used as types. Use `import type`.
Raw output
2 | import { arch } from 'node:os'
3 |
> 4 | import { PortablePath } from '@yarnpkg/fslib'
| ^
5 | import { execUtils } from '@yarnpkg/core'
6 |
7 | interface InstallPackOptions {
Check failure on line 9 in code/code-pack/src/pack.utils.ts
github-actions / Lint
(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.
Unexpected any. Specify a different type.
Raw output
6 |
7 | interface InstallPackOptions {
> 8 | context: any
| ^
9 | cwd?: PortablePath
10 | }
11 |
Check warning on line 37 in code/code-pack/src/pack.utils.ts
github-actions / Lint
(no-console): Unexpected console statement.
Unexpected console statement.
Raw output
34 |
35 | if (!isPackInstalled) {
> 36 | console.log('Buildpack CLI (pack) is not installed. Installing it...')
| ^
37 |
38 | let downloadUrl = 'https://github.com/buildpacks/pack/releases/download/v0.36.1/pack-v0.36.1-'
39 |
Check failure on line 44 in code/code-pack/src/pack.utils.ts
github-actions / Lint
(default-case): Expected a default case.
Expected a default case.
Raw output
41 | const currentArch = arch()
42 |
> 43 | switch (currentPlatform) {
| ^
44 | case 'linux':
45 | downloadUrl += 'linux.tgz'
46 | break