fix/github pack #120
Errors 1001, Warnings 8
Found 1001 errors and 8 warnings
Annotations
Check failure on line 14 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
11 | const TARGET_DIR = path.join(__dirname, 'src')
12 |
> 13 | const replaceElement = (code: string) => code.replace('<svg', '<Icon').replace('</svg', '</Icon')
| ^
14 |
15 | // @ts-expect-error types
16 | const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
Check failure on line 17 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
14 |
15 | // @ts-expect-error types
> 16 | const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
| ^
17 | const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
18 |
19 | return typeScriptTpl.ast`
Check failure on line 18 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-call): Unsafe call of an `any` typed value.
Unsafe call of an `any` typed value.
Raw output
15 | // @ts-expect-error types
16 | const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
> 17 | const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
| ^
18 |
19 | return typeScriptTpl.ast`
20 | import React from 'react'
Check failure on line 20 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-return): Unsafe return of an `any` typed value.
Unsafe return of an `any` typed value.
Raw output
17 | const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
18 |
> 19 | return typeScriptTpl.ast`
| ^
20 | import React from 'react'
21 |
22 | import { Icon, IconProps } from '@atls-ui-admin/icon'
Check failure on line 20 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-call): Unsafe any typed template tag.
Unsafe any typed template tag.
Raw output
17 | const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
18 |
> 19 | return typeScriptTpl.ast`
| ^
20 | import React from 'react'
21 |
22 | import { Icon, IconProps } from '@atls-ui-admin/icon'
Check failure on line 29 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
26 | }
27 |
> 28 | const read = (files: Array<string>) =>
| ^
29 | Promise.all(
30 | files.map(async (iconPath) => ({
31 | name: `${camelcase(path.basename(iconPath, path.extname(iconPath)), {
Check failure on line 29 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/promise-function-async): Functions that return promises must be async.
Functions that return promises must be async.
Raw output
26 | }
27 |
> 28 | const read = (files: Array<string>) =>
| ^
29 | Promise.all(
30 | files.map(async (iconPath) => ({
31 | name: `${camelcase(path.basename(iconPath, path.extname(iconPath)), {
Check failure on line 40 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
37 | )
38 |
> 39 | const compile = (icons: Array<{ filename: string, name: string, source: string }>) =>
| ^
40 | Promise.all(
41 | icons.map(async (icon) => ({
42 | filename: icon.filename,
Check failure on line 40 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/promise-function-async): Functions that return promises must be async.
Functions that return promises must be async.
Raw output
37 | )
38 |
> 39 | const compile = (icons: Array<{ filename: string, name: string, source: string }>) =>
| ^
40 | Promise.all(
41 | icons.map(async (icon) => ({
42 | filename: icon.filename,
Check failure on line 45 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-call): Unsafe call of an `any` typed value.
Unsafe call of an `any` typed value.
Raw output
42 | filename: icon.filename,
43 | name: icon.name,
> 44 | code: await svgr(
| ^
45 | icon.source.replace(/mask0/g, icon.name),
46 | {
47 | icon: true,
Check failure on line 57 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
54 | )
55 |
> 56 | const save = async (sources: Array<{ filename: string, code: string }>) =>
| ^
57 | Promise.all(
58 | sources.map((source) =>
59 | fs.writeFileAsync(
Check failure on line 78 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
75 | )
76 |
> 77 | const createIndex = (sources: Array<{ filename: string }>) =>
| ^
78 | fs.writeFileAsync(
79 | path.join(TARGET_DIR, 'index.ts'),
80 | sources.map((source) => `export * from './${source.filename}'`).join('\n')
Check failure on line 84 in ui-admin/icons/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
81 | )
82 |
> 83 | const build = async () => {
| ^
84 | const files = await glob('./icons/*.svg')
85 | const icons = await read(files)
86 |
Check failure on line 17 in generators/button/src/generator.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.
Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
14 | assert.ok(options.theme, 'Theme colors path is required')
15 |
> 16 | const colorsFile = readFileSync(join(process.cwd(), options.theme)).toString('utf-8')
| ^
17 | const { code } = transform(colorsFile, { presets: ['env'] })
18 |
19 | if (!code) throw Error('Could not read the file')
Check warning on line 23 in generators/button/src/generator.ts
github-actions / Lint
(security/detect-eval-with-expression): eval with argument of type Identifier
eval with argument of type Identifier
Raw output
20 |
21 | // eslint-disable-next-line no-eval
> 22 | const colors = eval(code)
| ^
23 |
24 | const generator = new ButtonAppearanceStyleGenerator(colors)
25 |
Check failure on line 25 in generators/button/src/generator.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `ButtonColorSchemes`.
Unsafe argument of type `any` assigned to a parameter of type `ButtonColorSchemes`.
Raw output
22 | const colors = eval(code)
23 |
> 24 | const generator = new ButtonAppearanceStyleGenerator(colors)
| ^
25 |
26 | const genPath = join(process.cwd(), path)
27 | generator.generateFile(genPath)
Check failure on line 27 in generators/button/src/generator.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.
Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
24 | const generator = new ButtonAppearanceStyleGenerator(colors)
25 |
> 26 | const genPath = join(process.cwd(), path)
| ^
27 | generator.generateFile(genPath)
28 |
29 | // eslint-disable-next-line no-console
Check failure on line 21 in generators/icons/src/generator.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.
Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
18 | assert.ok(options.icons, 'Icons dir path is required')
19 |
> 20 | const iconsPath = join(process.cwd(), options.icons)
| ^
21 | const genPath = join(process.cwd(), path)
22 |
23 | if (!existsSync(genPath)) {
Check failure on line 22 in generators/icons/src/generator.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.
Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
19 |
20 | const iconsPath = join(process.cwd(), options.icons)
> 21 | const genPath = join(process.cwd(), path)
| ^
22 |
23 | if (!existsSync(genPath)) {
24 | mkdirSync(genPath)
Check failure on line 34 in generators/icons/src/generator.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.
Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
31 |
32 | if (options.replacements) {
> 33 | const replacementsFile = readFileSync(join(process.cwd(), options.replacements)).toString(
| ^
34 | 'utf-8'
35 | )
36 | const { code } = transform(replacementsFile, { presets: ['env'] })
Check warning on line 42 in generators/icons/src/generator.ts
github-actions / Lint
(security/detect-eval-with-expression): eval with argument of type Identifier
eval with argument of type Identifier
Raw output
39 |
40 | // eslint-disable-next-line no-eval
> 41 | replacements = eval(code)
| ^
42 | }
43 |
44 | await build(iconsPath, genPath, replacements)
Check failure on line 7 in generators/icons/src/get-color-replacement.util.ts
github-actions / Lint
(@typescript-eslint/explicit-module-boundary-types): Missing return type on function.
Missing return type on function.
Raw output
4 | }
5 |
> 6 | export const getColorReplacement = (options: GetColorReplacementOptions) => ({
| ^
7 | [options.color]: `{(vars.colors${(options.themePaths || []).reduce(
8 | (str, prop) => `${str}.${prop}`,
9 | ''
Check failure on line 7 in generators/icons/src/get-color-replacement.util.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
4 | }
5 |
> 6 | export const getColorReplacement = (options: GetColorReplacementOptions) => ({
| ^
7 | [options.color]: `{(vars.colors${(options.themePaths || []).reduce(
8 | (str, prop) => `${str}.${prop}`,
9 | ''
Check failure on line 15 in generators/icons/src/svgr.ts
github-actions / Lint
(@typescript-eslint/explicit-function-return-type): Missing return type on function.
Missing return type on function.
Raw output
12 |
13 | // @ts-expect-error types
> 14 | const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
| ^
15 | const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
16 |
17 | return typeScriptTpl.ast`
Check failure on line 16 in generators/icons/src/svgr.ts
github-actions / Lint
(@typescript-eslint/no-unsafe-call): Unsafe call of an `any` typed value.
Unsafe call of an `any` typed value.
Raw output
13 | // @ts-expect-error types
14 | const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
> 15 | const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
| ^
16 |
17 | return typeScriptTpl.ast`
18 | import React from 'react'