Skip to content

Commit

Permalink
fix: update documentation generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Dec 10, 2024
1 parent e7bbf9b commit f7d62ea
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: home

hero:
name: '@rotki/eslint-plugin'
tagline: ESLint plugin for Vue I18n
tagline: ESLint plugin for rotki
actions:
- theme: brand
text: Introduction
Expand Down
11 changes: 8 additions & 3 deletions docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@
- :star: mark: the rule which is enabled by `plugin:@rotki/recommended` preset.
- :black_nib: mark: the rule which is fixable by `eslint --fix` command.

## Recommended
## recommended

<!--prettier-ignore-->
| Rule ID | Description | |
|:--------|:------------|:---|
| [@rotki/<wbr>consistent-ref-type-annotation](./consistent-ref-type-annotation.html) | Ensures consistent type annotation position for ref, computed assignments | :star::black_nib: |
| [@rotki/<wbr>no-deprecated-classes](./no-deprecated-classes.html) | disallow the usage of vuetify css classes since they are replaced with tailwindcss | :star::black_nib: |
| [@rotki/<wbr>no-deprecated-components](./no-deprecated-components.html) | Removes deprecated classes that do not exist anymore | :star::black_nib: |
| [@rotki/<wbr>no-deprecated-props](./no-deprecated-props.html) | Replaces deprecated props with their replacements | :star::black_nib: |
| [@rotki/<wbr>no-dot-ts-imports](./no-dot-ts-imports.html) | Checks and replaces .ts extension in import statements. | :star::black_nib: |
| [@rotki/<wbr>no-legacy-library-import](./no-legacy-library-import.html) | Reports and replaces imports of @rotki/ui-library-compat with @rotki/ui-library | :star::black_nib: |

## Best Practices
## strict

<!--prettier-ignore-->
| Rule ID | Description | |
|:--------|:------------|:---|

## Stylistic Issues
## stylistic

<!--prettier-ignore-->
| Rule ID | Description | |
Expand Down
5 changes: 3 additions & 2 deletions docs/rules/no-deprecated-props.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
title: '@rotki/no-deprecated-props'
description: ...
description: Replaces deprecated props with their replacements
since: v0.2.0
---

# @rotki/no-deprecated-props

> ...
> Replaces deprecated props with their replacements
- :star: The `"extends": "plugin:@rotki/recommended"` property in a configuration file enables this rule.
- :black_nib:️ The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-legacy-library-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ since: v0.2.0

> Reports and replaces imports of @rotki/ui-library-compat with @rotki/ui-library
- :star: The `"extends": "plugin:@rotki/recommended"` property in a configuration file enables this rule.
- :black_nib:️ The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"clean": "rimraf .nyc_output coverage dist docs/.vitepress/dist",
"coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
"generate": "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-rule-docs.ts",
"generate:index": "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-docs-index.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"build": "unbuild",
Expand All @@ -39,7 +40,7 @@
"test:coverage": "vitest run --coverage",
"new": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/new-rule.ts",
"docs": "vitepress dev docs",
"docs:build": "pnpm run generate && vitepress build docs",
"docs:build": "pnpm run generate && pnpm run generate:index && vitepress build docs",
"prepare": "husky",
"typecheck": "tsc --noEmit",
"release": "bumpp -r --no-push"
Expand Down
5 changes: 4 additions & 1 deletion scripts/update-docs-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
*/
import { writeFileSync } from 'node:fs';
import { resolve } from 'node:path';
import url from 'node:url';
import { type Options, format } from 'prettier';
import { type RuleInfo, withCategories } from './utils';

const dirname = url.fileURLToPath(new URL('.', import.meta.url));

const prettierrc: Options = {
semi: true,
singleQuote: true,
Expand Down Expand Up @@ -36,7 +39,7 @@ ${rules.map(toTableRow).join('\n')}
`;
}

const filePath = resolve(__dirname, '../docs/rules/index.md');
const filePath = resolve(dirname, '../docs/rules/index.md');
const content = `# Available Rules
- :star: mark: the rule which is enabled by \`plugin:@rotki/recommended\` preset.
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-deprecated-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export default createEslintRule<Options, MessageIds>({
defaultOptions: [],
meta: {
docs: {
description: '...',
description: 'Replaces deprecated props with their replacements',
recommendation: 'recommended',
},
fixable: 'code',
messages: {
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-legacy-library-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default createEslintRule<Options, MessageIds>({
meta: {
docs: {
description: `Reports and replaces imports of ${legacyLibrary} with ${newLibrary}`,
recommendation: 'recommended',
},
fixable: 'code',
messages: {
Expand Down

0 comments on commit f7d62ea

Please sign in to comment.