Skip to content

feat(code-eslint): enable cache strategy

Sign in for the full log view
GitHub Actions / Lint failed Dec 20, 2024

Errors 203, Warnings 6

Found 203 errors and 6 warnings

Annotations

Check failure on line 58 in code/code-format/src/formatter.ts

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 warning on line 54 in code/code-pack/src/pack.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  51 |   await xfs.writeFilePromise(descriptorPath, stringify(descriptor))
  52 |
> 53 |   console.debug('project.toml', readFileSync(descriptorPath, 'utf8'))
     |   ^
  54 |
  55 |   const args = [
  56 |     'build',

Check failure on line 54 in code/code-pack/src/pack.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(n/no-sync): Unexpected sync method: 'readFileSync'.

Unexpected sync method: 'readFileSync'.
Raw output
  51 |   await xfs.writeFilePromise(descriptorPath, stringify(descriptor))
  52 |
> 53 |   console.debug('project.toml', readFileSync(descriptorPath, 'utf8'))
     |                                 ^
  54 |
  55 |   const args = [
  56 |     'build',

Check warning on line 82 in code/code-pack/src/pack.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  79 |   }
  80 |
> 81 |   console.debug(`Packing with args:`, args)
     |   ^
  82 |
  83 |   // TODO: check and install pack
  84 |

Check failure on line 16 in code/code-pack/src/tag.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-non-null-assertion): Forbidden non-null assertion.

Forbidden non-null assertion.
Raw output
  13 |     (event.after as string) ||
  14 |     (event.pull_request?.head?.sha as string) ||
> 15 |     process.env.GITHUB_SHA!
     |     ^
  16 |   )
  17 | }
  18 |

Check failure on line 57 in code/code-pack/src/tag.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-deprecated): `substr` is deprecated. A legacy feature for browser compatibility

`substr` is deprecated. A legacy feature for browser compatibility
Raw output
  54 | export const getTag = async (tagPolicy: TagPolicy): Promise<string> => {
  55 |   const revision = await getRevision()
> 56 |   const hash = revision.substr(0, 7)
     |                         ^
  57 |
  58 |   if (tagPolicy === 'hash-timestamp') {
  59 |     return `${hash}-${Date.now()}`

Check failure on line 16 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions 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
  13 | import { SchematicMissingFieldsException }         from '@angular-devkit/schematics/tools'
  14 | import { NodePackageDoesNotSupportSchematics }     from '@angular-devkit/schematics/tools'
> 15 | // @ts-expect-error any
     | ^
  16 | import { readJsonFile }                            from '@angular-devkit/schematics/tools/file-system-utility'
  17 |
  18 | // TODO: refactor

Check warning on line 55 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(security/detect-non-literal-require): Found non-literal argument in require

Found non-literal argument in require
Raw output
  52 |       const packageJsonPath = require.resolve(join(name, 'package.json'), resolveOptions)
  53 |
> 54 |       const { schematics } = require(packageJsonPath)
     |                              ^
  55 |
  56 |       if (!schematics || typeof schematics !== 'string') {
  57 |         throw new NodePackageDoesNotSupportSchematics(name)

Check failure on line 55 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-require-imports): A `require()` style import is forbidden.

A `require()` style import is forbidden.
Raw output
  52 |       const packageJsonPath = require.resolve(join(name, 'package.json'), resolveOptions)
  53 |
> 54 |       const { schematics } = require(packageJsonPath)
     |                              ^
  55 |
  56 |       if (!schematics || typeof schematics !== 'string') {
  57 |         throw new NodePackageDoesNotSupportSchematics(name)

Check failure on line 55 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-var-requires): Require statement not part of import statement.

Require statement not part of import statement.
Raw output
  52 |       const packageJsonPath = require.resolve(join(name, 'package.json'), resolveOptions)
  53 |
> 54 |       const { schematics } = require(packageJsonPath)
     |                              ^
  55 |
  56 |       if (!schematics || typeof schematics !== 'string') {
  57 |         throw new NodePackageDoesNotSupportSchematics(name)

Check failure on line 62 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
  59 |
  60 |       collectionPath = this.resolve(schematics, packageJsonPath, references)
> 61 |     } catch (e: any) {
     |                 ^
  62 |       if (e.code !== 'MODULE_NOT_FOUND') {
  63 |         throw e
  64 |       }

Check failure on line 71 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
  68 |       try {
  69 |         collectionPath = require.resolve(name, resolveOptions)
> 70 |       } catch (e: any) {
     |                   ^
  71 |         if (e.code !== 'MODULE_NOT_FOUND') {
  72 |           throw e
  73 |         }

Check failure on line 86 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/member-ordering): Member _resolveCollectionPath should be declared before all private instance method definitions.

Member _resolveCollectionPath should be declared before all private instance method definitions.
Raw output
  83 |
  84 |   // eslint-disable-next-line no-underscore-dangle
> 85 |   protected _resolveCollectionPath(name: string, requester?: string): string {
     |   ^
  86 |     const collectionPath = this.resolve(name, requester)
  87 |     readJsonFile(collectionPath)
  88 |

Check failure on line 88 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `error` type typed value.

Unsafe call of a(n) `error` type typed value.
Raw output
  85 |   protected _resolveCollectionPath(name: string, requester?: string): string {
  86 |     const collectionPath = this.resolve(name, requester)
> 87 |     readJsonFile(collectionPath)
     |     ^
  88 |
  89 |     return collectionPath
  90 |   }

Check failure on line 94 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/member-ordering): Member _resolveReferenceString should be declared before all private instance method definitions.

Member _resolveReferenceString should be declared before all private instance method definitions.
Raw output
  91 |
  92 |   // eslint-disable-next-line no-underscore-dangle
> 93 |   protected _resolveReferenceString(refString: string, parentPath: string) {
     |   ^
  94 |     const ref = new ExportStringRef<RuleFactory<{}>>(refString, parentPath)
  95 |     if (!ref.ref) {
  96 |       return null

Check failure on line 94 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  91 |
  92 |   // eslint-disable-next-line no-underscore-dangle
> 93 |   protected _resolveReferenceString(refString: string, parentPath: string) {
     |   ^
  94 |     const ref = new ExportStringRef<RuleFactory<{}>>(refString, parentPath)
  95 |     if (!ref.ref) {
  96 |       return null

Check failure on line 94 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-module-boundary-types): Missing return type on function.

Missing return type on function.
Raw output
  91 |
  92 |   // eslint-disable-next-line no-underscore-dangle
> 93 |   protected _resolveReferenceString(refString: string, parentPath: string) {
     |   ^
  94 |     const ref = new ExportStringRef<RuleFactory<{}>>(refString, parentPath)
  95 |     if (!ref.ref) {
  96 |       return null

Check failure on line 104 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/member-ordering): Member _transformCollectionDescription should be declared before all private instance method definitions.

Member _transformCollectionDescription should be declared before all private instance method definitions.
Raw output
  101 |
  102 |   // eslint-disable-next-line no-underscore-dangle
> 103 |   protected _transformCollectionDescription(
      |   ^
  104 |     name: string,
  105 |     desc: Partial<FileSystemCollectionDesc>
  106 |   ): FileSystemCollectionDesc {

Check failure on line 119 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/member-ordering): Member _transformSchematicDescription should be declared before all private instance method definitions.

Member _transformSchematicDescription should be declared before all private instance method definitions.
Raw output
  116 |
  117 |   // eslint-disable-next-line no-underscore-dangle
> 118 |   protected _transformSchematicDescription(
      |   ^
  119 |     name: string,
  120 |     _collection: FileSystemCollectionDesc,
  121 |     desc: Partial<FileSystemSchematicDesc>

Check failure on line 26 in code/code-schematics/src/schematics.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  23 |   ) {}
  24 |
> 25 |   async init(schematic: string, options = {}) {
     |   ^
  26 |     const host = new virtualFs.ScopedHost(new NodeJsSyncHost(), this.cwd as Path)
  27 |
  28 |     // @ts-expect-error any

Check failure on line 26 in code/code-schematics/src/schematics.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-module-boundary-types): Missing return type on function.

Missing return type on function.
Raw output
  23 |   ) {}
  24 |
> 25 |   async init(schematic: string, options = {}) {
     |   ^
  26 |     const host = new virtualFs.ScopedHost(new NodeJsSyncHost(), this.cwd as Path)
  27 |
  28 |     // @ts-expect-error any