Skip to content

Commit

Permalink
chore: integrate prettier config and fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Jan 16, 2024
1 parent 9f06ca2 commit 5b7fe8b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
14 changes: 7 additions & 7 deletions docs/rules/no-deprecated-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@ This rule reports usages of deprecated css classes in the code.
</template>
<template>
<div class="block" />
<div class="block" />
</template>
<template>
<div class="grow" />
<div class="grow" />
</template>
<template>
<div class="justify-between" />
<div class="justify-between" />
</template>
<!-- ✗ BAD -->
<template>
<div class="d-flex flex-column" />
<div class="d-flex flex-column" />
</template>
<template>
<div class="d-block" />
<div class="d-block" />
</template>
<template>
<div class="grow" />
<div class="grow" />
</template>
<template>
<div class="justify-space-between" />
<div class="justify-space-between" />
</template>
```

Expand Down
11 changes: 6 additions & 5 deletions scripts/update-docs-index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/**
* Forked from https://github.com/intlify/eslint-plugin-vue-i18n/blob/master/scripts/update-docs-index.ts
*/
import { readFileSync, writeFileSync } from 'node:fs';
import { join, resolve } from 'node:path';
import { writeFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { type Options, format } from 'prettier';
import { type RuleInfo, withCategories } from './lib/rules';

const prettierrc = JSON.parse(
readFileSync(join(__dirname, '../.prettierrc.json'), 'utf8'),
) as Options;
const prettierrc: Options = {
semi: true,
singleQuote: true,
};

function toTableRow(rule: RuleInfo) {
const mark = `${rule.recommended ? ':star:' : ''}${
Expand Down
7 changes: 4 additions & 3 deletions scripts/update-rule-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import rules, { type RuleInfo } from './lib/rules';

const PLACE_HOLDER = /#[^\n]*\n+> .+\n+(?:- .+\n)*\n*/u;

const prettierrc = JSON.parse(
readFileSync(join(__dirname, '../.prettierrc.json'), 'utf8'),
) as Options;
const prettierrc: Options = {
semi: true,
singleQuote: true,
};

async function pickSince(content: string): Promise<string | null> {

Check warning on line 16 in scripts/update-rule-docs.ts

View workflow job for this annotation

GitHub Actions / ci

Async function 'pickSince' has no 'await' expression
const fileIntro = /^---\n(?<content>[\s\S]+?)---\n*/u.exec(content);
Expand Down

0 comments on commit 5b7fe8b

Please sign in to comment.