Skip to content

Commit

Permalink
chore(core): updated eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Aug 8, 2024
1 parent 2e1ef74 commit 5539f90
Show file tree
Hide file tree
Showing 28 changed files with 146 additions and 113 deletions.
22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

22 changes: 11 additions & 11 deletions devtools/packages/prebuild-options/tasks/generate-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import { ManuallyValidatedOption } from 'typedoc'`);

if (docsConfig.translatablePath) {
out.push(`
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Internationalization {
export interface TranslatableStrings {
theme_default_value: [];
Expand Down Expand Up @@ -120,23 +120,23 @@ ${name}: ${getType(name, option, true)};`,
}
${mixedTypes
?.filter(([name]) => !ignoreTypes.includes(name))
.map(([name, option]) => {
return `
?.filter(([name]) => !ignoreTypes.includes(name))
.map(([name, option]) => {
return `
/**
* ${getComments(name)}
*/
export interface ${capitalize(name)} {
${Object.entries(option.defaultValue as any)
.map(
([key, value]) =>
`'${key}'${value === undefined ? '?' : ''}: ${getValueType(value)}`,
)
.join(';')}
.map(
([key, value]) =>
`'${key}'${value === undefined ? '?' : ''}: ${getValueType(value)}`,
)
.join(';')}
}
`;
})
.join('\n')}
})
.join('\n')}
`);

const optionsModelFile = path.join(process.cwd(), 'src/types/options.ts');
Expand Down
13 changes: 13 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
},
},
);
126 changes: 82 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"devdocs": "npm run build --workspace typedoc-plugin-markdown && typedoc",
"build-all": "npm run build --workspaces --if-present",
"test-all": "npm run test --workspaces --if-present",
"lint-all": "npm run lint --workspaces --if-present",
"prerelease": "npm run build-all",
"release": "npx changeset publish",
"prepare": "husky"
Expand All @@ -23,11 +24,11 @@
"@changesets/cli": "^2.27.7",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.8.0",
"@types/eslint__js": "^8.42.3",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.12",
"@types/node": "^22.1.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"barrelsby": "^2.8.1",
"consola": "^3.2.3",
"copyfiles": "^2.4.1",
Expand All @@ -52,6 +53,7 @@
"tsc-alias": "^1.8.10",
"typedoc": "^0.26.5",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.1",
"unified-prettier": "^2.0.1"
}
}
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-typedoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"typedoc-plugin-markdown": ">=4.0.0"
},
"scripts": {
"lint": "eslint ./src --ext .ts",
"lint": "eslint ./src",
"prebuild": "rm -rf dist && prebuild-options",
"prepublishOnly": "npm run lint && npm run build",
"build": "tsc",
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-plugin-typedoc/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async function generateTypedoc(context: any, opts: Partial<PluginOptions>) {

const pluginOptions = getPluginOptions(opts);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { id, sidebar, ...optionsPassedToTypeDoc } = pluginOptions;

const outputDir = path.join(siteDir, pluginOptions.out);
Expand Down Expand Up @@ -85,7 +86,7 @@ async function generateTypedoc(context: any, opts: Partial<PluginOptions>) {

const docsPresetPath = docsPreset ? docsPreset[1]?.docs?.path : null;

if (Boolean(docsPresetPath)) {
if (docsPresetPath) {
baseDir = adjustBaseDirectory(baseDir, docsPresetPath);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-typedoc/src/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getNavigationItem(
const parsedUrl =
numberPrefixParser === false
? navigationItemPath
: navigationItemPath?.replace(/\d+\-/g, '');
: navigationItemPath?.replace(/\d+-/g, '');

const getId = () => {
const idParts: string[] = [];
Expand Down
Loading

0 comments on commit 5539f90

Please sign in to comment.