Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linting changes #141

Closed
wants to merge 1 commit into from
Closed

Linting changes #141

wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

This pull request includes linting changes based on the target branch.

Please review and merge if everything looks good.

Additional suggestions: ./tasks.tsconfig.json format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Formatter would have printed the following content:

 1  1 │   {
 2    │ - ··"compilerOptions":·{
 3    │ - ····"strictFunctionTypes":·true,
 4    │ - ····"strictNullChecks":·true,
 5    │ - ····"strictBindCallApply":·true,
 6    │ - ····"esModuleInterop":·true,
 7    │ - ····"resolveJsonModule":·true,
 8    │ - ····"allowJs":·true,
 9    │ - ····"allowSyntheticDefaultImports":·true,
10    │ - ····"allowUnreachableCode":·false,
11    │ - ····"declaration":·true,
12    │ - ····"experimentalDecorators":·true,
13    │ - ····"noErrorTruncation":·true,
14    │ - ····"lib":·[
15    │ - ······"dom",
16    │ - ······"esnext"
17    │ - ····],
18    │ - ····"incremental":·true,
19    │ - ····"outDir":·"bin",
20    │ - ····"moduleResolution":·"node",
21    │ - ····"module":·"commonjs",
22    │ - ····"target":·"esnext",
23    │ - ····"noUnusedLocals":·false,
24    │ - ····"noUnusedParameters":·false
25    │ - ··},
26    │ - ··"include":·[
27    │ - ····"tasks"
28    │ - ··],
29    │ - ··"exclude":·[
30    │ - ····"node_modules"
31    │ - ··]
32    │ - }
    2 │ + → "compilerOptions":·{
    3 │ + → → "strictFunctionTypes":·true,
    4 │ + → → "strictNullChecks":·true,
    5 │ + → → "strictBindCallApply":·true,
    6 │ + → → "esModuleInterop":·true,
    7 │ + → → "resolveJsonModule":·true,
    8 │ + → → "allowJs":·true,
    9 │ + → → "allowSyntheticDefaultImports":·true,
   10 │ + → → "allowUnreachableCode":·false,
   11 │ + → → "declaration":·true,
   12 │ + → → "experimentalDecorators":·true,
   13 │ + → → "noErrorTruncation":·true,
   14 │ + → → "lib":·["dom",·"esnext"],
   15 │ + → → "incremental":·true,
   16 │ + → → "outDir":·"bin",
   17 │ + → → "moduleResolution":·"node",
   18 │ + → → "module":·"commonjs",
   19 │ + → → "target":·"esnext",
   20 │ + → → "noUnusedLocals":·false,
   21 │ + → → "noUnusedParameters":·false
   22 │ + → },
   23 │ + → "include":·["tasks"],
   24 │ + → "exclude":·["node_modules"]
   25 │ + }
   26 │ + 

./tasks.tsconfig.json check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× The file contains diagnostics that needs to be addressed.

./.vscode/settings.json:7:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Expected a property but instead found '}'.

5 │     "package.json": "README.md,.gitignore, tsconfig.json, rome.json, *.tsconfig.json, LICENSE.md, package-lock.json, jest-puppeteer.config.js, michi.config.ts",
6 │     "*.tsx": "$(capture).css, $(capture).css.ts, $(capture).html, $(capture).spec.ts, $(capture).spec.tsx",

7 │ }
│ ^
8 │ }
9 │

i Expected a property here.

5 │     "package.json": "README.md,.gitignore, tsconfig.json, rome.json, *.tsconfig.json, LICENSE.md, package-lock.json, jest-puppeteer.config.js, michi.config.ts",
6 │     "*.tsx": "$(capture).css, $(capture).css.ts, $(capture).html, $(capture).spec.ts, $(capture).spec.tsx",

7 │ }
│ ^
8 │ }
9 │

./.vscode/settings.json lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× The file contains diagnostics that needs to be addressed.

./.vscode/settings.json format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Format with errors is disabled.

./.vscode/settings.json check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× The file contains diagnostics that needs to be addressed.

./.vscode/tasks.json:12:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Expected a property but instead found '}'.

10 │                 "isDefault": true
11 │             },

12 │ },
│ ^
13 │ {
14 │ "label": "dist",

i Expected a property here.

10 │                 "isDefault": true
11 │             },

12 │ },
│ ^
13 │ {
14 │ "label": "dist",

./.vscode/tasks.json:21:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Expected a property but instead found '}'.

19 │                 "isDefault": true
20 │             },

21 │ },
│ ^
22 │ ]
23 │ }

i Expected a property here.

19 │                 "isDefault": true
20 │             },

21 │ },
│ ^
22 │ ]
23 │ }

./.vscode/tasks.json:22:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Expected an array, an object, or a literal but instead found ']'.

20 │             },
21 │         },

22 │ ]
│ ^
23 │ }

i Expected an array, an object, or a literal here.

20 │             },
21 │         },

22 │ ]
│ ^
23 │ }

./.vscode/tasks.json lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× The file contains diagnostics that needs to be addressed.

./dist.tsconfig.json format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Formatter would have printed the following content:

 1  1 │   {
 2    │ - ··"compilerOptions":·{
 3    │ - ····"strictFunctionTypes":·true,
 4    │ - ····"strictNullChecks":·true,
 5    │ - ····"strictBindCallApply":·true,
 6    │ - ····"resolveJsonModule":·true,
 7    │ - ····"allowJs":·true,
 8    │ - ····"allowSyntheticDefaultImports":·true,
 9    │ - ····"allowUnreachableCode":·false,
10    │ - ····"declaration":·true,
11    │ - ····"experimentalDecorators":·true,
12    │ - ····"noErrorTruncation":·true,
13    │ - ····"lib":·[
14    │ - ······"dom",
15    │ - ······"es2020"
16    │ - ····],
17    │ - ····"outDir":·"dist",
18    │ - ····"moduleResolution":·"node16",
19    │ - ····"module":·"esnext",
20    │ - ····"target":·"es2019",
21    │ - ····"noUnusedLocals":·false,
22    │ - ····"noUnusedParameters":·false,
23    │ - ····"noImplicitThis":·true,
24    │ - ····"jsx":·"react",
25    │ - ····"jsxFactory":·"h.createElement",
26    │ - ····"jsxFragmentFactory":·"h.Fragment"
27    │ - ··},
28    │ - ··"include":·[
29    │ - ····"src"
30    │ - ··],
31    │ - ··"exclude"·:·[
32    │ - ····"src/**/*.spec.ts",
33    │ - ····"src/**/*.spec.tsx"
34    │ - ··]
35    │ - }
    2 │ + → "compilerOptions":·{
    3 │ + → → "strictFunctionTypes":·true,
    4 │ + → → "strictNullChecks":·true,
    5 │ + → → "strictBindCallApply":·true,
    6 │ + → → "resolveJsonModule":·true,
    7 │ + → → "allowJs":·true,
    8 │ + → → "allowSyntheticDefaultImports":·true,
    9 │ + → → "allowUnreachableCode":·false,
   10 │ + → → "declaration":·true,
   11 │ + → → "experimentalDecorators":·true,
   12 │ + → → "noErrorTruncation":·true,
   13 │ + → → "lib":·["dom",·"es2020"],
   14 │ + → → "outDir":·"dist",
   15 │ + → → "moduleResolution":·"node16",
   16 │ + → → "module":·"esnext",
   17 │ + → → "target":·"es2019",
   18 │ + → → "noUnusedLocals":·false,
   19 │ + → → "noUnusedParameters":·false,
   20 │ + → → "noImplicitThis":·true,
   21 │ + → → "jsx":·"react",
   22 │ + → → "jsxFactory":·"h.createElement",
   23 │ + → → "jsxFragmentFactory":·"h.Fragment"
   24 │ + → },
   25 │ + → "include":·["src"],
   26 │ + → "exclude":·["src/**/*.spec.ts",·"src/**/*.spec.tsx"]
   27 │ + }
   28 │ + 

./dist.tsconfig.json check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× The file contains diagnostics that needs to be addressed.

./.vscode/tasks.json format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Format with errors is disabled.

./.vscode/tasks.json check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× The file contains diagnostics that needs to be addressed.

./tests/CounterWithReduxStore.tsx:35:11 lint/a11y/useButtonType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Provide an explicit type prop for the button element.

33 │       return (
34 │         <Host count={this.count()}>

35 │ -
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 │ {this.count()}
37 │ +

i The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.

i Allowed button types are: submit, button or reset

./tests/CounterWithReduxStore.tsx:37:11 lint/a11y/useButtonType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Provide an explicit type prop for the button element.

35 │           <button onpointerup={this.decrementCount}>-</button>
36 │           <span>{this.count()}</span>

37 │ +
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 │
39 │ );

i The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.

i Allowed button types are: submit, button or reset

./tests/CounterWithReduxStore.tsx lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× The file contains diagnostics that needs to be addressed.

./tests/CounterWithReduxStore.tsx organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Import statements could be sorted:

 1    │ - import·{·h,·createCustomElement,·Host,·EventDispatcher·}·from·"../src";
    1 │ + import·{·EventDispatcher,·Host,·createCustomElement,·h·}·from·"../src";
 2  2 │   import { counterStyle } from "./shared/counterStyle";
 3  3 │   import { decrement, increment } from "./shared/redux/CounterSlice";

./tasks/generateTypes.ts:16:1 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Prefer for...of instead of Array.forEach

14 │ >();
15 │ 

16 │ supportedHTMLElements.forEach((x) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 │ elements.set(x.tagName, {
18 │ attributes: [HTMLElements["${x.tagName}"]],
19 │ elementInterfaces: [x.elementInterface],
20 │ });
21 │ });
│ ^^
22 │ supportedMathMLElements.forEach((x) => {
23 │ elements.set(x.tagName, {

i forEach could lead to performance issues when working with large arrays. When combined with functions like .filter or .map, this causes multiple iterations over the same type.

./tasks/generateTypes.ts:22:1 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Prefer for...of instead of Array.forEach

20 │   });
21 │ });

22 │ supportedMathMLElements.forEach((x) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 │ elements.set(x.tagName, {
24 │ attributes: [MathMLElements["${x.tagName}"]],
25 │ elementInterfaces: [x.elementInterface],
26 │ });
27 │ });
│ ^^
28 │ supportedSVGElements.forEach((x) => {
29 │ const attributes = SVGElements["${x.tagName}"];

i forEach could lead to performance issues when working with large arrays. When combined with functions like .filter or .map, this causes multiple iterations over the same type.

The number of diagnostics exceeds the number allowed by Biome.
Diagnostics not shown: 580.
Checked 147 file(s) in 57ms
Found 205 error(s)
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Some errors were emitted while running checks.

@github-actions github-actions bot closed this Nov 15, 2023
@github-actions github-actions bot deleted the master_lint branch November 15, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants