Skip to content

feat: fragments generator #88

feat: fragments generator

feat: fragments generator #88

GitHub Actions / Lint failed Dec 10, 2024 in 0s

Errors 11, Warnings 0

Found 11 errors and 0 warnings

Annotations

Check failure on line 2 in fragments/fragments-cli/src/index.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'createInterface' is defined but never used.

'createInterface' is defined but never used.
Raw output
> 1 | import { createInterface } from 'node:readline'
    |          ^
  2 |
  3 | import logger              from 'npmlog'
  4 | import { program }         from 'commander'

Check failure on line 42 in fragments/fragments-cli/src/index.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(dot-notation): ["FIGMA_TOKEN"] is better written in dot notation.

["FIGMA_TOKEN"] is better written in dot notation.
Raw output
  39 |   // })
  40 |
> 41 |   process.env['FIGMA_TOKEN'] = 'secret'
     |               ^
  42 |
  43 |   run(fileId, options.nodeId, options.output, options.theme)
  44 |     .then(() => logger.info('info', 'Fragments successful generated'))

Check failure on line 20 in utils/file/src/process-file.util.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(prefer-destructuring): Use object destructuring.

Use object destructuring.
Raw output
  17 |
  18 |   const module = { exports: {} }
> 19 |   const exports = module.exports
     |         ^
  20 |   const require = (modulePath: string): any => {
  21 |     const absolutePath = path.resolve(path.dirname(filePath), modulePath)
  22 |     return processFile(absolutePath)

Check failure on line 20 in utils/file/src/process-file.util.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'exports' is assigned a value but never used.

'exports' is assigned a value but never used.
Raw output
  17 |
  18 |   const module = { exports: {} }
> 19 |   const exports = module.exports
     |         ^
  20 |   const require = (modulePath: string): any => {
  21 |     const absolutePath = path.resolve(path.dirname(filePath), modulePath)
  22 |     return processFile(absolutePath)

Check failure on line 21 in utils/file/src/process-file.util.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'require' is assigned a value but never used.

'require' is assigned a value but never used.
Raw output
  18 |   const module = { exports: {} }
  19 |   const exports = module.exports
> 20 |   const require = (modulePath: string): any => {
     |         ^
  21 |     const absolutePath = path.resolve(path.dirname(filePath), modulePath)
  22 |     return processFile(absolutePath)
  23 |   }

Check failure on line 26 in utils/file/src/process-file.util.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(security/detect-eval-with-expression): Definition for rule 'security/detect-eval-with-expression' was not found.

Definition for rule 'security/detect-eval-with-expression' was not found.
Raw output
  23 |   }
  24 |
> 25 |   // eslint-disable-next-line no-eval, security/detect-eval-with-expression
     |   ^
  26 |   eval(`
  27 |     (function(exports, module, require) {
  28 |       ${code}

Check failure on line 8 in fragments/fragments-generator/src/strategy/create-box.strategy.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-useless-constructor): Useless constructor.

Useless constructor.
Raw output
   5 |
   6 | export class CreateBoxStrategy extends ThemeMappingStrategy {
>  7 |   constructor(theme: Record<string, Record<string, string>>) {
     |   ^
   8 |     super(theme)
   9 |   }
  10 |

Check failure on line 24 in fragments/fragments-generator/src/strategy/create-fragment.strategy.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(lines-between-class-members): Expected blank line between class members.

Expected blank line between class members.
Raw output
  21 |
  22 |   private text: CreateTextStrategy
> 23 |   private box: CreateBoxStrategy
     |   ^
  24 |
  25 |   constructor(theme: Record<string, Record<string, string>>) {
  26 |     this.text = new CreateTextStrategy(theme)

Check failure on line 84 in fragments/fragments-generator/src/strategy/create-fragment.strategy.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-shadow): 'node' is already declared in the upper scope on line 67 column 18.

'node' is already declared in the upper scope on line 67 column 18.
Raw output
  81 |         this.elements[node.id] = {
  82 |           element: this.box.createElement(node),
> 83 |           childrenIds: node?.children.map((node) => node.id) || [],
     |                                            ^
  84 |           parentId: this.findParentId(node.id),
  85 |         }
  86 |       }

Check failure on line 14 in fragments/fragments-generator/src/strategy/create-text.strategy.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-useless-constructor): Useless constructor.

Useless constructor.
Raw output
  11 |
  12 | export class CreateTextStrategy extends ThemeMappingStrategy {
> 13 |   constructor(theme: Record<string, Record<string, string>>) {
     |   ^
  14 |     super(theme)
  15 |   }
  16 |

Check failure on line 27 in fragments/fragments-generator/src/strategy/theme-mapping.strategy.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(consistent-return): Method 'getValueKeyFromTheme' expected no return value.

Method 'getValueKeyFromTheme' expected no return value.
Raw output
  24 |     })?.[0]
  25 |
> 26 |     return valueKey ? `${THEME_KEY_PREFIX}${valueKey}` : undefined
     |     ^
  27 |   }
  28 | }
  29 |