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

[new-observers-v2] Linting changes #268

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 5, 2024

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

Please review and merge if everything looks good.

Additional suggestions: ./jest-puppeteer.config.cjs format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Formatter would have printed the following content:

 7  7 │   
 8  8 │   module.exports = {
 9    │ - ··launch:·{
10    │ - ····dumpio:·true,
11    │ - ····headless:·"new",
12    │ - ····product:·"chrome",
13    │ - ··},
14    │ - ··server:·{
15    │ - ····command,
16    │ - ····port:·3000,
17    │ - ··},
    9 │ + → launch:·{
   10 │ + → → dumpio:·true,
   11 │ + → → headless:·"new",
   12 │ + → → product:·"chrome",
   13 │ + → },
   14 │ + → server:·{
   15 │ + → → command,
   16 │ + → → port:·3000,
   17 │ + → },
18 18 │   };
19 19 │   

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

× Formatter would have printed the following content:

 1  1 │   {
 2    │ - ··"compilerOptions":·{
 3    │ - ····"strictFunctionTypes":·true,
 4    │ - ····"strictNullChecks":·true,
 5    │ - ····"strictBindCallApply":·true,
 6    │ - ····"resolveJsonModule":·true,
 7    │ - ····"allowSyntheticDefaultImports":·true,
 8    │ - ····"allowUnreachableCode":·false,
 9    │ - ····"declaration":·true,
10    │ - ····"experimentalDecorators":·true,
11    │ - ····"noErrorTruncation":·true,
12    │ - ····"lib":·[
13    │ - ······"dom",
14    │ - ······"ESNext"
15    │ - ····],
16    │ - ····"isolatedDeclarations":·false,
17    │ - ····"isolatedModules":·true,
18    │ - ····"outDir":·"dist",
19    │ - ····"moduleResolution":·"node",
20    │ - ····"module":·"esnext",
21    │ - ····"target":·"esnext",
22    │ - ····"noUnusedLocals":·false,
23    │ - ····"noUnusedParameters":·false,
24    │ - ····"noImplicitThis":·true,
25    │ - ····"jsx":·"react-jsx",
26    │ - ····"jsxImportSource":·"@michijs/michijs",
27    │ - ····"paths":·{
28    │ - ······"@michijs/michijs/*":·[
29    │ - ········"./src/*"
30    │ - ······],
31    │ - ······"@michijs/michijs":·[
32    │ - ········"./src/index"
33    │ - ······]
34    │ - ····}
35    │ - ··},
36    │ - ··"include":·[
37    │ - ····"src"
38    │ - ··],
39    │ - ··"exclude"·:·[
40    │ - ····"src/**/*.spec.ts",
41    │ - ····"src/**/*.spec.tsx"
42    │ - ··]
43    │ - }
    2 │ + → "compilerOptions":·{
    3 │ + → → "strictFunctionTypes":·true,
    4 │ + → → "strictNullChecks":·true,
    5 │ + → → "strictBindCallApply":·true,
    6 │ + → → "resolveJsonModule":·true,
    7 │ + → → "allowSyntheticDefaultImports":·true,
    8 │ + → → "allowUnreachableCode":·false,
    9 │ + → → "declaration":·true,
   10 │ + → → "experimentalDecorators":·true,
   11 │ + → → "noErrorTruncation":·true,
   12 │ + → → "lib":·["dom",·"ESNext"],
   13 │ + → → "isolatedDeclarations":·false,
   14 │ + → → "isolatedModules":·true,
   15 │ + → → "outDir":·"dist",
   16 │ + → → "moduleResolution":·"node",
   17 │ + → → "module":·"esnext",
   18 │ + → → "target":·"esnext",
   19 │ + → → "noUnusedLocals":·false,
   20 │ + → → "noUnusedParameters":·false,
   21 │ + → → "noImplicitThis":·true,
   22 │ + → → "jsx":·"react-jsx",
   23 │ + → → "jsxImportSource":·"@michijs/michijs",
   24 │ + → → "paths":·{
   25 │ + → → → "@michijs/michijs/*":·["./src/*"],
   26 │ + → → → "@michijs/michijs":·["./src/index"]
   27 │ + → → }
   28 │ + → },
   29 │ + → "include":·["src"],
   30 │ + → "exclude":·["src/**/*.spec.ts",·"src/**/*.spec.tsx"]
   31 │ + }
   32 │ + 

./src/michijs/DOMDiff/create.ts organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Import statements could be sorted:

 1  1 │   import { isClassJSXElement } from "../typeWards/isClassJSXElement";
 2  2 │   import { isDOMOrFragmentElement } from "../typeWards/isDOMOrFragmentElement";
 3    │ - import·{·isNotAPrimitiveJSX·}·from·"../typeWards/isNotAPrimitiveJSX";
 4    │ - import·{·isFunctionOrClassJSXElement·}·from·"../typeWards/isFunctionOrClassJSXElement";
    3 │ + import·{·isFunctionOrClassJSXElement·}·from·"../typeWards/isFunctionOrClassJSXElement";
    4 │ + import·{·isNotAPrimitiveJSX·}·from·"../typeWards/isNotAPrimitiveJSX";
    5 │ + import·{·isObservableType·}·from·"../typeWards/isObservableType";
 5  6 │   import type {
 6  7 │     CreateOptions,
····· │ 
12 13 │   import { createDOMElement } from "./createDOMElement";
13 14 │   import { createObject } from "./createObject";
14    │ - import·{·createTextElement·}·from·"./createTextElement";
15    │ - import·{·isObservableType·}·from·"../typeWards/isObservableType";
16    │ - import·{·createObservableTextElement·}·from·"./createObservableTextElement";
   15 │ + import·{·createObservableTextElement·}·from·"./createObservableTextElement";
   16 │ + import·{·createTextElement·}·from·"./createTextElement";
17 17 │   
18 18 │   export function create(

./schema.json format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Formatter would have printed the following content:

 1  1 │   {
 2    │ - ··"$schema":·"https://json-schema.org/draft/2020-12/schema",
 3    │ - ··"$id":·"https://github.com/michijs/michijs/blob/master/schema.json",
 4    │ - ··"title":·"MichiJS-schema",
 5    │ - ··"description":·"MichiJS·elements·schema",
 6    │ - ··"type":·"object",
 7    │ - ··"additionalProperties":·false,
 8    │ - ··"patternProperties":·{
 9    │ - ····"^.*-.*$":·{
10    │ - ······"type":·"object",
11    │ - ······"description":·"Your·custom·element·name",
12    │ - ······"minProperties":·1,
13    │ - ······"additionalProperties":·false,
14    │ - ······"properties":·{
15    │ - ········"attributes":·{
16    │ - ··········"description":·"Allows·to·define·attributes.",
17    │ - ··········"type":·"object",
18    │ - ··········"minProperties":·1
19    │ - ········},
20    │ - ········"reflectedAttributes":·{
21    │ - ··········"description":·"Allows·to·define·reflected·attributes·and·follows·the·Kebab·case.·A·reflected·attribute·cannot·be·initialized·with·a·true·value.",
22    │ - ··········"type":·"object",
23    │ - ··········"minProperties":·1
24    │ - ········},
25    │ - ········"cssVariables":·{
26    │ - ··········"description":·"Allows·to·define·CSS·variables.",
27    │ - ··········"type":·"object",
28    │ - ··········"minProperties":·1
29    │ - ········},
30    │ - ········"reflectedCssVariables":·{
31    │ - ··········"description":·"Allows·to·define·reflected·CSS·variables·and·follows·the·Kebab·case.·A·reflected·CSS·variable·cannot·be·initialized·with·a·true·value.",
32    │ - ··········"type":·"object",
33    │ - ··········"minProperties":·1
34    │ - ········},
35    │ - ········"formAssociated":·{
36    │ - ··········"description":·"This·tells·the·browser·to·treat·the·element·like·a·form·control.",
37    │ - ··········"type":·"boolean"
38    │ - ········},
39    │ - ········"shadow":·{
40    │ - ··········"description":·"Allows·you·to·add·a·Shadow·DOM.·By·default,·it·uses·open·mode·on·Autonomous·Custom·elements·and·does·not·use·Shadow·DOM·on·Customized·built-in·elements.·Only·the·following·elements·are·allowed·to·use·Shadow·DOM.·Default:·{mode:·'open'}·on·Autonomous·Custom·elements·and·false·on·Customized·built-in·elements",
41    │ - ··········"type":·[
42    │ - ············"boolean",
43    │ - ············"object"
44    │ - ··········],
45    │ - ··········"additionalProperties":·false,
46    │ - ··········"required":·[
47    │ - ············"mode"
48    │ - ··········],
49    │ - ··········"properties":·{
50    │ - ············"delegatesFocus":·{
51    │ - ··············"type":·"boolean"
52    │ - ············},
53    │ - ············"mode":·{
54    │ - ··············"enum":·[
55    │ - ················"closed",
56    │ - ················"open"
57    │ - ··············]
58    │ - ············},
59    │ - ············"slotAssignment":·{
60    │ - ··············"enum":·[
61    │ - ················"manual",
62    │ - ················"named"
63    │ - ··············]
64    │ - ············}
65    │ - ··········}
66    │ - ········}
67    │ - ······}
68    │ - ····}
69    │ - ··},
70    │ - ··"properties":·{
71    │ - ····"$schema":·{
72    │ - ······"type":·"string"
73    │ - ····}
74    │ - ··}
75    │ - }
    2 │ + → "$schema":·"https://json-schema.org/draft/2020-12/schema",
    3 │ + → "$id":·"https://github.com/michijs/michijs/blob/master/schema.json",
    4 │ + → "title":·"MichiJS-schema",
    5 │ + → "description":·"MichiJS·elements·schema",
    6 │ + → "type":·"object",
    7 │ + → "additionalProperties":·false,
    8 │ + → "patternProperties":·{
    9 │ + → → "^.*-.*$":·{
   10 │ + → → → "type":·"object",
   11 │ + → → → "description":·"Your·custom·element·name",
   12 │ + → → → "minProperties":·1,
   13 │ + → → → "additionalProperties":·false,
   14 │ + → → → "properties":·{
   15 │ + → → → → "attributes":·{
   16 │ + → → → → → "description":·"Allows·to·define·attributes.",
   17 │ + → → → → → "type":·"object",
   18 │ + → → → → → "minProperties":·1
   19 │ + → → → → },
   20 │ + → → → → "reflectedAttributes":·{
   21 │ + → → → → → "description":·"Allows·to·define·reflected·attributes·and·follows·the·Kebab·case.·A·reflected·attribute·cannot·be·initialized·with·a·true·value.",
   22 │ + → → → → → "type":·"object",
   23 │ + → → → → → "minProperties":·1
   24 │ + → → → → },
   25 │ + → → → → "cssVariables":·{
   26 │ + → → → → → "description":·"Allows·to·define·CSS·variables.",
   27 │ + → → → → → "type":·"object",
   28 │ + → → → → → "minProperties":·1
   29 │ + → → → → },
   30 │ + → → → → "reflectedCssVariables":·{
   31 │ + → → → → → "description":·"Allows·to·define·reflected·CSS·variables·and·follows·the·Kebab·case.·A·reflected·CSS·variable·cannot·be·initialized·with·a·true·value.",
   32 │ + → → → → → "type":·"object",
   33 │ + → → → → → "minProperties":·1
   34 │ + → → → → },
   35 │ + → → → → "formAssociated":·{
   36 │ + → → → → → "description":·"This·tells·the·browser·to·treat·the·element·like·a·form·control.",
   37 │ + → → → → → "type":·"boolean"
   38 │ + → → → → },
   39 │ + → → → → "shadow":·{
   40 │ + → → → → → "description":·"Allows·you·to·add·a·Shadow·DOM.·By·default,·it·uses·open·mode·on·Autonomous·Custom·elements·and·does·not·use·Shadow·DOM·on·Customized·built-in·elements.·Only·the·following·elements·are·allowed·to·use·Shadow·DOM.·Default:·{mode:·'open'}·on·Autonomous·Custom·elements·and·false·on·Customized·built-in·elements",
   41 │ + → → → → → "type":·["boolean",·"object"],
   42 │ + → → → → → "additionalProperties":·false,
   43 │ + → → → → → "required":·["mode"],
   44 │ + → → → → → "properties":·{
   45 │ + → → → → → → "delegatesFocus":·{
   46 │ + → → → → → → → "type":·"boolean"
   47 │ + → → → → → → },
   48 │ + → → → → → → "mode":·{
   49 │ + → → → → → → → "enum":·["closed",·"open"]
   50 │ + → → → → → → },
   51 │ + → → → → → → "slotAssignment":·{
   52 │ + → → → → → → → "enum":·["manual",·"named"]
   53 │ + → → → → → → }
   54 │ + → → → → → }
   55 │ + → → → → }
   56 │ + → → → }
   57 │ + → → }
   58 │ + → },
   59 │ + → "properties":·{
   60 │ + → → "$schema":·{
   61 │ + → → → "type":·"string"
   62 │ + → → }
   63 │ + → }
   64 │ + }
   65 │ + 

./src/michijs/DOMDiff/create.ts format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Formatter would have printed the following content:

 4  4 │   import { isFunctionOrClassJSXElement } from "../typeWards/isFunctionOrClassJSXElement";
 5  5 │   import type {
 6    │ - ··CreateOptions,
 7    │ - ··DOMElementJSXElement,
 8    │ - ··ObservableNonNullablePrimitiveType,
 9    │ - ··SingleJSXElement,
    6 │ + → CreateOptions,
    7 │ + → DOMElementJSXElement,
    8 │ + → ObservableNonNullablePrimitiveType,
    9 │ + → SingleJSXElement,
10 10 │   } from "../types";
11 11 │   import { classJSXToObjectJSXElement } from "../utils/classJSXToObjectJSXElement";
····· │ 
17 17 │   
18 18 │   export function create(
19    │ - ··jsx:·SingleJSXElement,
20    │ - ··options:·CreateOptions·=·{},
   19 │ + → jsx:·SingleJSXElement,
   20 │ + → options:·CreateOptions·=·{},
21 21 │   ): Node {
22    │ - ··if·(jsx)·{
23    │ - ····if·(Array.isArray(jsx))
24    │ - ······return·createDOMElement(
25    │ - ········{
26    │ - ··········jsxTag:·document.createDocumentFragment(),
27    │ - ··········attrs:·{
28    │ - ············children:·jsx,
29    │ - ··········},
30    │ - ········},
31    │ - ········options,
32    │ - ······);
33    │ - ····if·(isNotAPrimitiveJSX(jsx))·{
34    │ - ······if·("jsxTag"·in·jsx)·{
35    │ - ········//Fix·for·non-jsx·objects
36    │ - ········//·Solves·undefined·Fragment·caused·by·some·compilers
37    │ - ········if·(isDOMOrFragmentElement(jsx))·{
38    │ - ··········jsx.jsxTag·??=·document.createDocumentFragment();
39    │ - ··········return·createDOMElement(jsx·as·DOMElementJSXElement,·options);
40    │ - ········}
41    │ - ········if·(isFunctionOrClassJSXElement(jsx))·{
42    │ - ··········//·Explicit·casting·because·of·tsc·error
43    │ - ··········if·(isClassJSXElement(jsx))
44    │ - ············return·createObject(classJSXToObjectJSXElement(jsx),·options);
45    │ - ··········return·create(jsx.jsxTag(jsx.attrs,·options),·options);
46    │ - ········}
47    │ - ········return·createObject(jsx,·options);
48    │ - ······}
49    │ - ······return·jsx·as·Node;
50    │ - ····}
51    │ - ····if·(isObservableType(jsx))
52    │ - ······return·createObservableTextElement(
53    │ - ········jsx·as·unknown·as·ObservableNonNullablePrimitiveType,
54    │ - ······);
55    │ - ····return·createTextElement(jsx);
56    │ - ··}
57    │ - ··return·createTextElement(jsx);
   22 │ + → if·(jsx)·{
   23 │ + → → if·(Array.isArray(jsx))
   24 │ + → → → return·createDOMElement(
   25 │ + → → → → {
   26 │ + → → → → → jsxTag:·document.createDocumentFragment(),
   27 │ + → → → → → attrs:·{
   28 │ + → → → → → → children:·jsx,
   29 │ + → → → → → },
   30 │ + → → → → },
   31 │ + → → → → options,
   32 │ + → → → );
   33 │ + → → if·(isNotAPrimitiveJSX(jsx))·{
   34 │ + → → → if·("jsxTag"·in·jsx)·{
   35 │ + → → → → //Fix·for·non-jsx·objects
   36 │ + → → → → //·Solves·undefined·Fragment·caused·by·some·compilers
   37 │ + → → → → if·(isDOMOrFragmentElement(jsx))·{
   38 │ + → → → → → jsx.jsxTag·??=·document.createDocumentFragment();
   39 │ + → → → → → return·createDOMElement(jsx·as·DOMElementJSXElement,·options);
   40 │ + → → → → }
   41 │ + → → → → if·(isFunctionOrClassJSXElement(jsx))·{
   42 │ + → → → → → //·Explicit·casting·because·of·tsc·error
   43 │ + → → → → → if·(isClassJSXElement(jsx))
   44 │ + → → → → → → return·createObject(classJSXToObjectJSXElement(jsx),·options);
   45 │ + → → → → → return·create(jsx.jsxTag(jsx.attrs,·options),·options);
   46 │ + → → → → }
   47 │ + → → → → return·createObject(jsx,·options);
   48 │ + → → → }
   49 │ + → → → return·jsx·as·Node;
   50 │ + → → }
   51 │ + → → if·(isObservableType(jsx))
   52 │ + → → → return·createObservableTextElement(
   53 │ + → → → → jsx·as·unknown·as·ObservableNonNullablePrimitiveType,
   54 │ + → → → );
   55 │ + → → return·createTextElement(jsx);
   56 │ + → }
   57 │ + → return·createTextElement(jsx);
58 58 │   }
59 59 │   

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

× Prefer for...of instead of forEach.

24 │ >();
25 │ 

26 │ supportedHTMLElements.forEach((x) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 │ elements.set(x.tagName, {
28 │ attributes: [HTMLElements["${x.tagName}"]],
29 │ elementInterfaces: [x.elementInterface],
30 │ });
31 │ });
│ ^^
32 │ supportedMathMLElements.forEach((x) => {
33 │ elements.set(x.tagName, {

i forEach may 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:32:1 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Prefer for...of instead of forEach.

30 │   });
31 │ });

32 │ supportedMathMLElements.forEach((x) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 │ elements.set(x.tagName, {
34 │ attributes: [MathMLElements["${x.tagName}"]],
35 │ elementInterfaces: [x.elementInterface],
36 │ });
37 │ });
│ ^^
38 │ supportedSVGElements.forEach((x) => {
39 │ const attributes = SVGElements["${x.tagName}"];

i forEach may 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:38:1 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Prefer for...of instead of forEach.

36 │   });
37 │ });

38 │ supportedSVGElements.forEach((x) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 │ const attributes = SVGElements["${x.tagName}"];
...
50 │ }
51 │ });
│ ^^
52 │
53 │ function renameFiles(directory) {

i forEach may 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:58:3 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Prefer for...of instead of forEach.

57 │   // Iterate through each file in the directory

58 │ files.forEach((file) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
59 │ const filePath = path.join(directory, file);
...
79 │ }
80 │ });
│ ^^
81 │ }
82 │

i forEach may 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:93:7 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Prefer for...of instead of forEach.

 91 │   generateAttributesAndValueSetsProps: {
 92 │     valueSetsTransformer(valueSets) {

93 │ valueSets.attributes.forEach((attribute) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 │ attribute.values = [
...
101 │ ];
102 │ });
│ ^^
103 │ },
104 │ valueSetsAdditionalImports: [

i forEach may 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.

./package.json format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Formatter would have printed the following content:

  1   1 │   {
  2     │ - ··"name":·"@michijs/michijs",
  3     │ - ··"author":·"Lucas·M.·Segurado",
  4     │ - ··"license":·"MIT",
  5     │ - ··"version":·"2.0.0-beta.76",
  6     │ - ··"files":·[
  7     │ - ····"dist/",
  8     │ - ····"jsx-runtime/"
  9     │ - ··],
 10     │ - ··"main":·"dist/index.js",
 11     │ - ··"module":·"dist/index.js",
 12     │ - ··"exports":·{
 13     │ - ····"./jsx-runtime":·{
 14     │ - ······"import":·"./jsx-runtime/index.js",
 15     │ - ······"require":·"./jsx-runtime/index.js"
 16     │ - ····},
 17     │ - ····"./jsx-dev-runtime":·{
 18     │ - ······"import":·"./jsx-runtime/index.js",
 19     │ - ······"require":·"./jsx-runtime/index.js"
 20     │ - ····},
 21     │ - ····".":·{
 22     │ - ······"import":·"./dist/index.js",
 23     │ - ······"require":·"./dist/index.js"
 24     │ - ····}
 25     │ - ··},
 26     │ - ··"baseUrl":·"./src",
 27     │ - ··"repository":·{
 28     │ - ····"type":·"git",
 29     │ - ····"url":·"https://github.com/michijs/michijs.git"
 30     │ - ··},
 31     │ - ··"funding":·{
 32     │ - ····"type":·"opencollective",
 33     │ - ····"url":·"https://opencollective.com/michijs"
 34     │ - ··},
 35     │ - ··"description":·"Typescript·library·to·build·web·components",
 36     │ - ··"trustedDependencies":·[
 37     │ - ····"puppeteer"
 38     │ - ··],
 39     │ - ··"scripts":·{
 40     │ - ····"start":·"michi-server·--start",
 41     │ - ····"dist":·"michi-server·--dist",
 42     │ - ····"build":·"michi-server·--build",
 43     │ - ····"dist-w":·"michi-server·--dist·--w",
 44     │ - ····"bun-link":·"bun·link·--force",
 45     │ - ····"link":·"bunx·concurrently·bun:dist-w·bun:bun-link",
 46     │ - ····"generate-types":·"bun·run·./tasks/generateTypes.ts",
 47     │ - ····"start-benchmark-michijs":·"michi-server·--start·--env=TESTING",
 48     │ - ····"start-benchmark-vanilla":·"michi-server·--start·--env=TESTING_VANILLA",
 49     │ - ····"benchmark-michijs":·"NODE_ENV=TESTING·jest·--updateSnapshot·--no-cache·--unhandled-rejections=strict·--selectProjects=benchmark-michijs",
 50     │ - ····"benchmark-vanilla":·"NODE_ENV=TESTING_VANILLA·jest·--updateSnapshot·--no-cache·--unhandled-rejections=strict·--selectProjects=benchmark-vanilla",
 51     │ - ····"benchmark":·"bun·run·benchmark-michijs·&&·bun·run·benchmark-vanilla",
 52     │ - ····"coverage":·"jest·--no-cache·--collect-coverage·--selectProjects=library-tests",
 53     │ - ····"test-tsc":·"tsc·--noEmit·--skipLibCheck",
 54     │ - ····"test-tsc-w":·"tsc·--noEmit·--skipLibCheck·-w",
 55     │ - ····"test":·"jest·--no-cache·--selectProjects=library-tests",
 56     │ - ····"test-w":·"jest·--watch·--no-cache·--selectProjects=library-tests",
 57     │ - ····"usnap":·"jest·--updateSnapshot·--unhandled-rejections=strict·--selectProjects=library-tests",
 58     │ - ····"run-all-tests":·"bun·run·test-tsc·&&·bun·run·test·&&·bun·run·benchmark"
 59     │ - ··},
 60     │ - ··"keywords":·[
 61     │ - ····"web-components",
 62     │ - ····"custom·elements",
 63     │ - ····"built-in·elements",
 64     │ - ····"Autonomous·custom·elements"
 65     │ - ··],
 66     │ - ··"devDependencies":·{
 67     │ - ····"@michijs/dev-server":·"0.6.0",
 68     │ - ····"@reduxjs/toolkit":·"1.9.7",
 69     │ - ····"@types/jest":·"29.5.12",
 70     │ - ····"esbuild-jest-transform":·"2.0.0",
 71     │ - ····"jest":·"29.7.0",
 72     │ - ····"jest-environment-jsdom":·"29.7.0",
 73     │ - ····"jest-puppeteer":·"10.0.1",
 74     │ - ····"puppeteer":·"22.6.1",
 75     │ - ····"redux":·"5.0.1",
 76     │ - ····"ts-jest":·"29.1.2",
 77     │ - ····"@michijs/htmltype":·"0.2.14",
 78     │ - ····"bun":·"^1.1.3",
 79     │ - ····"typescript":·"5.5.3"
 80     │ - ··},
 81     │ - ··"peerDependencies":·{
 82     │ - ····"csstype":·"^3.1.3"
 83     │ - ··},
 84     │ - ··"jest":·{
 85     │ - ····"testTimeout":·30000,
 86     │ - ····"projects":·[
 87     │ - ······{
 88     │ - ········"displayName":·"library-tests",
 89     │ - ········"automock":·false,
 90     │ - ········"testEnvironment":·"jsdom",
 91     │ - ········"testRegex":·"src/.*spec.*",
 92     │ - ········"transform":·{
 93     │ - ··········"\\.(js|jsx|ts|tsx)$":·"esbuild-jest-transform"
 94     │ - ········}
 95     │ - ······},
 96     │ - ······{
 97     │ - ········"displayName":·"benchmark-vanilla",
 98     │ - ········"preset":·"jest-puppeteer",
 99     │ - ········"testRegex":·"tests/benchmark/Vanilla.spec.tsx",
100     │ - ········"automock":·false,
101     │ - ········"transform":·{
102     │ - ··········"\\.(js|jsx|ts|tsx)$":·"esbuild-jest-transform"
103     │ - ········}
104     │ - ······},
105     │ - ······{
106     │ - ········"displayName":·"benchmark-michijs",
107     │ - ········"preset":·"jest-puppeteer",
108     │ - ········"testRegex":·"tests/benchmark/MichiJS.spec.tsx",
109     │ - ········"automock":·false,
110     │ - ········"transform":·{
111     │ - ··········"\\.(js|jsx|ts|tsx)$":·"esbuild-jest-transform"
112     │ - ········}
113     │ - ······}
114     │ - ····]
115     │ - ··}
      2 │ + → "name":·"@michijs/michijs",
      3 │ + → "author":·"Lucas·M.·Segurado",
      4 │ + → "license":·"MIT",
      5 │ + → "version":·"2.0.0-beta.76",
      6 │ + → "files":·["dist/",·"jsx-runtime/"],
      7 │ + → "main":·"dist/index.js",
      8 │ + → "module":·"dist/index.js",
      9 │ + → "exports":·{
     10 │ + → → "./jsx-runtime":·{
     11 │ + → → → "import":·"./jsx-runtime/index.js",
     12 │ + → → → "require":·"./jsx-runtime/index.js"
     13 │ + → → },
     14 │ + → → "./jsx-dev-runtime":·{
     15 │ + → → → "import":·"./jsx-runtime/index.js",
     16 │ + → → → "require":·"./jsx-runtime/index.js"
     17 │ + → → },
     18 │ + → → ".":·{
     19 │ + → → → "import":·"./dist/index.js",
     20 │ + → → → "require":·"./dist/index.js"
     21 │ + → → }
     22 │ + → },
     23 │ + → "baseUrl":·"./src",
     24 │ + → "repository":·{
     25 │ + → → "type":·"git",
     26 │ + → → "url":·"https://github.com/michijs/michijs.git"
     27 │ + → },
     28 │ + → "funding":·{
     29 │ + → → "type":·"opencollective",
     30 │ + → → "url":·"https://opencollective.com/michijs"
     31 │ + → },
     32 │ + → "description":·"Typescript·library·to·build·web·components",
     33 │ + → "trustedDependencies":·["puppeteer"],
     34 │ + → "scripts":·{
     35 │ + → → "start":·"michi-server·--start",
     36 │ + → → "dist":·"michi-server·--dist",

76 more lines truncated

./tasks/generateTypes.ts organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Import statements could be sorted:

  1   1 │   import {
  2     │ - ··supportedHTMLElements,
  3     │ - ··supportedMathMLElements,
  4     │ - ··supportedSVGElements,
  5     │ - }·from·"@michijs/htmltype/supported";
      2 │ + ··cpSync,
      3 │ + ··readFileSync,
      4 │ + ··readdirSync,
      5 │ + ··renameSync,
      6 │ + ··rmSync,
      7 │ + ··statSync,
      8 │ + ··writeFileSync,
      9 │ + }·from·"node:fs";
     10 │ + import·path·from·"node:path";
  6  11 │   import { generateTypes } from "@michijs/htmltype/bin";
  7  12 │   import {
  8     │ - ··writeFileSync,
  9     │ - ··rmSync,
 10     │ - ··cpSync,
 11     │ - ··readdirSync,
 12     │ - ··statSync,
 13     │ - ··readFileSync,
 14     │ - ··renameSync,
 15     │ - }·from·"node:fs";
 16     │ - import·path·from·"node:path";
     13 │ + ··supportedHTMLElements,
     14 │ + ··supportedMathMLElements,
     15 │ + ··supportedSVGElements,
     16 │ + }·from·"@michijs/htmltype/supported";
 17  17 │   
 18  18 │   const elements = new Map<

./michi.config.ts:30:7 lint/style/noNonNullAssertion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Forbidden non-null assertion.

28 │     };
29 │     if (environment === "TESTING") {

30 │ defaultConfig.public!.path = "./tests/benchmark/michijs/public";
│ ^^^^^^^^^^^^^^^^^^^^^
31 │ defaultConfig.esbuildOptions.entryPoints = [
32 │ "./tests/benchmark/michijs/src/index.tsx",

./michi.config.ts:35:7 lint/style/noNonNullAssertion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Forbidden non-null assertion.

33 │       ];
34 │     } else {

35 │ defaultConfig.public!.path = "./tests/benchmark/vanillajs/public";
│ ^^^^^^^^^^^^^^^^^^^^^
36 │ defaultConfig.esbuildOptions.entryPoints = [
37 │ "./tests/benchmark/vanillajs/src/index.js",

./michi.config.ts organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Import statements could be sorted:

 1  1 │   import type {
 2    │ - ··ServerConfig,
 3    │ - ··ServerConfigFactory,
 4    │ - ··DefaultEnvironment,
    2 │ + ··DefaultEnvironment,
    3 │ + ··ServerConfig,
    4 │ + ··ServerConfigFactory,
 5  5 │   } from "@michijs/dev-server";
 6  6 │   

./src/michijs/DOMDiff/createObject.ts:11:7 lint/suspicious/noImplicitAnyLet ━━━━━━━━━━━━━━━━━━━━━━━━

× This variable implicitly has the any type.

 9 │ ): Element => {
10 │   const isSVG = options.isSVG || jsx.jsxTag === RootTags.SVG;

11 │ let isMATHML;
│ ^^^^^^^^
12 │ let el: Element;
13 │ const { children, ...attrs } = jsx.attrs;

i Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.

./michi.config.ts format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Formatter would have printed the following content:

 1  1 │   import type {
 2    │ - ··ServerConfig,
 3    │ - ··ServerConfigFactory,
 4    │ - ··DefaultEnvironment,
    2 │ + → ServerConfig,
    3 │ + → ServerConfigFactory,
    4 │ + → DefaultEnvironment,
 5  5 │   } from "@michijs/dev-server";
 6  6 │   
 7  7 │   export const config: ServerConfigFactory<"TESTING" | DefaultEnvironment> = ({
 8    │ - ··environment,
    8 │ + → environment,
 9  9 │   }) => {
10    │ - ··const·defaultConfig:·ServerConfig·=·{
11    │ - ····public:·{
12    │ - ······path:·"./tests/public",
13    │ - ····},
14    │ - ····esbuildOptions:·{
15    │ - ······entryPoints:·["./tests/index.tsx"],
16    │ - ······tsconfig:
17    │ - ········environment·===·"DISTRIBUTION"·?·"dist.tsconfig.json"·:·"tsconfig.json",
18    │ - ······splitting:·true,
19    │ - ····},
20    │ - ··};
21    │ - ··if·(environment.startsWith("TESTING"))·{
22    │ - ····defaultConfig.openBrowser·=·false;
23    │ - ····defaultConfig.esbuildOptions·=·{
24    │ - ······...defaultConfig.esbuildOptions,
25    │ - ······splitting:·false,
26    │ - ······format:·undefined,
27    │ - ······target:·undefined,
28    │ - ····};
29    │ - ····if·(environment·===·"TESTING")·{
30    │ - ······defaultConfig.public!.path·=·"./tests/benchmark/michijs/public";
31    │ - ······defaultConfig.esbuildOptions.entryPoints·=·[
32    │ - ········"./tests/benchmark/michijs/src/index.tsx",
33    │ - ······];
34    │ - ····}·else·{
35    │ - ······defaultConfig.public!.path·=·"./tests/benchmark/vanillajs/public";
36    │ - ······defaultConfig.esbuildOptions.entryPoints·=·[
37    │ - ········"./tests/benchmark/vanillajs/src/index.js",
38    │ - ······];
39    │ - ····}
40    │ - ··}
41    │ - ··return·defaultConfig;
   10 │ + → const·defaultConfig:·ServerConfig·=·{
   11 │ + → → public:·{
   12 │ + → → → path:·"./tests/public",
   13 │ + → → },
   14 │ + → → esbuildOptions:·{
   15 │ + → → → entryPoints:·["./tests/index.tsx"],
   16 │ + → → → tsconfig:
   17 │ + → → → → environment·===·"DISTRIBUTION"·?·"dist.tsconfig.json"·:·"tsconfig.json",
   18 │ + → → → splitting:·true,
   19 │ + → → },
   20 │ + → };
   21 │ + → if·(environment.startsWith("TESTING"))·{
   22 │ + → → defaultConfig.openBrowser·=·false;
   23 │ + → → defaultConfig.esbuildOptions·=·{
   24 │ + → → → ...defaultConfig.esbuildOptions,
   25 │ + → → → splitting:·false,
   26 │ + → → → format:·undefined,
   27 │ + → → → target:·undefined,
   28 │ + → → };
   29 │ + → → if·(environment·===·"TESTING")·{
   30 │ + → → → defaultConfig.public!.path·=·"./tests/benchmark/michijs/public";
   31 │ + → → → defaultConfig.esbuildOptions.entryPoints·=·[
   32 │ + → → → → "./tests/benchmark/michijs/src/index.tsx",
   33 │ + → → → ];
   34 │ + → → }·else·{
   35 │ + → → → defaultConfig.public!.path·=·"./tests/benchmark/vanillajs/public";
   36 │ + → → → defaultConfig.esbuildOptions.entryPoints·=·[
   37 │ + → → → → "./tests/benchmark/vanillajs/src/index.js",
   38 │ + → → → ];
   39 │ + → → }
   40 │ + → }
   41 │ + → return·defaultConfig;
42 42 │   };
43 43 │   

./src/michijs/routing/utils/setSearchParam.ts:8:9 lint/suspicious/noShadowRestrictedNames ━━━━━━━━━━

× Do not shadow the global "valueOf" property.

 6 │   value: unknown,
 7 │ ): void => {

8 │ const valueOf = value?.valueOf();
│ ^^^^^^^
9 │ if (isNil(valueOf)) url.searchParams.delete(name);
10 │ else

i Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

./.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.cjs, 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.cjs, michi.config.ts",
6 │     "*.tsx": "$(capture).css, $(capture).css.ts, $(capture).html, $(capture).spec.ts, $(capture).spec.tsx",

7 │ }
│ ^
8 │ }
9 │

./.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.cjs, 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.cjs, michi.config.ts",
6 │     "*.tsx": "$(capture).css, $(capture).css.ts, $(capture).html, $(capture).spec.ts, $(capture).spec.tsx",

7 │ }
│ ^
8 │ }
9 │

The number of diagnostics exceeds the number allowed by Biome.
Diagnostics not shown: 786.
Checked 215 files in 114ms. No fixes applied.
Found 568 errors.
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Some errors were emitted while running checks.

@lsegurado lsegurado merged commit 9139ff0 into new-observers-v2 Jul 5, 2024
@lsegurado lsegurado deleted the new-observers-v2_lint branch July 5, 2024 13:24
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.

1 participant