Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 29, 2023
1 parent 9484505 commit d21b0e3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions docs/.vuepress/components/components/PgEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
language === 'yaml'
? 'yaml-eslint-parser'
: language === 'toml'
? 'toml-eslint-parser'
: language === 'html'
? 'vue-eslint-parser'
: language === 'json'
? 'jsonc-eslint-parser'
: 'espree'
? 'toml-eslint-parser'
: language === 'html'
? 'vue-eslint-parser'
: language === 'json'
? 'jsonc-eslint-parser'
: 'espree'
"
:code="value"
:rules="rules"
Expand Down
12 changes: 6 additions & 6 deletions docs/.vuepress/components/eslint-code-block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
language === 'yaml'
? 'yaml-eslint-parser'
: language === 'toml'
? 'toml-eslint-parser'
: language === 'html'
? 'vue-eslint-parser'
: language === 'json'
? 'jsonc-eslint-parser'
: 'espree'
? 'toml-eslint-parser'
: language === 'html'
? 'vue-eslint-parser'
: language === 'json'
? 'jsonc-eslint-parser'
: 'espree'
"
/>
</template>
Expand Down
12 changes: 6 additions & 6 deletions docs/.vuepress/components/rules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ categories.sort((a, b) =>
a.categoryOrder > b.categoryOrder
? 1
: a.categoryOrder < b.categoryOrder
? -1
: a.title > b.title
? 1
: a.title < b.title
? -1
: 0,
? -1
: a.title > b.title
? 1
: a.title < b.title
? -1
: 0,
);

export const DEFAULT_RULES_CONFIG = allRules.reduce((c, r) => {
Expand Down
8 changes: 4 additions & 4 deletions src/rules/no-invalid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ function parseMergeSchemasOption(
return option === true
? SCHEMA_KINDS
: Array.isArray(option)
? [...(option as SchemaKind[])].sort(
(a, b) => SCHEMA_KINDS.indexOf(a) - SCHEMA_KINDS.indexOf(b),
)
: null;
? [...(option as SchemaKind[])].sort(
(a, b) => SCHEMA_KINDS.indexOf(a) - SCHEMA_KINDS.indexOf(b),
)
: null;
}

export default createRule("no-invalid", {
Expand Down
12 changes: 6 additions & 6 deletions tests/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ function getConfig(ruleName: string, inputFile: string) {
code = hashComment
? `# ${filename}\n${code0}`
: blockComment
? `/* ${filename} */\n${code0}`
: `<!--${filename}-->\n${code0}`;
? `/* ${filename} */\n${code0}`
: `<!--${filename}-->\n${code0}`;
return Object.assign(
{ parser: require.resolve(getParserName(inputFile)) },
config,
Expand All @@ -273,17 +273,17 @@ function getConfig(ruleName: string, inputFile: string) {
const configStr = hashComment
? /^#([^\n]+)\n/u.exec(code0)
: blockComment
? /^\/\*(.*?)\*\//u.exec(code0)
: /^<!--(.*?)-->/u.exec(code0);
? /^\/\*(.*?)\*\//u.exec(code0)
: /^<!--(.*?)-->/u.exec(code0);
if (!configStr) {
fs.writeFileSync(inputFile, `/* {} */\n${code0}`, "utf8");
throw new Error("missing config");
} else {
code = hashComment
? code0.replace(/^#([^\n]+)\n/u, `# ${filename}\n`)
: blockComment
? code0.replace(/^\/\*(.*?)\*\//u, `# ${filename}\n`)
: code0.replace(/^<!--(.*?)-->/u, `<!--${filename}-->`);
? code0.replace(/^\/\*(.*?)\*\//u, `# ${filename}\n`)
: code0.replace(/^<!--(.*?)-->/u, `<!--${filename}-->`);
try {
config = configStr ? JSON.parse(configStr[1]) : {};
} catch (e: any) {
Expand Down

0 comments on commit d21b0e3

Please sign in to comment.