Skip to content

Commit

Permalink
Merge pull request #157 from ThomasAribart/add-jdocs
Browse files Browse the repository at this point in the history
Add jsdocs
  • Loading branch information
ThomasAribart committed Aug 17, 2023
2 parents 804d4fa + b551148 commit 74f1f59
Show file tree
Hide file tree
Showing 23 changed files with 174 additions and 270 deletions.
39 changes: 38 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
module.exports = {
plugins: ["prefer-arrow", "import", "prettier", "unused-imports", "jsdoc"],
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:prettier/recommended",
"prettier",
"plugin:jsdoc/recommended",
],
rules: {
"jsdoc/require-jsdoc": [
"warn",
{
contexts: [
"TSTypeAliasDeclaration",
"TSInterfaceDeclaration",
"TSMethodSignature",
"TSPropertySignature",
"TSDeclareFunction",
"TSEnumDeclaration",
],
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
},
],
"jsdoc/require-param-type": "off",
"jsdoc/require-returns-type": "off",
"prettier/prettier": "error",
"import/extensions": "off",
"import/no-unresolved": ["error", { caseSensitiveStrict: true }],
Expand Down Expand Up @@ -67,14 +92,19 @@ module.exports = {
curly: ["error", "all"],
"arrow-body-style": ["error", "as-needed"],
},
settings: {
jsdoc: {
ignorePrivate: true,
ignoreInternal: true,
},
},
root: true,
env: {
es6: true,
node: true,
jest: true,
browser: true,
},
plugins: ["prefer-arrow", "import", "prettier", "unused-imports"],
parserOptions: {
ecmaVersion: 9,
sourceType: "module",
Expand Down Expand Up @@ -119,5 +149,12 @@ module.exports = {
"arrow-body-style": ["error", "as-needed"],
},
},
{
files: ["**/*.test.ts", "scripts/*.ts"],
rules: {
"max-lines": ["off"],
"jsdoc/require-jsdoc": ["off"],
},
},
],
};
6 changes: 3 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
version-resolver:
major:
labels:
Expand All @@ -11,7 +11,7 @@ version-resolver:
labels:
- patch
default: patch
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
template: |
## Changes
Expand Down
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"trailingComma": "all",
"arrowParens": "avoid",
"importOrder": ["^~/(.*)$", "^[./]"],
"importOrderSeparation": true
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrderCaseInsensitive": true
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"scripts": {
"release": "bash scripts/release.bash",
"test": "yarn test-type && yarn test-unit && yarn test-unused-exports && yarn test-lint",
"test": "yarn test-type && yarn test-format && yarn test-unit && yarn test-unused-exports && yarn test-lint",
"test-type": "tsc --noEmit",
"test-lint": "yarn eslint --ext=js,ts .",
"test-format": "yarn prettier . --check",
"test-unit": "jest --verbose --runInBand --collectCoverage --logHeapUsage --passWithNoTests",
"test-unused-exports": "yarn ts-unused-exports ./tsconfig.json --excludePathsFromReport='src/index.ts;'",
"test-lint": "yarn eslint --ext=js,ts .",
"format": "yarn prettier . --write",
"test-circular": "yarn depcruise --validate .dependency-cruiser.js ./src",
"transpile": "babel src --extensions .ts --quiet",
"build": "rm -rf lib && yarn build-cjs && yarn build-esm && yarn build-types",
Expand Down Expand Up @@ -45,6 +46,7 @@
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.1.4",
"eslint-plugin-jsdoc": "^46.4.6",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unused-imports": "^2.0.0",
Expand Down Expand Up @@ -81,4 +83,4 @@
"url": "https://github.com/ThomasAribart/json-schema-to-ts/issues"
},
"homepage": "https://github.com/ThomasAribart/json-schema-to-ts#readme"
}
}
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import typescript from "@rollup/plugin-typescript";
import { join, basename } from "path";
import { basename, join } from "path";
import dts from "rollup-plugin-dts";
import { rollupImportMapPlugin } from "rollup-plugin-import-map";

Expand Down
224 changes: 0 additions & 224 deletions scripts/release.bash

This file was deleted.

2 changes: 1 addition & 1 deletion src/definitions/fromSchemaOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { JSONSchema7Reference } from "~/index";

import type { DeserializationPattern } from "./deserializationPattern";
import type {
JSONSchema7Extension,
ExtendedJSONSchema7Reference,
JSONSchema7Extension,
} from "./extendedJsonSchema7";

/**
Expand Down
Loading

0 comments on commit 74f1f59

Please sign in to comment.