Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: beginnings of jsdoc documentation and introduction of docs to storybook #5008

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ tools/**/*.d.ts
tools/*/node_modules/**/*
config/*
tools/base/src/version.js

# built css assets
packages/**/*.css.ts
projects/**/*.css.ts
tools/**/*.css.ts
styles/**/*.css.ts
7 changes: 6 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"notice",
"@spectrum-web-components",
"import",
"require-extensions"
"require-extensions",
"@stylistic"
],
"env": {
"browser": true,
Expand Down Expand Up @@ -68,6 +69,10 @@
"sp-underlay"
]
}
],
"@stylistic/padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" }
]
},
"extends": [
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"**/*.test-vrt.ts": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"lit-plugin.strict": true
"lit-plugin.strict": true,
"eslint.workingDirectories": ["./packages", "./tools"]
}
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@
"icons:workflow": "wireit",
"lerna-publish": "lerna publish --message \"chore: release new versions #publish\" --force-publish",
"lint": "run-p lint:js lint:docs lint:ts lint:css lint:packagejson",
"lint:fix": "run-p lint:js lint:docs:fix lint:ts:fix lint:css lint:packagejson",
"lint:css": "stylelint \"packages/**/*.css\" \"tools/**/*.css\"",
"lint:docs": "eslint -f pretty \"projects/documentation/**/*.ts\"",
"lint:docs:fix": "eslint --fix -f pretty \"projects/documentation/**/*.ts\"",
"lint:js": "pretty-quick --pattern \"tasks/**/*.js\" && pretty-quick --pattern \"scripts/**/*.js\"",
"lint:packagejson": "pretty-quick --pattern package.json --pattern \"packages/*/package.json\" --pattern \"projects/*/package.json\" --pattern \"tools/*/package.json\" --pattern \"react/*/package.json\"",
"lint:ts": "pretty-quick --pattern \"packages/**/*.ts\" && eslint -f pretty \"packages/**/*.ts\" && pretty-quick --pattern \"tools/**/*.ts\" && eslint -f pretty \"tools/**/*.ts\"",
"lint:ts:fix": "pretty-quick --pattern \"packages/**/*.ts\" && eslint --fix -f pretty \"packages/**/*.ts\" && pretty-quick --pattern \"tools/**/*.ts\" && eslint --fix -f pretty \"tools/**/*.ts\"",
"lint:versions": "node ./scripts/lint-versions.js",
"new-package": "cd projects/templates && plop",
"postcustom-element-json": "lerna exec --ignore \"{@spectrum-web-components/{base,bundle,clear-button,close-button,iconset,modal,shared,opacity-checkerboard,styles,custom-vars-viewer,reactive-controllers,vrt-compare,eslint-plugin},stylelint-header,@swc-react/*,documentation,example-project-rollup,example-project-webpack,swc-templates,@types/swc}\" -- node ../../tasks/check-cem.js",
Expand Down Expand Up @@ -116,7 +119,9 @@
"@storybook/addon-designs": "^8.0.0",
"@storybook/addon-essentials": "^7.5.0",
"@storybook/addon-links": "^7.5.0",
"@storybook/addons": "^7.6.17",
"@storybook/web-components": "^7.5.0",
"@stylistic/eslint-plugin": "^2.12.1",
"@types/chai": "^4.1.7",
"@types/command-line-args": "^5.0.0",
"@types/command-line-usage": "^5.0.1",
Expand Down Expand Up @@ -155,6 +160,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-formatter-pretty": "^5.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^50.6.1",
"eslint-plugin-lit-a11y": "^2.2.2",
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
2 changes: 2 additions & 0 deletions packages/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# built css assets
packages/**/*.css.ts
265 changes: 261 additions & 4 deletions packages/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@
"es6": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "notice", "@spectrum-web-components"],
"plugins": [
"@typescript-eslint",
"notice",
"@spectrum-web-components",
"@stylistic",
"jsdoc",
"lit-a11y"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:lit-a11y/recommended"
"plugin:lit-a11y/recommended",
"plugin:jsdoc/recommended-typescript"
],
"ignorePatterns": ["packages/**/*.css.ts"],
"settings": {
"jsdoc": {
"tagNamePreference": {
"attr": "attribute"
}
}
},
"rules": {
"no-debugger": 2,
"no-console": [
Expand All @@ -20,6 +36,221 @@
"allow": ["warn", "error"]
}
],
"jsdoc/check-tag-names": [
"warn",
{
"definedTags": ["element", "slot", "attribute", "csspart"]
}
],
"jsdoc/require-param": 0,
"jsdoc/require-returns": 0,
"jsdoc/informative-docs": 1,
"jsdoc/no-bad-blocks": 1,
"jsdoc/sort-tags": [
"warn",
{
"tagSequence": [
{
"tags": [
// Brief descriptions
"summary",
"typeSummary"
]
},
{
"tags": [
// Module/file-level
"element",
"module",
"exports",
"file",
"fileoverview",
"overview",
"import"
]
},
{
"tags": [
// Identifying (name, type)
"typedef",
"interface",
"record",
"template",
"name",
"kind",
"type",
"alias",
"external",
"host",
"callback",
"func",
"function",
"method",
"class",
"constructor"
]
},
{
"tags": [
// Relationships
"modifies",
"mixes",
"mixin",
"mixinClass",
"mixinFunction",
"namespace",
"borrows",
"constructs",
"lends",
"implements",
"requires"
]
},
{
"tags": [
// Long descriptions
"desc",
"description",
"classdesc",
"tutorial",
"copyright",
"license"
]
},
{
"tags": [
// Simple annotations
"const",
"constant",
"final",
"global",
"readonly",
"abstract",
"virtual",
"var",
"member",
"memberof",
"memberof!",
"inner",
"instance",
"inheritdoc",
"inheritDoc",
"override",
"hideconstructor"
]
},
{
"tags": [
// Core function/object info
"param",
"arg",
"argument",
"prop",
"property",
"slot",
"return",
"returns"
]
},
{
"tags": [
// Important behavior details
"async",
"generator",
"default",
"defaultvalue",
"enum",
"augments",
"extends",
"throws",
"exception",
"yield",
"yields",
"event",
"fires",
"emits",
"listens",
"this"
]
},
{
"tags": [
// Access
"static",
"private",
"protected",
"public",
"access",
"package"
]
},
{ "tags": ["-other"] },
{
"tags": [
// Supplementary descriptions
"see",
"example"
]
},
{
"tags": [
// Other Closure (undocumented) metadata
"closurePrimitive",
"customElement",
"expose",
"hidden",
"idGenerator",
"meaning",
"ngInject",
"owner",
"wizaction"
]
},
{
"tags": [
// Other Closure (documented) metadata
"define",
"dict",
"export",
"externs",
"implicitCast",
"noalias",
"nocollapse",
"nocompile",
"noinline",
"nosideeffects",
"polymer",
"polymerBehavior",
"preserve",
"struct",
"suppress",
"unrestricted"
]
},
{
"tags": [
// Non-Closure metadata
"ignore",
"author",
"version",
"variation",
"since",
"deprecated",
"todo"
]
}
],
"alphabetizeExtras": true
}
],
"jsdoc/tag-lines": ["warn", "any", { "startLines": 1, "endLines": 1 }],
"jsdoc/no-blank-blocks": [
"warn",
{
"enableFixer": true
}
],
"jsdoc/require-hyphen-before-param-description": 1,
"@spectrum-web-components/prevent-argument-names": [
"error",
["e", "ev", "evt", "err"]
Expand Down Expand Up @@ -67,6 +298,24 @@
{
"argsIgnorePattern": "^_"
}
],
"@stylistic/padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": ["return", "if", "try", "switch"]
},
{
"blankLine": "always",
"prev": ["const", "let", "var", "if", "try", "switch"],
"next": "*"
},
{
"blankLine": "any",
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
}
]
},
"overrides": [
Expand All @@ -80,13 +329,21 @@
"rules": {
"@spectrum-web-components/document-active-element": ["off"],
"lit-a11y/no-autofocus": ["off"],
"lit-a11y/tabindex-no-positive": ["off"]
"lit-a11y/tabindex-no-positive": ["off"],
"jsdoc/require-jsdoc": 0
}
},
{
"files": ["**/icons/*.ts", "**/src/elements/*.ts"],
"rules": {
"sort-imports": ["off"]
"sort-imports": ["off"],
"@stylistic/padding-line-between-statements": 0
}
},
{
"files": ["**/stories/*"],
"rules": {
"jsdoc/require-jsdoc": 0
}
},
{
Expand Down
Loading
Loading