Skip to content

Commit

Permalink
fix(eslint-plugin):formatting for all rules and on patch
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmfern committed Dec 18, 2023
1 parent 93bc349 commit c7ce5b0
Show file tree
Hide file tree
Showing 61 changed files with 566 additions and 492 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export async function generateNoUnsupportedHTMLElementsAndAttributes() {
`import { createNoHTMLAttributeRule } from "../../utils/create-no-html-attribute-rule";
export default createNoHTMLAttributeRule(
'${featureName}',
"${featureName}" ,
${supportPercetange * 100},
'https://www.caniemail.com/features/${featureNamePrefixed}/'
"https://www.caniemail.com/features/${featureNamePrefixed}/",
)`,
);
} else {
Expand All @@ -38,9 +38,9 @@ export default createNoHTMLAttributeRule(
`import { createNoHTMLAttributeRule } from "../../utils/create-no-html-attribute-rule";
export default createNoHTMLAttributeRule(
'${featureName}',
"${featureName}",
${supportPercetange * 100},
'https://www.caniemail.com/features/${featureNamePrefixed}/'
"https://www.caniemail.com/features/${featureNamePrefixed}/",
)`,
);
} else {
Expand All @@ -49,9 +49,9 @@ export default createNoHTMLAttributeRule(
`import { createNoHTMLElementRule } from "../../utils/create-no-html-element-rule";
export default createNoHTMLElementRule(
'${featureName}',
"${featureName}",
${supportPercetange * 100},
'https://www.caniemail.com/features/${featureNamePrefixed}/'
"https://www.caniemail.com/features/${featureNamePrefixed}/",
)`,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export async function generateNoUnsupportedStyleRules() {
`import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";
export default createNoStylePropertyRule(
'${cssFeatureName}',
${supportPercetange * 100},
'https://www.caniemail.com/features/${featureNamePrefixed}/'
"${cssFeatureName}",
${supportPercetange * 100},
"https://www.caniemail.com/features/${featureNamePrefixed}/",
);
`,
);
Expand All @@ -34,9 +34,9 @@ export default createNoStylePropertyRule(
`import { createNoStyleValueKeywordRule } from "../../utils/create-no-style-value-keyword-rule";
export default createNoStyleValueKeywordRule(
'${cssFeatureName}',
${supportPercetange * 100},
'https://www.caniemail.com/features/${featureNamePrefixed}/'
"${cssFeatureName}",
${supportPercetange * 100},
"https://www.caniemail.com/features/${featureNamePrefixed}/",
);
`,
);
Expand Down
5 changes: 4 additions & 1 deletion packages/eslint-plugin/codegen/index.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { existsSync } from "node:fs";
import { rm, mkdir, writeFile } from "node:fs/promises";
import { generateNoUnsupportedStyleRules } from "./generate-no-unsupported-style-rules.mjs";
import { generateNoUnsupportedHTMLElementsAndAttributes } from "./generate-no-unsupported-html-elements-attribbutes.mjs";

(async () => {
await rm("src/rules/generated", { recursive: true });
if (existsSync("src/rules/generated")) {
await rm("src/rules/generated", { recursive: true });
}

await mkdir("src/rules/generated");
await writeFile("src/rules/generated/index.ts", "");
Expand Down
818 changes: 409 additions & 409 deletions packages/eslint-plugin/codegen/manual-changes.patch

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/eslint-plugin/codegen/utils/add-rule.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const addRule = async (feature, content) => {

await writeFile(newRuleFilename, content);
const camelCasedRule = `no${camelize(feature)[0].toUpperCase()}${camelize(feature).slice(1)}`;
const currentIndexContents = await readFile('./src/rules/generated/index.ts', 'utf-8');
const currentIndexContents = await readFile("./src/rules/generated/index.ts", "utf-8");

await writeFile(
'./src/rules/generated/index.ts',
`import ${camelCasedRule} from './${ruleBasename}';\n${currentIndexContents}\nexport { ${camelCasedRule} };`
"./src/rules/generated/index.ts",
`import ${camelCasedRule} from "./${ruleBasename}";\n${currentIndexContents}\nexport { ${camelCasedRule} };`
);
}
20 changes: 19 additions & 1 deletion packages/eslint-plugin/src/rules/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import noHtmlRp from "./no-html-rp";
import noHtmlRole from "./no-html-role";
import noHtmlRequired from "./no-html-required";
import noHtmlProgress from "./no-html-progress";
import noHtmlPopover from "./no-html-popover";
import noHtmlPicture from "./no-html-picture";
import noHtmlObject from "./no-html-object";
import noHtmlMeter from "./no-html-meter";
import noHtmlMetaColorScheme from "./no-html-meta-color-scheme";
import noHtmlMarquee from "./no-html-marquee";
import noHtmlLoadingAttribute from "./no-html-loading-attribute";
import noHtmlLink from "./no-html-link";
Expand Down Expand Up @@ -53,12 +55,17 @@ import noCssUnitInitial from "./no-css-unit-initial";
import noCssUnitCh from "./no-css-unit-ch";
import noCssUnitCalc from "./no-css-unit-calc";
import noCssTransform from "./no-css-transform";
import noCssTextUnderlinePosition from "./no-css-text-underline-position";
import noCssTextUnderlineOffset from "./no-css-text-underline-offset";
import noCssTextShadow from "./no-css-text-shadow";
import noCssTextOverflow from "./no-css-text-overflow";
import noCssTextOrientation from "./no-css-text-orientation";
import noCssTextEmphasis from "./no-css-text-emphasis";
import noCssTextEmphasisPosition from "./no-css-text-emphasis-position";
import noCssTextDecorationThickness from "./no-css-text-decoration-thickness";
import noCssTextDecorationStyle from "./no-css-text-decoration-style";
import noCssTextDecorationSkipInk from "./no-css-text-decoration-skip-ink";
import noCssTextDecorationLine from "./no-css-text-decoration-line";
import noCssTextDecorationColor from "./no-css-text-decoration-color";
import noCssTextAlignLast from "./no-css-text-align-last";
import noCssTableLayout from "./no-css-table-layout";
Expand Down Expand Up @@ -95,6 +102,7 @@ import noCssGap from "./no-css-gap";
import noCssFunctionMin from "./no-css-function-min";
import noCssFunctionMax from "./no-css-function-max";
import noCssFunctionClamp from "./no-css-function-clamp";
import noCssFontStretch from "./no-css-font-stretch";
import noCssFontKerning from "./no-css-font-kerning";
import noCssFlexWrap from "./no-css-flex-wrap";
import noCssFlexDirection from "./no-css-flex-direction";
Expand All @@ -104,6 +112,7 @@ import noCssDisplayFlex from "./no-css-display-flex";
import noCssConicGradient from "./no-css-conic-gradient";
import noCssColumnLayoutProperties from "./no-css-column-layout-properties";
import noCssColumnCount from "./no-css-column-count";
import noCssColorScheme from "./no-css-color-scheme";
import noCssClipPath from "./no-css-clip-path";
import noCssBoxSizing from "./no-css-box-sizing";
import noCssBoxShadow from "./no-css-box-shadow";
Expand Down Expand Up @@ -141,6 +150,7 @@ export { noCssBorderRadius };
export { noCssBoxShadow };
export { noCssBoxSizing };
export { noCssClipPath };
export { noCssColorScheme };
export { noCssColumnCount };
export { noCssColumnLayoutProperties };
export { noCssConicGradient };
Expand All @@ -150,6 +160,7 @@ export { noCssFilter };
export { noCssFlexDirection };
export { noCssFlexWrap };
export { noCssFontKerning };
export { noCssFontStretch };
export { noCssFunctionClamp };
export { noCssFunctionMax };
export { noCssFunctionMin };
Expand Down Expand Up @@ -186,12 +197,17 @@ export { noCssTabSize };
export { noCssTableLayout };
export { noCssTextAlignLast };
export { noCssTextDecorationColor };
export { noCssTextDecorationLine };
export { noCssTextDecorationSkipInk };
export { noCssTextDecorationStyle };
export { noCssTextDecorationThickness };
export { noCssTextEmphasisPosition };
export { noCssTextEmphasis };
export { noCssTextOrientation };
export { noCssTextOverflow };
export { noCssTextShadow };
export { noCssTextUnderlineOffset };
export { noCssTextUnderlinePosition };
export { noCssTransform };
export { noCssUnitCalc };
export { noCssUnitCh };
Expand Down Expand Up @@ -230,9 +246,11 @@ export { noHtmlLang };
export { noHtmlLink };
export { noHtmlLoadingAttribute };
export { noHtmlMarquee };
export { noHtmlMetaColorScheme };
export { noHtmlMeter };
export { noHtmlObject };
export { noHtmlPicture };
export { noHtmlPopover };
export { noHtmlProgress };
export { noHtmlRequired };
export { noHtmlRole };
Expand All @@ -246,4 +264,4 @@ export { noHtmlSvg };
export { noHtmlTarget };
export { noHtmlTextarea };
export { noHtmlVideo };
export { noHtmlWbr };
export { noHtmlWbr };
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";

export default createNoStylePropertyRule(
[
"border-inline-start",
"border-inline-end",
"border-block-start",
"border-block-end",
],
["border-inline-start", "border-inline-end", "border-block-start", "border-block-end"],
39.351851851851855,
"https://www.caniemail.com/features/css-border-inline-block-longhand/",
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createNoStyleValueKeywordRule } from "../../utils/create-no-style-value-keyword-rule";

export default createNoStyleValueKeywordRule(
"color-scheme",
20.3125,
"https://www.caniemail.com/features/css-color-scheme/",
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";

export default createNoStylePropertyRule(
"font-stretch",
50,
"https://www.caniemail.com/features/css-font-stretch/",
);
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";

export default createNoStylePropertyRule(
[
"grid-template",
"grid-template-areas",
"grid-template-columns",
"grid-template-rows",
],
["grid-template", "grid-template-areas", "grid-template-columns", "grid-template-rows"],
37.765957446808514,
"https://www.caniemail.com/features/css-grid-template/",
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";

export default createNoStylePropertyRule(
"text-decoration-line",
52.77777777777778,
"https://www.caniemail.com/features/css-text-decoration-line/",
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createNoStyleValueKeywordRule } from "../../utils/create-no-style-value-keyword-rule";

export default createNoStyleValueKeywordRule(
"text-decoration-skip-ink",
31.73076923076923,
"https://www.caniemail.com/features/css-text-decoration-skip-ink/",
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";

export default createNoStylePropertyRule(
"text-decoration-style",
52.77777777777778,
"https://www.caniemail.com/features/css-text-decoration-style/",
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";

export default createNoStylePropertyRule(
"text-orientation",
46.03174603174603,
"https://www.caniemail.com/features/css-text-orientation/",
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createNoStylePropertyRule } from "../../utils/create-no-style-property-rule";

export default createNoStylePropertyRule(
"text-underline-position",
32.95454545454545,
"https://www.caniemail.com/features/css-text-underline-position/",
);
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/generated/no-html-abbr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"abbr",
56.875,
"https://www.caniemail.com/features/html-abbr/",
);
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"anchor-links",
54.59183673469388,
"https://www.caniemail.com/features/html-anchor-links/",
);
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createNoHTMLAttributeRule } from "../../utils/create-no-html-attribute-rule";

export default createNoHTMLAttributeRule(
"aria-describedby",
"aria-describedby" ,
41.30434782608695,
"https://www.caniemail.com/features/html-aria-describedby/",
);
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createNoHTMLAttributeRule } from "../../utils/create-no-html-attribute-rule";

export default createNoHTMLAttributeRule(
"aria-hidden",
"aria-hidden" ,
67.3913043478261,
"https://www.caniemail.com/features/html-aria-hidden/",
);
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createNoHTMLAttributeRule } from "../../utils/create-no-html-attribute-rule";

export default createNoHTMLAttributeRule(
"aria-label",
"aria-label" ,
67.3913043478261,
"https://www.caniemail.com/features/html-aria-label/",
);
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createNoHTMLAttributeRule } from "../../utils/create-no-html-attribute-rule";

export default createNoHTMLAttributeRule(
"aria-labelledby",
"aria-labelledby" ,
46,
"https://www.caniemail.com/features/html-aria-labelledby/",
);
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createNoHTMLAttributeRule } from "../../utils/create-no-html-attribute-rule";

export default createNoHTMLAttributeRule(
"aria-live",
"aria-live" ,
55.434782608695656,
"https://www.caniemail.com/features/html-aria-live/",
);
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"audio",
31.57894736842105,
"https://www.caniemail.com/features/html-audio/",
);
)
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/generated/no-html-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"base",
39.67391304347826,
"https://www.caniemail.com/features/html-base/",
);
)
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/generated/no-html-bdi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"bdi",
39.130434782608695,
"https://www.caniemail.com/features/html-bdi/",
);
)
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/generated/no-html-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"body",
54.44444444444444,
"https://www.caniemail.com/features/html-body/",
);
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"button-reset",
54.807692307692314,
"https://www.caniemail.com/features/html-button-reset/",
);
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"button-submit",
59.61538461538461,
"https://www.caniemail.com/features/html-button-submit/",
);
)
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/generated/no-html-dfn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"dfn",
64.375,
"https://www.caniemail.com/features/html-dfn/",
);
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default createNoHTMLElementRule(
"dialog",
34.78260869565217,
"https://www.caniemail.com/features/html-dialog/",
);
)
Loading

0 comments on commit c7ce5b0

Please sign in to comment.